Re: COPY locking - Mailing list pgsql-general

From Tom Lane
Subject Re: COPY locking
Date
Msg-id 24629.989527554@sss.pgh.pa.us
Whole thread Raw
In response to RE: COPY locking  ("Mikheev, Vadim" <vmikheev@SECTORBASE.COM>)
List pgsql-general
"Mikheev, Vadim" <vmikheev@SECTORBASE.COM> writes:
> access/heap/hio.c:RelationGetBufferForRelation() uses LockPage
> (ie lmgr -> semops) to syncronize table extending.

But no semop should occur unless somebody is actually blocking on
the lock.  John's trace only showed one active backend, so I figured
that there shouldn't be any blockage.

> Probably we could
> optimize this somehow, but allocation of new page in bufmgr is
> horrible and that's why we have locks in hio.c from the beginning.

See later message about eliminating lseeks --- I think we should be
able to avoid doing this lock for every single tuple, as it does now,
and only do it when we need to allocate a new page.

            regards, tom lane

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: NAMEDATALEN
Next
From: Zak McGregor
Date:
Subject: Re: formatting a date