Re: Better default_statistics_target - Mailing list pgsql-patches

From Gregory Stark
Subject Re: Better default_statistics_target
Date
Msg-id 878x484rq9.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: Better default_statistics_target  (Chris Browne <cbbrowne@acm.org>)
List pgsql-patches
"Chris Browne" <cbbrowne@acm.org> writes:

>  - Any columns marked "unique" could keep to having somewhat smaller
>    numbers of bins in the histogram because we know that uniqueness
>    will keep values dispersed at least somewhat.

I think you're on the wrong track. It's not dispersal that's significant but
how evenly the values are dispersed. If the values are evenly spread
throughout the region from low to high bound then we just need the single
bucket telling us the low and high bound and how many values there are. If
they're unevenly distributed then we need enough buckets to be able to
distinguish the dense areas from the sparse areas.

Perhaps something like starting with 1 bucket, splitting it into 2, seeing if
the distributions are similar in which case we stop. If not repeat for each
bucket.

--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's 24x7 Postgres support!

pgsql-patches by date:

Previous
From: Chris Browne
Date:
Subject: Re: Better default_statistics_target
Next
From: Yoshiyuki Asaba
Date:
Subject: Wrong result with pgbench -C option?