Re: Limit changes query plan - Mailing list pgsql-hackers

From Greg Stark
Subject Re: Limit changes query plan
Date
Msg-id 51494DB187D98F4C88DBEBF1F5F6D42303A1E503@edb06.mail01.enterprisedb.com
Whole thread Raw
In response to Limit changes query plan  (Gaetano Mendola <mendola@bigfoot.com>)
Responses Re: Limit changes query plan  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
<br /><p><font size="2">>         ->  Index Scan using i_oa_2_00_dt_for on t_oa_2_00_dt dt  (cost=0.00..5.31
rows=1width=8) (actual time=1.264..1.264 rows=0 loops=50)<br /> >               Index Cond: (dt.card_id = c.id)<br
/>>               Filter: ((_to >= 1500) AND (_from <= 1550))<br /> > Total runtime: 3399960.277 ms<br
/><br/> Also, are 1500 and 1550 user-supplied parameters or are they part of a small set of possible values? You could
considerhaving a partial index on "card_id WHERE _to >= 1500 AND _from <= 1550". The numbers don't even have to
matchexactly as long as they include all the records the query needs.<br /><br /> Another possibility is using
somethinglike "cube" from contrib to build a GIST index on <_to,_from>. I think you would need to load gist_btree
aswell for the first column on card_id. It doesn't help every use case though, you would have to experiment.<br /><br
/>But before experimenting with either of those things, what does "VACUUM VERBOSE t_oa_2_00_dt" say?</font> 

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: FW: bitemporal functionality for PostgreSQL
Next
From: "A.M."
Date:
Subject: Re: FW: bitemporal functionality for PostgreSQL