Re: Allow GiST opcalsses without compress\decompres functions
Dmitriy Sarafannikov <dsarafannikov@yandex.ru>
From: Dmitriy Sarafannikov <dsarafannikov@yandex.ru>
To: pgsql-hackers@postgresql.org
Cc: Andrey Borodin <x4mmm@yandex-team.ru>
Date: 2017-09-14T11:20:14Z
Lists: pgsql-hackers
The following review has been posted through the commitfest application:
make installcheck-world: tested, passed
Implements feature: tested, passed
Spec compliant: tested, passed
Documentation: tested, passed
This is simple and intuitive patch. Code looks pretty clear and well documented.
I think it is good idea to decrease overhead on calling fake compressing/decomressing
functions. This eliminates the need to implement the fetch function in such cases.
I also tried to disable compress and decompress functions in contrib/cube:
diff --git a/contrib/cube/cube--1.2.sql b/contrib/cube/cube--1.2.sql
index dea2614888..26301b71d7 100644
--- a/contrib/cube/cube--1.2.sql
+++ b/contrib/cube/cube--1.2.sql
@@ -370,8 +370,6 @@ CREATE OPERATOR CLASS gist_cube_ops
FUNCTION 1 g_cube_consistent (internal, cube, smallint, oid, internal),
FUNCTION 2 g_cube_union (internal, internal),
- FUNCTION 3 g_cube_compress (internal),
- FUNCTION 4 g_cube_decompress (internal),
FUNCTION 5 g_cube_penalty (internal, internal, internal),
FUNCTION 6 g_cube_picksplit (internal, internal),
FUNCTION 7 g_cube_same (cube, cube, internal),
And it is enables IndexOnlyScan, this is expected behaviour.
+ -- test explain
+ set enable_seqscan to 'off';
+ set enable_bitmapscan to 'off';
+ select count(*) from test_cube where c && '(3000,1000),(0,0)';
+ count
+ -------
+ 5
+ (1 row)
+
+ explain analyze select c from test_cube where c && '(3000,1000),(0,0)';
+ QUERY PLAN
+ --------------------------------------------------------------------------------------------------------------------------------
+ Index Only Scan using test_cube_ix on test_cube (cost=0.15..56.43 rows=16 width=32) (actual time=0.015..0.018 rows=5 loops=1)
+ Index Cond: (c && '(3000, 1000),(0, 0)'::cube)
+ Heap Fetches: 5
+ Planning time: 0.038 ms
+ Execution time: 0.032 ms
+ (5 rows)
The new status of this patch is: Ready for Committer
Commits
-
Allow no-op GiST support functions to be omitted.
- d3a4f89d8a3e 11.0 landed
-
Remove no-op GiST support functions in the core GiST opclasses.
- 2d484f9b0580 11.0 landed