Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
0633a60f
Commit
0633a60f
authored
Mar 30, 2015
by
Heikki Linnakangas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add index-only scan support to range type GiST opclass.
Andreas Karlsson
parent
1c41e2a9
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
2 deletions
+38
-2
src/backend/utils/adt/rangetypes_gist.c
src/backend/utils/adt/rangetypes_gist.c
+9
-1
src/include/catalog/catversion.h
src/include/catalog/catversion.h
+1
-1
src/include/catalog/pg_amproc.h
src/include/catalog/pg_amproc.h
+1
-0
src/include/catalog/pg_proc.h
src/include/catalog/pg_proc.h
+2
-0
src/include/utils/rangetypes.h
src/include/utils/rangetypes.h
+1
-0
src/test/regress/expected/rangetypes.out
src/test/regress/expected/rangetypes.out
+19
-0
src/test/regress/sql/rangetypes.sql
src/test/regress/sql/rangetypes.sql
+5
-0
No files found.
src/backend/utils/adt/rangetypes_gist.c
View file @
0633a60f
...
...
@@ -216,7 +216,7 @@ range_gist_union(PG_FUNCTION_ARGS)
PG_RETURN_RANGE
(
result_range
);
}
/* compress, decompress are no-ops */
/* compress, decompress
, fetch
are no-ops */
Datum
range_gist_compress
(
PG_FUNCTION_ARGS
)
{
...
...
@@ -233,6 +233,14 @@ range_gist_decompress(PG_FUNCTION_ARGS)
PG_RETURN_POINTER
(
entry
);
}
Datum
range_gist_fetch
(
PG_FUNCTION_ARGS
)
{
GISTENTRY
*
entry
=
(
GISTENTRY
*
)
PG_GETARG_POINTER
(
0
);
PG_RETURN_POINTER
(
entry
);
}
/*
* GiST page split penalty function.
*
...
...
src/include/catalog/catversion.h
View file @
0633a60f
...
...
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
#define CATALOG_VERSION_NO 201503
28
1
#define CATALOG_VERSION_NO 201503
30
1
#endif
src/include/catalog/pg_amproc.h
View file @
0633a60f
...
...
@@ -235,6 +235,7 @@ DATA(insert ( 3919 3831 3831 4 3878 ));
DATA
(
insert
(
3919
3831
3831
5
3879
));
DATA
(
insert
(
3919
3831
3831
6
3880
));
DATA
(
insert
(
3919
3831
3831
7
3881
));
DATA
(
insert
(
3919
3831
3831
9
3996
));
/* gin */
...
...
src/include/catalog/pg_proc.h
View file @
0633a60f
...
...
@@ -4951,6 +4951,8 @@ DATA(insert OID = 3877 ( range_gist_compress PGNSP PGUID 12 1 0 0 0 f f f f t f
DESCR
(
"GiST support"
);
DATA
(
insert
OID
=
3878
(
range_gist_decompress
PGNSP
PGUID
12
1
0
0
0
f
f
f
f
t
f
i
1
0
2281
"2281"
_null_
_null_
_null_
_null_
range_gist_decompress
_null_
_null_
_null_
));
DESCR
(
"GiST support"
);
DATA
(
insert
OID
=
3996
(
range_gist_fetch
PGNSP
PGUID
12
1
0
0
0
f
f
f
f
t
f
i
1
0
2281
"2281"
_null_
_null_
_null_
_null_
range_gist_fetch
_null_
_null_
_null_
));
DESCR
(
"GiST support"
);
DATA
(
insert
OID
=
3879
(
range_gist_penalty
PGNSP
PGUID
12
1
0
0
0
f
f
f
f
t
f
i
3
0
2281
"2281 2281 2281"
_null_
_null_
_null_
_null_
range_gist_penalty
_null_
_null_
_null_
));
DESCR
(
"GiST support"
);
DATA
(
insert
OID
=
3880
(
range_gist_picksplit
PGNSP
PGUID
12
1
0
0
0
f
f
f
f
t
f
i
2
0
2281
"2281 2281"
_null_
_null_
_null_
_null_
range_gist_picksplit
_null_
_null_
_null_
));
...
...
src/include/utils/rangetypes.h
View file @
0633a60f
...
...
@@ -209,6 +209,7 @@ extern RangeType *make_empty_range(TypeCacheEntry *typcache);
extern
Datum
range_gist_consistent
(
PG_FUNCTION_ARGS
);
extern
Datum
range_gist_compress
(
PG_FUNCTION_ARGS
);
extern
Datum
range_gist_decompress
(
PG_FUNCTION_ARGS
);
extern
Datum
range_gist_fetch
(
PG_FUNCTION_ARGS
);
extern
Datum
range_gist_union
(
PG_FUNCTION_ARGS
);
extern
Datum
range_gist_penalty
(
PG_FUNCTION_ARGS
);
extern
Datum
range_gist_picksplit
(
PG_FUNCTION_ARGS
);
...
...
src/test/regress/expected/rangetypes.out
View file @
0633a60f
...
...
@@ -1072,6 +1072,25 @@ select count(*) from test_range_spgist where ir -|- int4range(100,500);
5
(1 row)
-- test index-only scans
explain (costs off)
select ir from test_range_spgist where ir -|- int4range(10,20) order by ir;
QUERY PLAN
------------------------------------------------------------------------
Sort
Sort Key: ir
-> Index Only Scan using test_range_spgist_idx on test_range_spgist
Index Cond: (ir -|- '[10,20)'::int4range)
(4 rows)
select ir from test_range_spgist where ir -|- int4range(10,20) order by ir;
ir
------------
[20,30)
[20,30)
[20,10020)
(3 rows)
RESET enable_seqscan;
RESET enable_indexscan;
RESET enable_bitmapscan;
...
...
src/test/regress/sql/rangetypes.sql
View file @
0633a60f
...
...
@@ -286,6 +286,11 @@ select count(*) from test_range_spgist where ir &< int4range(100,500);
select
count
(
*
)
from
test_range_spgist
where
ir
&>
int4range
(
100
,
500
);
select
count
(
*
)
from
test_range_spgist
where
ir
-|-
int4range
(
100
,
500
);
-- test index-only scans
explain
(
costs
off
)
select
ir
from
test_range_spgist
where
ir
-|-
int4range
(
10
,
20
)
order
by
ir
;
select
ir
from
test_range_spgist
where
ir
-|-
int4range
(
10
,
20
)
order
by
ir
;
RESET
enable_seqscan
;
RESET
enable_indexscan
;
RESET
enable_bitmapscan
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment