-
Notifications
You must be signed in to change notification settings - Fork 15
Configurable smoc_gin_ops index resolution #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
vitcpp
merged 1 commit into
postgrespro:master
from
cybertec-postgresql:smoc_gin_options
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
create table moc_opt (m smoc); | ||
insert into moc_opt select format('9/%s', i)::smoc from generate_series(1, 1000) g(i); | ||
analyze moc_opt; | ||
create index moc_opt5 on moc_opt using gin (m); | ||
explain (analyze, costs off, timing off, summary off) select * from moc_opt where m && '9/1'; | ||
QUERY PLAN | ||
--------------------------------------------------------------- | ||
Bitmap Heap Scan on moc_opt (actual rows=1 loops=1) | ||
Recheck Cond: (m && '9/1'::smoc) | ||
Rows Removed by Index Recheck: 254 | ||
Heap Blocks: exact=4 | ||
-> Bitmap Index Scan on moc_opt5 (actual rows=255 loops=1) | ||
Index Cond: (m && '9/1'::smoc) | ||
(6 rows) | ||
|
||
drop index moc_opt5; | ||
create index moc_opt8 on moc_opt using gin (m smoc_gin_ops_fine); | ||
explain (analyze, costs off, timing off, summary off) select * from moc_opt where m && '9/1'; | ||
QUERY PLAN | ||
------------------------------------------------------------- | ||
Bitmap Heap Scan on moc_opt (actual rows=1 loops=1) | ||
Recheck Cond: (m && '9/1'::smoc) | ||
Rows Removed by Index Recheck: 2 | ||
Heap Blocks: exact=1 | ||
-> Bitmap Index Scan on moc_opt8 (actual rows=3 loops=1) | ||
Index Cond: (m && '9/1'::smoc) | ||
(6 rows) | ||
|
||
drop index moc_opt8; | ||
create index moc_opt9 on moc_opt using gin (m smoc_gin_ops (order = 9)); | ||
explain (analyze, costs off, timing off, summary off) select * from moc_opt where m && '9/1'; | ||
QUERY PLAN | ||
------------------------------------------------------------- | ||
Bitmap Heap Scan on moc_opt (actual rows=1 loops=1) | ||
Recheck Cond: (m && '9/1'::smoc) | ||
Heap Blocks: exact=1 | ||
-> Bitmap Index Scan on moc_opt9 (actual rows=1 loops=1) | ||
Index Cond: (m && '9/1'::smoc) | ||
(5 rows) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- GIN opclass options | ||
|
||
CREATE FUNCTION smoc_gin_options (internal) | ||
RETURNS void | ||
AS 'MODULE_PATHNAME' | ||
LANGUAGE C | ||
PARALLEL SAFE | ||
IMMUTABLE | ||
STRICT; | ||
|
||
ALTER OPERATOR FAMILY smoc_gin_ops USING gin | ||
ADD FUNCTION 7 (smoc) smoc_gin_options (internal); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
create table moc_opt (m smoc); | ||
insert into moc_opt select format('9/%s', i)::smoc from generate_series(1, 1000) g(i); | ||
analyze moc_opt; | ||
|
||
create index moc_opt5 on moc_opt using gin (m); | ||
explain (analyze, costs off, timing off, summary off) select * from moc_opt where m && '9/1'; | ||
drop index moc_opt5; | ||
|
||
create index moc_opt8 on moc_opt using gin (m smoc_gin_ops_fine); | ||
explain (analyze, costs off, timing off, summary off) select * from moc_opt where m && '9/1'; | ||
drop index moc_opt8; | ||
|
||
create index moc_opt9 on moc_opt using gin (m smoc_gin_ops (order = 9)); | ||
explain (analyze, costs off, timing off, summary off) select * from moc_opt where m && '9/1'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.