pgsql: Release the exclusive lock on the table early after truncating it

Started by Alvaro Herreraalmost 19 years ago4 messagescomitters
Jump to latest
#1Alvaro Herrera
alvherre@postgresql.org

Log Message:
-----------
Release the exclusive lock on the table early after truncating it in lazy
vacuum, instead of waiting till commit.

Modified Files:
--------------
pgsql/src/backend/commands:
vacuumlazy.c (r1.92 -> r1.93)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/vacuumlazy.c?r1=1.92&r2=1.93)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#1)
Re: pgsql: Release the exclusive lock on the table early after truncating it

alvherre@postgresql.org (Alvaro Herrera) writes:

Release the exclusive lock on the table early after truncating it in lazy
vacuum, instead of waiting till commit.

Weren't you going to disable vacuum_delay in that stretch of code, too?

BTW, not sure if you realized this, but just deleting the
vacuum_delay_point call is probably a bad idea --- replace it
with CHECK_FOR_INTERRUPTS() instead.

regards, tom lane

#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Tom Lane (#2)
Re: pgsql: Release the exclusive lock on the table early after truncating it

Tom Lane wrote:

alvherre@postgresql.org (Alvaro Herrera) writes:

Release the exclusive lock on the table early after truncating it in lazy
vacuum, instead of waiting till commit.

Weren't you going to disable vacuum_delay in that stretch of code, too?

BTW, not sure if you realized this, but just deleting the
vacuum_delay_point call is probably a bad idea --- replace it
with CHECK_FOR_INTERRUPTS() instead.

Hmm, I didn't. Will fix.

Actually, now that you mention it, I remember that Alexey Kluykin (a
colleague from Command Prompt) had already mentioned it to me and I
forgot :-(

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#4Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Tom Lane (#2)
Re: pgsql: Release the exclusive lock on the table early after truncating it

Tom Lane wrote:

alvherre@postgresql.org (Alvaro Herrera) writes:

Release the exclusive lock on the table early after truncating it in lazy
vacuum, instead of waiting till commit.

Weren't you going to disable vacuum_delay in that stretch of code, too?

I forgot to mention that I had patched this separately. I back-patched
the removal of vacuum_delay all the way to 8.0, but the early release of
the AccessExclusive lock I limited to HEAD.

--
Alvaro Herrera http://www.amazon.com/gp/registry/DXLWNGRJD34J
"The West won the world not by the superiority of its ideas or values
or religion but rather by its superiority in applying organized violence.
Westerners often forget this fact, non-Westerners never do."
(Samuel P. Huntington)