Search Postgresql Archives

Re: Unique index prohibits partial aggregates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 29 Jun 2022 at 00:45, Bos, Fred <fbos@xxxxxxxxxxxxxx> wrote:
> Finally, is there a way to force postgres to do the partial hash aggregate,
> either by changing a setting or by influencing the expected amount of output
> groups for each query?

You could do something like:

ALTER TABLE bhload_nohyp_noin ALTER COLUMN t SET (n_distinct = 200);
ANALYZE bhload_nohyp_noin;

Please be aware that this may have detrimental effects if you do any
joins or group bys directly on this column.  Otherwise, providing you
don't have a unique index on that column, then it should trick the
planner into thinking there will be fewer groups than it currently
thinks there will be, which will likely result in the parallel plan
that you desire.

David





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux