pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@commandprompt.com>
To: Carlos Moreno <moreno_pg@mochima.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Possible explanations for catastrophic performance deterioration?
Date: Sun, 23 Sep 2007 16:57:59 -0400
Message-ID: <20070923205759.GD5679@alvh.no-ip.org> (raw)
In-Reply-To: <46F6CD9A.2090600@mochima.com>
References: <46F6981B.1010600@mochima.com>
	<36e682920709230956p1312745eif1c6ba7a342dae3d@mail.gmail.com>
	<46F6AD2D.4090300@mochima.com>
	<20070923182349.GC5679@alvh.no-ip.org>
	<46F6BA82.3080101@mochima.com>
	<36e682920709231224y3fb13ce3t9dd4217215c62bf7@mail.gmail.com>
	<46F6CD9A.2090600@mochima.com>

Carlos Moreno wrote:

> That is:  the first time I run the query, it has to go through the
> disk; in the normal case it would have to read 100MB of data, but due
> to bloating, it actually has to go through 2GB of data.   Ok, but
> then, it will load only 100MB  (the ones that are not "uncollected
> disk garbage") to memory.  The next time that I run the query, the
> server would only need to read 100MB from memory --- the result should
> be instantaneous...

Wrong.  If there is 2GB of data, 1900MB of which is dead tuples, those
pages would still have to be scanned for the count(*).  The system does
not distinguish "pages which have no live tuples" from other pages, so
it has to load them all.

-- 
Alvaro Herrera                 http://www.amazon.com/gp/registry/CTMLCN8V17R4
"[PostgreSQL] is a great group; in my opinion it is THE best open source
development communities in existence anywhere."                (Lamar Owen)



view thread (12+ messages)  latest in thread

Message-ID: <20070923205759.GD5679@alvh.no-ip.org>
Permalink:  ../20070923205759.GD5679@alvh.no-ip.org/
Also on:    postgresql.org/message-id/20070923205759.GD5679@alvh.no-ip.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: alvherre@commandprompt.com, moreno_pg@mochima.com
  Subject: Re: Possible explanations for catastrophic performance deterioration?
  In-Reply-To: <20070923205759.GD5679@alvh.no-ip.org>

* 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