Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 03C609FB2B3 for ; Wed, 20 Jun 2007 16:30:00 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 30590-05 for ; Wed, 20 Jun 2007 16:29:54 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id C081C9FB66D for ; Wed, 20 Jun 2007 16:29:56 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l5KJTsqJ029485; Wed, 20 Jun 2007 15:29:55 -0400 (EDT) To: "Mikko Partio" cc: pgsql-performance@postgresql.org Subject: Re: Slow indexscan In-reply-to: <2ca799770706200943l6ae9f6bfif54683e21fa33f35@mail.gmail.com> References: <2ca799770706200702y1074f066s61279b67f93315d0@mail.gmail.com> <17907.1182352197@sss.pgh.pa.us> <2ca799770706200855w1a6b6a7cy8526b9be0ef9c97c@mail.gmail.com> <18952.1182355276@sss.pgh.pa.us> <2ca799770706200943l6ae9f6bfif54683e21fa33f35@mail.gmail.com> Comments: In-reply-to "Mikko Partio" message dated "Wed, 20 Jun 2007 19:43:33 +0300" Date: Wed, 20 Jun 2007 15:29:54 -0400 Message-ID: <29484.1182367794@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/446 X-Sequence-Number: 25479 "Mikko Partio" writes: > I guess the sort_mem helped, or then part of the rows are in the cache > already. Should increasing sort_mem help here since there are no sorts etc? No, it wouldn't --- this change has to be due to the data being already loaded into cache. There's no obvious reason for the previous query to be so slow, unless you've got horrendously slow or overloaded disk hardware. What sort of machine is this anyway, and was it doing any other work at the time? regards, tom lane