On Tue, Oct 21, 2014 at 11:50 AM, Tom Lane <tgl@xxxxxxxxxxxxx> wrote: > Marco Di Cesare <Marco.DiCesare@xxxxxxxxxxxxxxxxxx> writes: >> COUNT(DISTINCT "foxtrot_india"."bravo_romeo") > > Ah. That explains why the planner doesn't want to use a hash aggregation > step --- DISTINCT aggregates aren't supported with those. yup. With this query, the planner statistics are pretty good for the most part. Considering that the query is generated and amount of data is significant the runtime isn't too bad. The query could be rewritten to support a hash aggregate... merlin -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance