Re: calculated expressions and index use

From: Pavel Hlavnicka <pavel(at)gingerall(dot)cz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: calculated expressions and index use
Date: 2003-01-31 08:44:07
Message-ID: 3E3A3757.3040906@gingerall.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)gingerall(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message David Durst 2003-01-31 09:34:42 Postgres MD5 Function
Previous Message joe.guyot 2003-01-31 07:03:43 how can i convert a substring to a date?