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

From Tom Lane
Subject Re: Limit changes query plan
Date
Msg-id 24911.1201882788@sss.pgh.pa.us
Whole thread Raw
In response to Re: Limit changes query plan  ("Greg Stark" <greg.stark@enterprisedb.com>)
Responses Re: Limit changes query plan  (Gaetano Mendola <mendola@bigfoot.com>)
List pgsql-hackers
"Greg Stark" <greg.stark@enterprisedb.com> writes:
>> ->  Index Scan using i_oa_2_00_dt_for on t_oa_2_00_dt dt  (cost=0.00..5.31 rows=1 width=8) (actual time=1.264..1.264
rows=0loops=50)
 
>> Index Cond: (dt.card_id = c.id)
>> Filter: ((_to >= 1500) AND (_from <= 1550))
>> Total runtime: 3399960.277 ms

> 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 match
exactlyas long as they include all the records the query needs.
 

That side of the join isn't where the problem is, though.

If you're willing to invent new indexes, one on ecp,nctr,nctn,ncts,rvel
would probably fix the performance issue very nicely.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: and waiting
Next
From: Gaetano Mendola
Date:
Subject: Re: Limit changes query plan