postgres select distinct vs group by performance