[PERFORM] overzealous sorting?

2011-09-25 Thread anthony . shipman
In Mammoth Replicator (PG 8.3) I have a table described as Table "public.tevent_cdr" Column | Type | Modifiers +--+--

Re: [PERFORM] Query optimization using order by and limit

2011-09-25 Thread Tom Lane
Stephen Frost writes: > * Tom Lane (t...@sss.pgh.pa.us) wrote: >> Yeah, it's spending quite a lot of time finding the first matching row >> in each child table. I'm curious why that is though; are the child >> tables not set up with nonoverlapping firstloadtime ranges? > The issue here is that t

Re: [PERFORM] Query optimization using order by and limit

2011-09-25 Thread Stephen Frost
* Tom Lane (t...@sss.pgh.pa.us) wrote: > Yeah, it's spending quite a lot of time finding the first matching row > in each child table. I'm curious why that is though; are the child > tables not set up with nonoverlapping firstloadtime ranges? They are set up w/ nonoverlapping firstloadtime ranges

Re: [PERFORM] Query optimization using order by and limit

2011-09-25 Thread Tom Lane
Stephen Frost writes: > What I think is happening here is that PG is pushing down that filter > (not typically a bad thing..), but with that condition, it's going to > scan the index until it finds a match for that filter before returning > back up only to have that result cut out due to the limit