Re: Add GiST support for mixed-width integer operators

From: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>
To: Paul Jungwirth <pj(at)illuminatedcomputing(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add GiST support for mixed-width integer operators
Date: 2024-07-06 12:04:27
Message-ID: 8A2355DE-A969-4CAB-B660-C7464EE3B899@yandex-team.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> 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?

Also, are we sure such tests will be stable?
+SET enable_seqscan=on;
+-- It should use the index with a different integer width:
+EXPLAIN (COSTS OFF)
+SELECT count(*) FROM int4tmp WHERE a = smallint '42';
+ QUERY PLAN
+------------------------------------------------
+ Aggregate
+ -> Bitmap Heap Scan on int4tmp
+ Recheck Cond: (a = '42'::smallint)
+ -> Bitmap Index Scan on int4idx
+ Index Cond: (a = '42'::smallint)

Best regards, Andrey Borodin.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2024-07-06 14:06:19 Re: walsender.c comment with no context is hard to understand
Previous Message Erik Wienhold 2024-07-06 11:52:22 Re: XML test error on Arch Linux