Re: calculated expressions and index use

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

Yes, you are right. It was an issue reated to the type compatibility. My
braindead script created tables with 'datetime' types, what is
'timestamp without time zone' after I switched to 'timestamp', all works
fine.

Thanks a loc, the fact, you ensured me, that the constant expression
should be recognized, pushed me much further.

Thanks again

Have a nice day

Pavel

Tom Lane wrote:
> Pavel Hlavnicka <pavel(at)gingerall(dot)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

--
Pavel Hlavnicka
Ginger Alliance
www.gingerall.com

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Wei Weng 2003-01-31 16:43:14 Which version is this?
Previous Message joe.guyot 2003-01-31 15:40:41 how do i create a date from a substring???