PATCH: optimized DROP of multiple tables within a transaction

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: pgsql-hackers(at)postgresql(dot)org
Subject: PATCH: optimized DROP of multiple tables within a transaction
Date: 2012-08-24 22:36:34
Message-ID: 503801F2.7070907@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

attached is a patch that improves performance when dropping multiple
tables within a transaction. Instead of scanning the shared buffers for
each table separately, the patch removes this and evicts all the tables
in a single pass through shared buffers.

Our system creates a lot of "working tables" (even 100.000) and we need
to perform garbage collection (dropping obsolete tables) regularly. This
often took ~ 1 hour, because we're using big AWS instances with lots of
RAM (which tends to be slower than RAM on bare hw). After applying this
patch and dropping tables in groups of 100, the gc runs in less than 4
minutes (i.e. a 15x speed-up).

This is not likely to improve usual performance, but for systems like
ours, this patch is a significant improvement.

kind regards
Tomas

Attachment Content-Type Size
drop-in-transaction.patch text/plain 7.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-08-25 01:49:03 Re: NOT NULL constraints in foreign tables
Previous Message Andres Freund 2012-08-24 22:19:23 Re: plperl sigfpe reset can crash the server