X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 24F4A11F62C7 for ; Tue, 11 Apr 2006 10:50:50 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0.128 X-Spam-Level: X-Spam-Status: No, score=0.128 required=5 tests=[AWL=0.128] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id R7x0ZFC5c6Pi for ; Tue, 11 Apr 2006 10:50:41 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id E66CC11F6297 for ; Tue, 11 Apr 2006 10:50:44 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k3BDjaxN007302; Tue, 11 Apr 2006 09:45:37 -0400 (EDT) To: Richard Huxton cc: soni de , "Joshua D. Drake" , Rajesh Kumar Mallah , pgsql-performance@postgresql.org Subject: Re: Takes too long to fetch the data from database In-reply-to: <443B821D.2000005@archonet.com> References: <9f2e40a90604100021n1cb694d0lb95f318f800f33ee@mail.gmail.com> <443AA1D4.9010308@commandprompt.com> <9f2e40a90604110005o101fe98enec2f8ac8f757c770@mail.gmail.com> <443B821D.2000005@archonet.com> Comments: In-reply-to Richard Huxton message dated "Tue, 11 Apr 2006 11:17:01 +0100" Date: Tue, 11 Apr 2006 09:45:36 -0400 Message-ID: <7301.1144763136@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200604/235 X-Sequence-Number: 18319 Richard Huxton writes: > soni de wrote: >> NOTICE: QUERY PLAN: >> Sort (cost=17.13..17.13 rows=1 width=16) (actual time=619140.18..619140.29rows >> =288 loops=1) >> -> Index Scan using lan_pkey on lan (cost=0.00..17.12 rows=1 width=16) >> (actual time=7564.44..619121.61 rows=288 loops=1) >> >> Total runtime: 619140.76 msec > OK - there is clearly something wrong here when you take 10 minutes to > fetch 288 rows from an index. > I'm guessing you have a *lot* of dead rows in there. Yeah. The other small problem here is that EXPLAIN output hasn't looked like that since PG 7.2 (unless Soni has just omitted the index-condition lines). I'd recommend updating to something modern. regards, tom lane