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

I use 7.2.1. :(

Do you thing my considerations on constant vs. expression are correct? I 
tried different syntax, no success.

Thanks

Pavel

Tom Lane wrote:
> Pavel Hlavnicka <pavel@gingerall.cz> writes:
> 
>>select * from foo
>>where created_at >= 'now'::timestamp - '1 hour'::interval;
> 
> 
>>My table is indexed on created_at field. The query above doesn't use it, 
> 
> 
> What's your PG version?  In 7.2 and later that expression will be folded
> to a constant.
> 
> 			regards, tom lane

-- 
Pavel Hlavnicka
Ginger Alliance
www.gingerall.com




view thread (6+ messages)  latest in thread

Message-ID: <3E3A3757.3040906@gingerall.cz>
Permalink:  ../3E3A3757.3040906@gingerall.cz/
Also on:    postgresql.org/message-id/3E3A3757.3040906@gingerall.cz

 · 

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: pavel@gingerall.cz, tgl@sss.pgh.pa.us
  Subject: Re: calculated expressions and index use
  In-Reply-To: <3E3A3757.3040906@gingerall.cz>

* 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