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
e0d043b9
Commit
e0d043b9
authored
Mar 20, 2003
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
please apply attached patch to current CVS.
btree_gist now supports int2 ! Thanks Janko Richter for contribution.
parent
3be6367b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
7 deletions
+89
-7
contrib/btree_gist/Makefile
contrib/btree_gist/Makefile
+5
-2
contrib/btree_gist/README.btree_gist
contrib/btree_gist/README.btree_gist
+2
-2
contrib/btree_gist/btree_gist.sql.in
contrib/btree_gist/btree_gist.sql.in
+76
-3
contrib/btree_gist/btree_num.c.in
contrib/btree_gist/btree_num.c.in
+6
-0
No files found.
contrib/btree_gist/Makefile
View file @
e0d043b9
...
...
@@ -4,15 +4,18 @@ top_builddir = ../..
include
$(top_builddir)/src/Makefile.global
MODULE_big
=
btree_gist
OBJS
=
btree_common.o btree_int4.o btree_int8.o btree_float4.o btree_float8.o btree_ts.o
OBJS
=
btree_common.o btree_int
2.o btree_int
4.o btree_int8.o btree_float4.o btree_float8.o btree_ts.o
DATA_built
=
btree_gist.sql
DOCS
=
README.btree_gist
REGRESS
=
btree_gist
EXTRA_CLEAN
=
btree_int4.c btree_int8.c btree_float4.c btree_float8.c
EXTRA_CLEAN
=
btree_int
2.c btree_int
4.c btree_int8.c btree_float4.c btree_float8.c
include
$(top_srcdir)/contrib/contrib-global.mk
btree_int2.c
:
btree_num.c.in
sed
's,__DEFINE_BTREE_TYPE_HERE__,BTREE_GIST_INT2,g;s,__BTREE_GIST_TYPE__,int16,g;s,__BTREE_GIST_TYPE2__,int2,g'
<
$<
>
$@
btree_int4.c
:
btree_num.c.in
sed
's,__DEFINE_BTREE_TYPE_HERE__,BTREE_GIST_INT4,g;s,__BTREE_GIST_TYPE__,int32,g;s,__BTREE_GIST_TYPE2__,int4,g'
<
$<
>
$@
...
...
contrib/btree_gist/README.btree_gist
View file @
e0d043b9
This is B-Tree implementation using GiST for int4, int8, float4, float8
This is B-Tree implementation using GiST for int
2, int
4, int8, float4, float8
timestamp types.
All work was done by Teodor Sigaev (teodor@stack.net) and Oleg Bartunov
...
...
@@ -6,7 +6,7 @@ All work was done by Teodor Sigaev (teodor@stack.net) and Oleg Bartunov
for additional information.
NEWS:
Feb 5, 2003 - btree_gist now support int8, float4, float8 !
Feb 5, 2003 - btree_gist now support int
2, int
8, float4, float8 !
Thank Janko Richter <jankorichter@yahoo.de> for
contribution.
...
...
contrib/btree_gist/btree_gist.sql.in
View file @
e0d043b9
...
...
@@ -3,6 +3,23 @@ SET search_path = public;
SET autocommit TO 'on';
-- create type of int2 key
CREATE FUNCTION int2key_in(cstring)
RETURNS int2key
AS 'MODULE_PATHNAME'
LANGUAGE 'c' WITH (isstrict);
CREATE FUNCTION int2key_out(int2key)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'c' WITH (isstrict);
CREATE TYPE int2key (
INTERNALLENGTH = 4,
INPUT = int2key_in,
OUTPUT = int2key_out
);
-- create type of int4 key
CREATE FUNCTION int4key_in(cstring)
RETURNS int4key
...
...
@@ -75,17 +92,17 @@ OUTPUT = float8key_out
--
--
--
-- int
4
ops
-- int
2
ops
--
--
--
-- define the GiST support methods
CREATE FUNCTION gint
4_consistent(internal,int4
,int2)
CREATE FUNCTION gint
2_consistent(internal,int2
,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
CREATE FUNCTION gint
4
_compress(internal)
CREATE FUNCTION gint
2
_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
...
...
@@ -95,6 +112,62 @@ RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
CREATE FUNCTION gint2_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C' WITH (isstrict);
CREATE FUNCTION gint2_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
CREATE FUNCTION gint2_union(bytea, internal)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
CREATE FUNCTION gint2_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
-- Create the operator class
CREATE OPERATOR CLASS gist_int2_ops
DEFAULT FOR TYPE int2 USING gist
AS
OPERATOR 1 < ,
OPERATOR 2 <= ,
OPERATOR 3 = ,
OPERATOR 4 >= ,
OPERATOR 5 > ,
FUNCTION 1 gint2_consistent (internal, int2, int2),
FUNCTION 2 gint2_union (bytea, internal),
FUNCTION 3 gint2_compress (internal),
FUNCTION 4 btree_decompress (internal),
FUNCTION 5 gint2_penalty (internal, internal, internal),
FUNCTION 6 gint2_picksplit (internal, internal),
FUNCTION 7 gint2_same (internal, internal, internal),
STORAGE int2key;
--
--
--
-- int4 ops
--
--
--
-- define the GiST support methods
CREATE FUNCTION gint4_consistent(internal,int4,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
CREATE FUNCTION gint4_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE 'C';
CREATE FUNCTION gint4_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
...
...
contrib/btree_gist/btree_num.c.in
View file @
e0d043b9
...
...
@@ -51,6 +51,9 @@ g__BTREE_GIST_TYPE2___compress(PG_FUNCTION_ARGS)
if (entry->leafkey)
{
__BTREE_GIST_TYPE__KEY *r = ( __BTREE_GIST_TYPE__KEY * ) palloc(sizeof(__BTREE_GIST_TYPE__KEY));
#ifdef BTREE_GIST_INT2
int16 leaf = DatumGetInt16(entry->key);
#endif
#ifdef BTREE_GIST_INT4
int32 leaf = DatumGetInt32(entry->key);
#endif
...
...
@@ -80,6 +83,9 @@ Datum
g__BTREE_GIST_TYPE2___consistent(PG_FUNCTION_ARGS)
{
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
#ifdef BTREE_GIST_INT2
int16 query = PG_GETARG_INT16(1);
#endif
#ifdef BTREE_GIST_INT4
int32 query = PG_GETARG_INT32(1);
#endif
...
...
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