Re: Is stats update during COPY IN really a good idea? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Is stats update during COPY IN really a good idea?
Date
Msg-id 29501.990467664@sss.pgh.pa.us
Whole thread Raw
In response to Re: Is stats update during COPY IN really a good idea?  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> People are using COPY into the same table at the same time? 

Yes --- we had a message from someone who was doing that (and running
into unrelated performance issues) just last week.

> My vote is to update pg_class.  The VACUUM takes much more time than the
> update, and we are only updating the pg_class row, right?

What?  What does VACUUM have to do with this?

The reason this is a significant issue is that the first COPY could be
inside a transaction, in which case the lock will persist until that
transaction commits, which could be awhile.

> Can't we just start a new transaction and update the pg_class row,
> that way we don't have to open it for writing during the copy.

No, we cannot; requiring COPY to happen outside a transaction block is
not acceptable.
        regards, tom lane


pgsql-hackers by date:

Previous
From: teg@redhat.com (Trond Eivind Glomsrød)
Date:
Subject: Re: Using 7.1rc1 under RH 6.2
Next
From: "Mikheev, Vadim"
Date:
Subject: RE: Plans for solving the VACUUM problem