Thread: [DOCS] Excluding common values from the index

[DOCS] Excluding common values from the index

From
mnikulyak@gmail.com
Date:
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.

Re: [DOCS] Excluding common values from the index

From
Bruce Momjian
Date:
On Sat, Mar 11, 2017 at 11:00:31PM +0000, mnikulyak@gmail.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@momjian.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 +