pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: PFC <lists@boutiquenumerique.com>
Cc: Ken Egervari <ken@upfactor.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Performance problem with semi-large tables
Date: Sun, 30 Jan 2005 12:50:02 -0500
Message-ID: <3657.1107107402@sss.pgh.pa.us> (raw)
In-Reply-To: <opslexchx2th1vuj@musicbox>
References: <001601c50416$57090e10$cd422418@a96dfxb4kjzogw>
	<opsldw48czth1vuj@musicbox>
	<002201c50654$1a8c50b0$cd422418@a96dfxb4kjzogw>
	<opsld0ul0nth1vuj@musicbox>
	<000a01c5066a$0d1f43e0$cd422418@a96dfxb4kjzogw>
	<opslexchx2th1vuj@musicbox>

PFC <lists@boutiquenumerique.com> writes:
>> For example, let's add another filter to get all the shipments with  
>> release code '5' that are 7 days old or newer.
>> 
>> ss.date >= current_date - 7

> 	It's the order by + limit which makes the query behaves badly, and which  
> forces use of kludges to use the index. If you add another condition like  
> that, it should be a breeze.

Actually, that date condition has its own problem, namely that the
compared-to value isn't a constant.  The 8.0 planner is able to realize
that this is a pretty selective condition, but prior releases fall back
on a very pessimistic default estimate.  I'm sure that has something to
do with Ken not being able to get it to use an index on date.

			regards, tom lane



view thread (10+ messages)

Message-ID: <3657.1107107402@sss.pgh.pa.us>
Permalink:  ../3657.1107107402@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3657.1107107402@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, lists@boutiquenumerique.com, ken@upfactor.com
  Subject: Re: Performance problem with semi-large tables
  In-Reply-To: <3657.1107107402@sss.pgh.pa.us>

* 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