Why can NUMERIC columns not use deduplication?

From: PG Doc comments form <noreply(at)postgresql(dot)org>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Cc: chris+postgresql(at)qwirx(dot)com
Subject: Why can NUMERIC columns not use deduplication?
Date: 2022-01-14 13:57:59
Message-ID: 164216867903.23277.10737033258186320533@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/14/btree-implementation.html
Description:

"64.4.3. Deduplication" says:

"numeric cannot use deduplication. Numeric display scale must be preserved
among equal datums."

However I don't understand this. An equal datum is an equal datum regardless
of display scale, isn't it?

Even in the special case of a NUMERIC column with no precision or scale
(8.1.2), for example if a table has an index on a NUMERIC column, and some
rows have the value 8 in that column, and some have the value 8.0 (I think
these are different values/datums in this special case), I would not expect
all those index entries to be deduplicated into a single list, but I would
expect them to be deduplicated into two lists (one for the value 8, and one
for the value 8.0). Then again I am not familiar with the actual
implementation.

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2022-01-14 15:14:41 Re: Why can NUMERIC columns not use deduplication?
Previous Message Shinya Kato 2022-01-13 07:07:38 Re: Question about role attributes docs