Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 73EBB475E24 for ; Sat, 16 Nov 2002 13:42:16 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 16C3E475D12 for ; Sat, 16 Nov 2002 13:42:15 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.5/8.12.5) with ESMTP id gAGIg8hR019220; Sat, 16 Nov 2002 13:42:08 -0500 (EST) To: PostgreSQL Server Cc: pgsql-sql@postgresql.org Subject: Re: DATE TIME INDEX ? In-reply-to: References: Comments: In-reply-to PostgreSQL Server message dated "Sat, 16 Nov 2002 18:01:02 +0100" Date: Sat, 16 Nov 2002 13:42:08 -0500 Message-ID: <19219.1037472128@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/240 X-Sequence-Number: 10382 PostgreSQL Server writes: > I found that the only way to force postgres to use index is: > explain select id,datarx::date from docs where datarx between '2002-11-13' and '2002-11-14' ; > Index Scan using idx_documenti_datarx on documenti (cost=0.00..7.86 rows=2 width=12) Given the small cost estimates, you either are testing on a toy table, or you have not run ANALYZE since loading up the table. regards, tom lane