X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 844D3528DB for ; Tue, 9 Aug 2005 01:33:19 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 35436-03 for ; Tue, 9 Aug 2005 04:33:18 +0000 (GMT) Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by svr1.postgresql.org (Postfix) with ESMTP id A9624528C1 for ; Tue, 9 Aug 2005 01:33:17 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 058DC30959; Tue, 9 Aug 2005 06:42:52 +0200 (MET DST) From: "Qingqing Zhou" X-Newsgroups: pgsql.performance Subject: Re: QRY seems not using indexes Date: Tue, 9 Aug 2005 12:30:41 +0800 Organization: Hub.Org Networking Services Lines: 25 Message-ID: References: <1123071402.641229.314250@g43g2000cwa.googlegroups.com> Reply-To: "Qingqing Zhou" X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.184 tagged_above=0 required=5 tests=AWL, PRIORITY_NO_NAME X-Spam-Level: * X-Archive-Number: 200508/73 X-Sequence-Number: 13820 writes > > > so, if I do a qry like "EXPLAIN ANALYZE select * from pridecdr where > idsede=8977758488" it tooks a lot of time before i get back any result: > > Index Scan using prd_id_sede on pridecdr (cost=0.00..699079.90 > rows=181850 width=138) (actual time=51.241..483068.255 rows=150511 > loops=1) > Index Cond: (idsede = 8977758488::bigint) > Total runtime: 483355.325 ms > The query plan looks ok. Try to do EXPLAIN ANALYZE twice and see if there is any difference. This could reduce the IO time to read your index/data since you got enough RAM. Also, if you haven't done VACUUM FULL for a long time, do so and compare the difference. Regards, Qingqing