Preventing GIN fastupdate from slowing down normal queries

From: Zev Benjamin <zev-pgsql(at)strangersgate(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Preventing GIN fastupdate from slowing down normal queries
Date: 2014-03-14 20:48:48
Message-ID: 53236B30.8090303@strangersgate.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

I'm running PostgreSQL 9.1 on a fairly beefy server with a lot of RAM,
so I generally want work_mem set pretty high. One of my tables has a
GIN index, and, as a consequence of the high work_mem setting, its
fastupdate pending list can grow very large. This leads to the
occasional INSERT or UPDATE taking inordinately long as the pending list
is flushed.

My thinking was that I could prevent the list from growing too large by
setting the autovacuum storage parameters on the table such that the
autovacuum process will run after a reasonable number of INSERTs or
UPDATEs. However, the table is mostly INSERT-only. Therefore, only the
autovacuum_analyze_* parameters will actually do anything to affect when
the autovacuumer will run, but when it does, it will do a VACUUM ANALYZE
instead of a plain VACUUM. I don't particularly need the table to be
re-analyzed that often.

Are there any other good solutions for preventing the fastupdate
mechanism from impacting normal queries? I would also consider just
turning fastupdate off, but my understanding is that can lead to the
index becoming less efficient. Is there a way to set work_mem low just
for the purpose of sizing the pending list?

Thanks,
Zev

Browse pgsql-general by date

  From Date Subject
Next Message Anand Kumar, Karthik 2014-03-14 22:37:34 Re: Increase in max_connections
Previous Message Andy Colson 2014-03-14 20:21:18 Re: High Level Committers Wanted