Re: [PERFORM] GIN index not used if created in the same transaction as query

2017-05-19 Thread Tom Lane
Adam Brusselback writes: > Is there any easy way I can know if an index is usable or not? Are there > any catalog views or anything I could check that in? IIRC, you can look at pg_index.indcheckxmin --- if that's set, then the index had broken HOT chains during creation and may not be usable righ

Re: [PERFORM] GIN index not used if created in the same transaction as query

2017-05-19 Thread Adam Brusselback
> > Does the "multiple steps" part involve UPDATEs on pre-existing rows? > Do the updates change the column(s) used in the gin index? > Yes they do, however the updates happen prior to the index creation. I just tried, and that looks like the solution. I really appreciate your help on this. Is

Re: [PERFORM] GIN index not used if created in the same transaction as query

2017-05-19 Thread Tom Lane
Adam Brusselback writes: > I have a function which builds two temp tables, fills each with data (in > multiple steps), creates a gin index on one of the tables, analyzes each > table, then runs a query joining the two. > My issue is, I am getting inconsistent results for if the query will use > th