pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jonah H. Harris <jonah.harris@gmail.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 18:29:02 -0400
Message-ID: <36e682920709231529k76ce12a2q2f7ac90a05a1f2d2@mail.gmail.com> (raw)
In-Reply-To: <46F6E0E5.3080208@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>
	<20070923205759.GD5679@alvh.no-ip.org>
	<46F6E0E5.3080208@mochima.com>

On 9/23/07, Carlos Moreno <moreno_pg@mochima.com> wrote:
> Yes, that part I understand --- I think I now know what the error is in
> my logic.  I was thinking as follows:  We read 2GB of which 1900MB are
> dead tuples.  But then, once they're read, the system will only keep
> in memory the 100MB that are valid tuples.

Yes, this is wrong.

> I'm now thinking that the problem with my logic is that the system does
> not keep anything in memory (or not all tuples, in any case), since it
> is only counting, so it does not *have to* keep them, and since the
> total amount of reading from the disk exceeds the amount of physical
> memory, then the valid tuples are "pushed out" of memory.

Yes, it does keep some in memory, but not all of it.

> So, the second time I execute the query, it will still need to scan the
> disk  (in my mind, the way I was seeing it, the second time I execute
> the "select count(*) from customer", the entire customer table would be
> in memory from the previous time, and that's why I was thinking that
> the bloating would not explain why the second time it is still slow).

Yes, it is still performing additional I/Os and additional CPU work to
read bloated data.

> Am I understanding it right?

Now, I think so.

-- 
Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324
EnterpriseDB Corporation                | fax: 732.331.1301
499 Thornall Street, 2nd Floor          | jonah.harris@enterprisedb.com
Edison, NJ 08837                        | http://www.enterprisedb.com/



view thread (12+ messages)  latest in thread

Message-ID: <36e682920709231529k76ce12a2q2f7ac90a05a1f2d2@mail.gmail.com>
Permalink:  ../36e682920709231529k76ce12a2q2f7ac90a05a1f2d2@mail.gmail.com/
Also on:    postgresql.org/message-id/36e682920709231529k76ce12a2q2f7ac90a05a1f2d2@mail.gmail.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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: jonah.harris@gmail.com, moreno_pg@mochima.com
  Subject: Re: Possible explanations for catastrophic performance deterioration?
  In-Reply-To: <36e682920709231529k76ce12a2q2f7ac90a05a1f2d2@mail.gmail.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