From: Peter Geoghegan <peter.geoghegan86@gmail.com>
To: Josh Berkus <josh@agliodbs.com>
Cc: postgres performance list <pgsql-performance@postgresql.org>
Subject: Re: Why is n_distinct always -1 for range types?
Date: Wed, 25 Sep 2013 10:53:17 -0700
Message-ID: <CAEYLb_Vi4=BVZ1TvSzO2vZSSkCd3p83StO8dcSuRHHymaOpkTg@mail.gmail.com> (raw)
In-Reply-To: <523B62CF.5080502@agliodbs.com>
References: <523B62CF.5080502@agliodbs.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
On Thu, Sep 19, 2013 at 1:47 PM, Josh Berkus <josh@agliodbs.com> wrote:
> 4. n-distinct will still be listed as -1 (unique) for the column.
>
> Why?
Because of this:
https://github.com/postgres/postgres/blob/master/src/backend/utils/adt/rangetypes_typanalyze.c#L205
We only collect and use histograms of lower and upper bounds for range
types, and the fraction of empty ranges.
--
Regards,
Peter Geoghegan
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: peter.geoghegan86@gmail.com, josh@agliodbs.com
Subject: Re: Why is n_distinct always -1 for range types?
In-Reply-To: <CAEYLb_Vi4=BVZ1TvSzO2vZSSkCd3p83StO8dcSuRHHymaOpkTg@mail.gmail.com>
References: <523B62CF.5080502@agliodbs.com> <CAEYLb_Vi4=BVZ1TvSzO2vZSSkCd3p83StO8dcSuRHHymaOpkTg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox