Re: [GENERAL] Concurrency problem building indexes - Mailing list pgsql-hackers

From Zeugswetter Andreas DCP SD
Subject Re: [GENERAL] Concurrency problem building indexes
Date
Msg-id E1539E0ED7043848906A8FF995BDA579F31C06@m0143.s-mxs.net
Whole thread Raw
Responses Re: [GENERAL] Concurrency problem building indexes
Re: [GENERAL] Concurrency problem building indexes
List pgsql-hackers
> > [ shrug... ]  Worksforme.
> >
> > There is a short interval at the end of the first CREATE INDEX on
the
> > table where the problem would happen if another CREATE INDEX tries
to
> > modify the pg_class row before the first one's committed.

> I did a pg_dumpall and removed the index creation commands.  The first
time
> I run the index build, I usually get at least one occurrence.

I think that narrows it down nicely. You create the table, load rows,
then without
analyze create the indexes, thus pg_class is not up to date, and the
update
needs to be done.

My answer to this would be to (have an option to) ommit this relpages
and reltuples update. It is imho not the task of create index to update
statistics
in the first place. I have been burnt by that behavior when creating
indexes on empty
tables in Informix and never liked it (iirc pg has a workaround for
empty tables though).

Wes, you could most likely solve your immediate problem if you did an
analyze before
creating the indexes.

Andreas


pgsql-hackers by date:

Previous
From: Gevik Babakhani
Date:
Subject: Re: TODO Item: ACL_CONNECT
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Checking assumptions