Skip to content

Commit

Permalink
added spgist indexing.
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitkharb committed Jun 25, 2014
1 parent 1e6687c commit d0d8751
Show file tree
Hide file tree
Showing 5 changed files with 2,777 additions and 0 deletions.
3 changes: 3 additions & 0 deletions postgis/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ PG_OBJS= \
gserialized_gist_2d.o \
gserialized_gist_nd.o \
gserialized_estimate.o \
sp_gist.o\
spginsert.o\
spgdoinsert.o\
geography_inout.o \
geography_btree.o \
geography_measurement.o \
Expand Down
42 changes: 42 additions & 0 deletions postgis/postgis.sql.in
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,49 @@ CREATE OPERATOR CLASS gist_geometry_ops_2d
FUNCTION 5 geometry_gist_penalty_2d (internal, internal, internal),
FUNCTION 6 geometry_gist_picksplit_2d (internal, internal),
FUNCTION 7 geometry_gist_same_2d (geom1 geometry, geom2 geometry, internal);
-- ---------- ---------- ---------- ---------- ---------- ---------- ----------
-- SP-GiST Support Functions
-- ---------- ---------- ---------- ---------- ---------- ---------- ----------

-- Availability: 2.0.0

This comment has been minimized.

Copy link
@strk

strk Jun 25, 2014

Availability of these new things is 2.2.0, not 2.0.0

CREATE OR REPLACE FUNCTION spg_quad_leaf_consistent(internal,geometry,int4)
RETURNS bool
AS '$libdir/postgis-2.0' ,'spg_quad_leaf_consistent'

This comment has been minimized.

Copy link
@strk

strk Jun 25, 2014

The library name should not be hard-coded in postgis.sql.in, rather the MODULE_PATHNAME will be replaced at build time, see how it is used in all other c-implemented objects

LANGUAGE 'c';

-- Availability: 2.0.0
CREATE OR REPLACE FUNCTION spg_quad_inner_consistent(internal,geometry,int4)

This comment has been minimized.

Copy link
@strk

strk Jun 25, 2014

Rather than using an "spg" prefix, being these postgis objects they should use as much as possible a prefix consistent with the ones used by other similar objects. For "gist" we have names like:
"geometry_gist_consistent_2d"

I suggest for "spgist" you use "geometry_spgist_consistent_2d" (if that's for 2d) or _nd for multi-dimensional support

RETURNS bool
AS '$libdir/postgis-2.0' ,'spg_quad_leaf_consistent'
LANGUAGE 'c';

CREATE OR REPLACE FUNCTION spg_quad_inner_consistent(internal,geometry,int4)
RETURNS internal
AS '$libdir/postgis-2.0' ,'spg_quad_leaf_consistent'
LANGUAGE 'c';


-- Availability: 2.0.0
CREATE OPERATOR CLASS spgist_geometry_ops_2d
DEFAULT FOR TYPE geometry USING SPGIST AS
STORAGE box2df,
OPERATOR 1 << ,
OPERATOR 2 &< ,
OPERATOR 3 && ,
OPERATOR 4 &> ,
OPERATOR 5 >> ,
OPERATOR 6 ~= ,
OPERATOR 7 ~ ,
OPERATOR 8 @ ,
OPERATOR 9 &<| ,
OPERATOR 10 <<| ,
OPERATOR 11 |>> ,
OPERATOR 12 |&> ,
OPERATOR 13 <-> FOR ORDER BY pg_catalog.float_ops,
OPERATOR 14 <#> FOR ORDER BY pg_catalog.float_ops,
FUNCTION 8 spg_quad_leaf_consistent (internal, geometry, int4),
FUNCTION 1 spg_quad_inner_consistent (internal, geometry, int4),
FUNCTION 6 spg_quad_picksplit (internal, internal),

-----------------------------------------------------------------------------
-- GiST ND GEOMETRY-over-GSERIALIZED
Expand Down
Loading

0 comments on commit d0d8751

Please sign in to comment.