pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Aaron Krowne <akrowne@vt.edu>
Cc: pgsql-performance@postgresql.org
Subject: Re: postgresql meltdown on PlanetMath.org
Date: Sun, 16 Mar 2003 03:29:14 -0800
Message-ID: <3E74600A.8050902@joeconway.com> (raw)
In-Reply-To: <20030316075206.GE19570@vt.edu>
References: <20030316060125.GD19570@vt.edu>
	<3E741B93.1090203@joeconway.com>
	<20030316075206.GE19570@vt.edu>

Aaron Krowne wrote:
>>- What version of Postgres?
> 7.2.1

You should definitely look at upgrading, at least to 7.2.4 (which you 
can do without requiring a dump/reload cycle), but better yet to 7.3.2 
(which will require a dump/reload cycle). I don't know that will fix you 
specific issue, but there were some critical bug fixes between 7.2.1 and 
7.2.4.

>>- Does the database see mostly SELECTs and INSERTs, or are there many
>>  UPDATEs and/or DELETEs too?
> 
> Almost exclusively SELECTs.
> 
> OK, I have just run a VACUUM FULL ANALYZE and things seem much better...

Hmmm, do you periodically do large updates or otherwise turn over rows 
in batches?

> which would be the first time its really made a difference =)  I tried
> comparing an EXPLAIN ANALYZE of a single row select on the main objects
> table before and after the vacuum, and the plan didn't change
> (sequential scan still), but the response time went from ~1 second to
> ~5msec!  I'm not really sure what could have happened here
> behind-the-scenes since it didn't start using the index, and there
> probably weren't more than 10% updated/added rows since the last VACUUM.

If your app is mostly doing equi-lookups by primary key, and indexes 
aren't being used (I think I saw you mention that on another post), then 
something else is still wrong. Please pick one or two typical queries 
that are doing seq scans and post the related table definitions, 
indexes, SQL, and EXPLAIN ANALYZE. I'd bet you are getting bitten by a 
datatype mismatch or something.

Joe




view thread (39+ messages)  latest in thread

Message-ID: <3E74600A.8050902@joeconway.com>
Permalink:  ../3E74600A.8050902@joeconway.com/
Also on:    postgresql.org/message-id/3E74600A.8050902@joeconway.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: mail@joeconway.com, akrowne@vt.edu
  Subject: Re: postgresql meltdown on PlanetMath.org
  In-Reply-To: <3E74600A.8050902@joeconway.com>
  References: <20030316060125.GD19570@vt.edu> <3E741B93.1090203@joeconway.com> <20030316075206.GE19570@vt.edu> <3E74600A.8050902@joeconway.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