Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 0C4E79F9A90 for ; Sun, 23 Sep 2007 19:29:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 68682-01 for ; Sun, 23 Sep 2007 19:28:58 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.189]) by postgresql.org (Postfix) with ESMTP id 8F44E9F9A7E for ; Sun, 23 Sep 2007 19:29:03 -0300 (ADT) Received: by rv-out-0910.google.com with SMTP id l15so1122262rvb for ; Sun, 23 Sep 2007 15:29:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=MVdpCOmkgrfs4G51kSjH+Ik7SOfYGDs+Bd1FQwZGurM=; b=Dui1+gfYD/JGUc3npP6R6MyRDUVSIL6wdmzEyBCrPbfvKgIBfDWulGfOi7oPcqRO7N4W2l5aEfOJvGX+W/waiAxAjam0CuuKnrd5XOnQZzXLCEM9iU9XFZT+Bji1FDSf3KOhW4Nw7VRHic2duuOM+u2v5WYN6rTCPrjNqzuRVPs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=JtWdHV/+Iv6kUZ42D5YHhoOI+931MLRcbuJvOAsp41e+W7EMvFxSxgM1dkBxhcAJaW1zy6OrGA6rjLrOdhUqjQLZj8oe/ZJ1nmTa5/f0jn/t8HiC1gRF9ClpJPAilnr4HL9ALnwZiIng2/ECtFSqdcUJ61X4my5w20H+gSo5BSs= Received: by 10.142.225.11 with SMTP id x11mr373547wfg.1190586542192; Sun, 23 Sep 2007 15:29:02 -0700 (PDT) Received: by 10.143.19.7 with HTTP; Sun, 23 Sep 2007 15:29:02 -0700 (PDT) Message-ID: <36e682920709231529k76ce12a2q2f7ac90a05a1f2d2@mail.gmail.com> Date: Sun, 23 Sep 2007 18:29:02 -0400 From: "Jonah H. Harris" To: "Carlos Moreno" Subject: Re: Possible explanations for catastrophic performance deterioration? Cc: pgsql-performance@postgresql.org In-Reply-To: <46F6E0E5.3080208@mochima.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/409 X-Sequence-Number: 26954 On 9/23/07, Carlos Moreno 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/