pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Hlavnicka <pavel@gingerall.cz>
Cc: pgsql-sql@postgresql.org
Subject: Re: calculated expressions and index use
Date: Fri, 31 Jan 2003 09:56:05 -0500
Message-ID: <8577.1044024965@sss.pgh.pa.us> (raw)
In-Reply-To: <3E3A3757.3040906@gingerall.cz>
References: <3E394AA6.8080400@gingerall.cz>
	<20100.1043945485@sss.pgh.pa.us>
	<3E3A3757.3040906@gingerall.cz>

Pavel Hlavnicka <pavel@gingerall.cz> 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



view thread (6+ messages)  latest in thread

Message-ID: <8577.1044024965@sss.pgh.pa.us>
Permalink:  ../8577.1044024965@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8577.1044024965@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pavel@gingerall.cz
  Subject: Re: calculated expressions and index use
  In-Reply-To: <8577.1044024965@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox