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 F2DEB3A4380 for ; Wed, 24 Nov 2004 08:32:22 +0000 (GMT) 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 68389-05 for ; Wed, 24 Nov 2004 08:32:12 +0000 (GMT) Received: from quasar.skima.is (quasar.skima.is [212.30.200.205]) by svr1.postgresql.org (Postfix) with ESMTP id 16A353A4344 for ; Wed, 24 Nov 2004 08:32:08 +0000 (GMT) Received: from wp2000 ([157.157.176.239] [157.157.176.239]) by quasar.skima.is; Wed, 24 Nov 2004 08:32:01 Z Message-Id: <001101c4d200$6fbe6c40$0100000a@wp2000> From: "gnari" To: "BBI Edwin Punzalan" , References: <001d01c4d1fc$ab997060$b400a8c0@bluebamboo.ph> Subject: Re: FW: Index usage Date: Wed, 24 Nov 2004 08:34:38 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/370 X-Sequence-Number: 9324 From: "BBI Edwin Punzalan" > db=# explain analyze select date from chatlogs where date>='11/23/04' and > date<'11/25/04'; > NOTICE: QUERY PLAN: > > Seq Scan on chatlogs (cost=0.00..24763.19 rows=9200 width=4) (actual > time=0.45..4268.00 rows=23787 loops=1) > Total runtime: 4282.81 msec > ============== > > How come a query on the current date filter uses an index and the others > does not? This makes indexing to speed up queries quite difficult. have you ANALYZED the table lately ? what version postgres are you using ? gnari