pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hannu Krosing <hannu@tm.ee>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: Dustin Sallings <dustin@spy.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: inconsistent/weird index usage
Date: Sun, 03 Oct 2004 02:20:41 +0300
Message-ID: <1096759241.5508.2.camel@fuji.krosing.net> (raw)
In-Reply-To: <10775.1096648455@sss.pgh.pa.us>
References: <6FA9AB99-1373-11D9-A87D-000A957659CC@spy.net>
	<9345.1096641526@sss.pgh.pa.us>
	<200410010929.36026.josh@agliodbs.com>
	<10775.1096648455@sss.pgh.pa.us>

On R, 2004-10-01 at 19:34, Tom Lane wrote:
> Josh Berkus <josh@agliodbs.com> writes:
> >> Most of the problem here comes from the fact that "current_date - 7"
> >> isn't reducible to a constant and so the planner is making bad guesses
> >> about how much of each table will be scanned.  
> 
> > I thought this was fixed in 7.4.  No?
> 
> No.  It's not fixed as of CVS tip either, although there was some talk
> of doing something in time for 8.0.

That's weird - my 7.4.2 databases did not consider (now()-'15
min'::interval) to be a constant whereas 7.4.5 does (i.e. it does use
index scan on index on datetime column)

Is this somehow different for date types ?

--------------
Hannu



view thread (8+ messages)  latest in thread

Message-ID: <1096759241.5508.2.camel@fuji.krosing.net>
Permalink:  ../1096759241.5508.2.camel@fuji.krosing.net/
Also on:    postgresql.org/message-id/1096759241.5508.2.camel@fuji.krosing.net

 · 

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-performance@postgresql.org
  Cc: hannu@tm.ee, tgl@sss.pgh.pa.us, josh@agliodbs.com, dustin@spy.net
  Subject: Re: inconsistent/weird index usage
  In-Reply-To: <1096759241.5508.2.camel@fuji.krosing.net>

* 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