Re: [PERFORM] Fwd: Slow Count-Distinct Query

2014-04-04 Thread Varadharajan Mukundan
Hi Jeff, It looks like the original emailer wrote a query that the planner is not > smart enough to plan properly (A known limitation of that kind of query). > He then made a bunch of changes, none of which worked. He then re-wrote > the query into a form for which the planner does a better job

Re: [PERFORM] Fwd: Slow Count-Distinct Query

2014-04-04 Thread Jeff Janes
On Fri, Apr 4, 2014 at 2:31 AM, Varadharajan Mukundan wrote: > Sorry that i just joined the list and have to break the thread to reply to > Tom Lane's response on this @ > http://www.postgresql.org/message-id/13741.1396275...@sss.pgh.pa.us > > > Note that the indexscan is actually *slower* than th

[PERFORM] Fwd: Slow Count-Distinct Query

2014-04-04 Thread Varadharajan Mukundan
Sorry that i just joined the list and have to break the thread to reply to Tom Lane's response on this @ http://www.postgresql.org/message-id/13741.1396275...@sss.pgh.pa.us Note that the indexscan is actually *slower* than the seqscan so far as > the table access is concerned; if the table were b