pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Greg Stark <gsstark@MIT.EDU>
Cc: Alex Adriaanse <alex@innovacomputing.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Bad row estimates
Date: 04 Mar 2006 03:15:02 -0500
Message-ID: <87r75isk1l.fsf@stark.xeocode.com> (raw)
In-Reply-To: <87wtfasng0.fsf@stark.xeocode.com>
References: <4408E91C.90104@innovacomputing.com>
	<87wtfasng0.fsf@stark.xeocode.com>


Greg Stark <gsstark@MIT.EDU> writes:

> The "now() BETWEEN test_table_1.start_ts AND test_table_1.end_ts can't be
> answered completely using a btree index. You could try using a GIST index here
> but I'm not clear how much it would help you (or how much work it would be).

To add to my own comment you could also try creating two separate indexes on
start_ts and end_ts. Postgres can combine the two indexes using a bitmap scan.
It's not a complete solution like a GIST index would be though.

It also doesn't help at all with the planner estimating how many records will
actually match.

-- 
greg




view thread (8+ messages)  latest in thread

Message-ID: <87r75isk1l.fsf@stark.xeocode.com>
Permalink:  ../87r75isk1l.fsf@stark.xeocode.com/
Also on:    postgresql.org/message-id/87r75isk1l.fsf@stark.xeocode.com

 · 

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: gsstark@mit.edu, alex@innovacomputing.com
  Subject: Re: Bad row estimates
  In-Reply-To: <87r75isk1l.fsf@stark.xeocode.com>

* 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