X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 36E20476258 for ; Fri, 31 Jan 2003 09:57:29 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 537F74760F5 for ; Fri, 31 Jan 2003 09:57:28 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h0VEu65u008578; Fri, 31 Jan 2003 09:56:06 -0500 (EST) To: Pavel Hlavnicka Cc: pgsql-sql@postgresql.org Subject: Re: calculated expressions and index use In-reply-to: <3E3A3757.3040906@gingerall.cz> References: <3E394AA6.8080400@gingerall.cz> <20100.1043945485@sss.pgh.pa.us> <3E3A3757.3040906@gingerall.cz> Comments: In-reply-to Pavel Hlavnicka message dated "Fri, 31 Jan 2003 09:44:07 +0100" Date: Fri, 31 Jan 2003 09:56:05 -0500 Message-ID: <8577.1044024965@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/524 X-Sequence-Number: 11389 Pavel Hlavnicka writes: > I use 7.2.1. :( 7.2 certainly will fold "'now'::timestamp - '1 hour'::interval" to a timestamp constant. This could be a datatype compatibility issue (is created_at the same type? in particular, with/without time zone?) or it could be a selectivity issue --- ie, the planner might think the condition covers too much of the table to make the index useful. It would be useful to look at the results of EXPLAIN ANALYZE for this query, with and without ENABLE_SEQSCAN turned off. regards, tom lane