Re: [GENERAL] Select distinct sorting all rows 8.0rc1

2004-12-05 Thread Guy Rouillier
Pierre-Frédéric Caillaud wrote: > The planner is smarter with GROUP BY than with DISTINCT, so you can > rewrite your query as the following, whihc will probaly use a > HashAggregate, and be a lot faster : > > SELECT service_id FROM five_min_stats_200408 GROUP BY service_id; Pierre-Fré

Re: [GENERAL] Select distinct sorting all rows 8.0rc1

2004-12-05 Thread Pierre-Frédéric Caillaud
The planner is smarter with GROUP BY than with DISTINCT, so you can rewrite your query as the following, whihc will probaly use a HashAggregate, and be a lot faster : SELECT service_id FROM five_min_stats_200408 GROUP BY service_id; This won't avoid the Seq Scan however. If y