Open karthik-ramanathan-3006 opened 1 year ago
Test on PG15:
[local]:5439 smishra@postgres=# select version();
version
---------------------------------------------------------------------------------------------------------
PostgreSQL 15.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
(1 row)
Time: 20.047 ms
[local]:5439 smishra@postgres=# EXPLAIN (ANALYZE) SELECT * FROM foo WHERE v < 1023;
QUERY PLAN
------------------------------------------------------------------------------------------------------------------
Index Scan using foo_v on foo (cost=0.28..46.16 rows=1022 width=8) (actual time=0.067..0.684 rows=1022 loops=1)
Index Cond: (v < 1023)
Planning Time: 0.207 ms
Execution Time: 0.797 ms
(4 rows)
Time: 1.699 ms
Jira Link: DB-8148
Description
Consider a table with a hash partial index on a integer column:
In a cluster with 3 t-servers, this results in
foo
having 6 tablets, andfoo_v
having 6 tablets.Let us consider SELECT queries with a predicate on
foo.v
such that the predicate:Exactly matches the Index predicate
Is a subset of the Index predicate
Is a superset of the Index predicate
In summary, there are two issues observed for hash partial indexes:
Warning: Please confirm that this issue does not contain any sensitive information