pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeremy M. Guthrie <jeremy.guthrie@berbee.com>
To: pgsql-performance@postgresql.org
Subject: Poor delete performance AFTER vacuum analyze
Date: Sat, 19 Jul 2003 16:22:40 -0500
Message-ID: <200307191622.46709.jeremy.guthrie@berbee.com> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

	I have an application I wrote that uses two tables heavily.  The first table 
is a queue table, the second table is an archive table.  The queue table is 
constantly taking on new records at the rate of 10/second.  My software pulls 
the logs from the queue table, processes them, moves them to the archive 
table, and then deletes the processed entries from the queue table.

	Symptoms:
	My system will run great after a full vacuum(as I would expect).  It will run 
all day long taking only 3-5 seconds to run and deal with approximately 
100megs of new data each day.  However, the instant the system finishes only 
a 'vacuum analyze', the whole thing slows WAY down to where each run can take 
10-15 minutes.

	ie.  After a full analyze vacuum, my software will load, process, move, and 
delete in under 3-4 seconds.  After a analyze vacuum(notice: not full), it 
can load, process and move data in 3-5 seconds but the delete takes 10-15 
minutes!  I submit the delete as one transaction to clear out the records 
processed.  Trunactae won't work because other records are coming in while I 
process data.  Mind you the archive table is 15 million records while the 
temporary table is maybe 10-20,000 records. 

	Now I just rewrote a portion of my application to change its behavior.  What 
it did before was that it would pile through a 10 gig archive table, 
processed logs, etc... in about 3 minutes but I did not delete in the same 
way because everything is already in one table.  My software has to run every 
five minutes so the three minute runtime is getting close for process 
overlap(yuck). 

	Recap
	The old system didn't delete records but plowed through the 10 gig db and 
takes 3 1/2 minutes to do its job.  The new system flies through the smaller 
queue table(100-200k) but it dies after conducting a non-full vacuum.

	Is the planner just that much better at analyzing a full then an regular 
analyze or is there something else I'm missing?

The Box:
The DB is a dual P4 2.4ghz Xeon w/ 1.5 gig of RAM.  IBM 335 w/ 36gig mirrored.

kernel.shmmax = 1342177280

shared_buffers = 115200        # 2*max_connections, min 16
sort_mem = 65536             # min 32
vacuum_mem = 196608          # min 1024
fsync = false


- -- 
Jeremy M. Guthrie
Systems Engineer
Berbee
5520 Research Park Dr.
Madison, WI  53711
Phone:  608-298-1061

Berbee...Decade 1.  1993-2003
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/GbajqtjaBHGZBeURAkKiAJ9zaqQISD47XycRcSgDKbNeuqqaKQCfcgim
yCdaycBg4+99Epd7EuAAxsE=
=9xlS
-----END PGP SIGNATURE-----




view thread (5+ messages)  latest in thread

Message-ID: <200307191622.46709.jeremy.guthrie@berbee.com>
Permalink:  ../200307191622.46709.jeremy.guthrie@berbee.com/
Also on:    postgresql.org/message-id/200307191622.46709.jeremy.guthrie@berbee.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: jeremy.guthrie@berbee.com
  Subject: Re: Poor delete performance AFTER vacuum analyze
  In-Reply-To: <200307191622.46709.jeremy.guthrie@berbee.com>
  References: <200307191622.46709.jeremy.guthrie@berbee.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox