Re: Add GiST support for mixed-width integer operators

From: Paul Jungwirth <pj(at)illuminatedcomputing(dot)com>
To: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add GiST support for mixed-width integer operators
Date: 2024-07-08 16:32:55
Message-ID: 59dfd569-f22b-4bab-aee0-88dde7dc12eb@illuminatedcomputing.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 7/6/24 05:04, Andrey M. Borodin wrote:>> On 5 Jul 2024, at 23:46, Paul Jungwirth
<pj(at)illuminatedcomputing(dot)com> wrote:
>>
>> this commit adds support for all combinations of int2/int4/int8 for all five btree operators (</<=/=/>=/>).
>
> Looks like a nice feature to have.
> Would it make sense to do something similar to float8? Or, perhaps, some other types from btree_gist?

Here is another patch adding float4/8 and also date/timestamp/timestamptz, in the same combinations
as btree.

No other types seem like they deserve this treatment. For example btree doesn't mix oids with ints.

> Also, are we sure such tests will be stable?

You're right, it was questionable. We hadn't analyzed the table, and after doing that the plan
changes from a bitmap scan to an index-only scan. That makes more sense, and I doubt it will change
now that it's based on statistics.

Yours,

--
Paul ~{:-)
pj(at)illuminatedcomputing(dot)com

Attachment Content-Type Size
v2-0001-Use-GiST-index-with-mixed-integer-float-timestamp.patch text/x-patch 15.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Christofides 2024-07-08 16:54:33 Re: Detoasting optionally to make Explain-Analyze less misleading
Previous Message David G. Johnston 2024-07-08 16:17:09 Re: ❓ JSON Path Dot Precedence