Re: Creating indexes in the background - Mailing list pgsql-hackers

From David Lee
Subject Re: Creating indexes in the background
Date
Msg-id 2D87615F-12B6-474C-8C53-9EA0EA0C6C6B@gmail.com
Whole thread Raw
In response to Re: Creating indexes in the background  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
>> Since I've mentioned my use case, I might as well mention another issue I stumbled across, which is that concurrent
indexcreation cannot happen from within trigger functions. I'm able to non-concurrently create indexes from within
triggerfunctions. Why is there this disparity? 
>
> Because concurrent index creation needs to open and commit transactions
> underneath, which regular index creation does not.  Functions cannot run
> across transaction boundaries.

Would having background index creation allow for this? For example, launching a background concurrent index creation
couldrecord just the "actuation" of the index creation in the trigger's transaction, and postgresql would actually
populatethe index once the trigger's transaction is committed. 

--David


pgsql-hackers by date:

Previous
From: Christian Kruse
Date:
Subject: Re: Patch für MAP_HUGETLB for mmap() shared memory
Next
From: Baptiste LHOSTE
Date:
Subject: Autoanalyze of the autovacuum daemon ...