John Arbash Meinel wrote : 
> 
> You might also try a different query, something like:
> 
> SELECT DISTINCT cod FROM mytable ORDER BY cod GROUP BY cod; 
> (You may or may not want order by, or group by, try the different
> combinations.)
> It might be possible to have the planner realize that all you 
> want is unique rows, just doing a group by doesn't give you that.
> 
> John
> =:->
> 
Thanks John, but using SELECT DISTINCT with or without Order nor Group by is
worth...
30 sec (with index) - stopped at 200 sec without index...

So Hash Aggregate is much better than index scan ...


> >
> >Thanks for help.
> > 
> >Stéphane COEZ
> >
> >
> >
> >
> >---------------------------(end of 
> >broadcast)---------------------------
> >TIP 9: In versions below 8.0, the planner will ignore your desire to
> >       choose an index scan if your joining column's datatypes do not
> >       match
> >
> >  
> >
> 
> 
> 




---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to