Re: Bad row estimates - Mailing list pgsql-performance

From Greg Stark
Subject Re: Bad row estimates
Date
Msg-id 87r75isk1l.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Bad row estimates  (Greg Stark <gsstark@mit.edu>)
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Greg Stark
Date:
Subject: Re: Bad row estimates
Next
From: Joost Kraaijeveld
Date:
Subject: How to query and index for customer with lastname and city