Re: Drop indexes inside transaction? - Mailing list pgsql-admin

From Tom Lane
Subject Re: Drop indexes inside transaction?
Date
Msg-id 24577.1076048581@sss.pgh.pa.us
Whole thread Raw
In response to Drop indexes inside transaction?  (Steve Lane <slane@moyergroup.com>)
Responses Re: Drop indexes inside transaction?  (Steve Lane <slane@moyergroup.com>)
List pgsql-admin
Steve Lane <slane@moyergroup.com> writes:
> Now we want to use COPY to bring the data in. The target table has 6
> indexes. Without indexes, naturally, we can load 80K rows in 2 seconds. With
> indexes, 46 seconds. (oddly, ONE index contributes 40+ seconds of that, yet
> they're all similar, single-column indexes. Anyway, that's another story).

No, I'd say that's the key part of the story.  Details?

> So I hit on the idea of doing the same thing, but inside a transaction. In
> theory that should affect no one else.

... other than locking them out of the table while the transaction runs.
That doesn't sound like what you want to do.  In any case, reindexing
the table will get slower and slower as the pre-existing data in the
table expands.

            regards, tom lane

pgsql-admin by date:

Previous
From: Steve Lane
Date:
Subject: Index (re)-creation speed
Next
From: Tom Lane
Date:
Subject: Re: Index (re)-creation speed