Re: Excluding common values from the index

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: mnikulyak(at)gmail(dot)com
Cc: pgsql-docs(at)postgresql(dot)org
Subject: Re: Excluding common values from the index
Date: 2017-03-16 20:12:14
Message-ID: 20170316201214.GB32733@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Sat, Mar 11, 2017 at 11:00:31PM +0000, mnikulyak(at)gmail(dot)com wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/9.6/static/indexes-partial.html
> Description:
>
> Rather than a report of an error, this letter is a suggestion of improvement
> of PostgreSQL.
>
> As per page https://www.postgresql.org/docs/9.6/static/indexes-partial.html,
> PostgreSQL avoids using indices when retrieving common values.
>
> Then, maybe, during the construction of an index, PostgreSQL should be
> detecting such common values, and exclude them from the index automatically.

That is an interesting idea, but what happens if the table changes and
those values become rare? How would we adjust for that? What if the
table is empty when the index is created? How would we detect common
values?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Peter Eisentraut 2017-03-19 03:50:40 Re: [HACKERS] Questionable tag usage
Previous Message Alexander Law 2017-03-16 14:44:01 Re: <indexterm> with <secondary>