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

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@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

-- 
Pavel Hlavnicka
Ginger Alliance
www.gingerall.com




view thread (6+ messages)

Message-ID: <3E3A9E49.1090503@gingerall.cz>
Permalink:  ../3E3A9E49.1090503@gingerall.cz/
Also on:    postgresql.org/message-id/3E3A9E49.1090503@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: <3E3A9E49.1090503@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