Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 317dd55

Browse files
committed
Add SP-GiST support for range types.
The implementation is a quad-tree, largely copied from the quad-tree implementation for points. The lower and upper bound of ranges are the 2d coordinates, with some extra code to handle empty ranges. I left out the support for adjacent operator, -|-, from the original patch. Not because there was necessarily anything wrong with it, but it was more complicated than the other operators, and I only have limited time for reviewing. That will follow as a separate patch. Alexander Korotkov, reviewed by Jeff Davis and me.
1 parent 89911b3 commit 317dd55

File tree

15 files changed

+1086
-18
lines changed

15 files changed

+1086
-18
lines changed

src/backend/utils/adt/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ OBJS = acl.o arrayfuncs.o array_selfuncs.o array_typanalyze.o \
3030
tsginidx.o tsgistidx.o tsquery.o tsquery_cleanup.o tsquery_gist.o \
3131
tsquery_op.o tsquery_rewrite.o tsquery_util.o tsrank.o \
3232
tsvector.o tsvector_op.o tsvector_parser.o \
33-
txid.o uuid.o windowfuncs.o xml.o
33+
txid.o uuid.o windowfuncs.o xml.o rangetypes_spgist.o
3434

3535
like.o: like.c like_match.c
3636

src/backend/utils/adt/rangetypes_gist.c

-13
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,6 @@
2121
#include "utils/rangetypes.h"
2222

2323

24-
/* Operator strategy numbers used in the GiST range opclass */
25-
/* Numbers are chosen to match up operator names with existing usages */
26-
#define RANGESTRAT_BEFORE 1
27-
#define RANGESTRAT_OVERLEFT 2
28-
#define RANGESTRAT_OVERLAPS 3
29-
#define RANGESTRAT_OVERRIGHT 4
30-
#define RANGESTRAT_AFTER 5
31-
#define RANGESTRAT_ADJACENT 6
32-
#define RANGESTRAT_CONTAINS 7
33-
#define RANGESTRAT_CONTAINED_BY 8
34-
#define RANGESTRAT_CONTAINS_ELEM 16
35-
#define RANGESTRAT_EQ 18
36-
3724
/*
3825
* Range class properties used to segregate different classes of ranges in
3926
* GiST. Each unique combination of properties is a class. CLS_EMPTY cannot

0 commit comments

Comments
 (0)