Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Hackers > DISTINCT -> GRO...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 9477 of 10966
Post > Topic >>

DISTINCT -> GROUP BY

by david@[EMAIL PROTECTED] (David Fetter) Jun 3, 2008 at 06:03 AM

Folks,

I've noticed that queries of the form

SELECT DISTNCT foo, bar, baz
FROM quux
WHERE ...

perform significantly worse than the equivalent using GROUP BY.

SELECT foo, bar, baz
FROM quux
WHERE ...
GROUP BY foo, bar, baz

Where would I start looking in order to make them actually equivalent
from the planner's point of view?  Also, would back-patching this make
sense?  It doesn't change any APIs, but it does make some queries go
faster.

Cheers,
David.
-- 
David Fetter <david@[EMAIL PROTECTED]
> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@[EMAIL PROTECTED]
 to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
 




 4 Posts in Topic:
DISTINCT -> GROUP BY
david@[EMAIL PROTECTED]   2008-06-03 06:03:42 
Re: DISTINCT -> GROUP BY
pavel.stehule@[EMAIL PROT  2008-06-03 15:36:44 
Re: DISTINCT -> GROUP BY
david@[EMAIL PROTECTED]   2008-06-03 07:03:06 
Re: DISTINCT -> GROUP BY
pavel.stehule@[EMAIL PROT  2008-06-03 16:10:35 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 12:00:54 CST 2008.