-
Notifications
You must be signed in to change notification settings - Fork 14
/
pgs_circle_sel.sql.in
109 lines (83 loc) · 4.07 KB
/
pgs_circle_sel.sql.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
CREATE FUNCTION spoint_contained_by_circle_sel(internal, oid, internal, integer)
RETURNS double precision
AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_sel'
LANGUAGE C
IMMUTABLE STRICT PARALLEL SAFE;
COMMENT ON FUNCTION spoint_contained_by_circle_sel(internal, oid, internal, integer) IS
'selectivity estimator function for spoint_contained_by_circle';
CREATE FUNCTION spoint_contained_by_circle_joinsel(internal, oid, internal, smallint, internal)
RETURNS double precision
AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_joinsel'
LANGUAGE C
IMMUTABLE STRICT PARALLEL SAFE;
COMMENT ON FUNCTION spoint_contained_by_circle_joinsel(internal, oid, internal, smallint, internal) IS
'join selectivity estimator function for spoint_contained_by_circle';
CREATE FUNCTION spoint_contained_by_circle_neg_sel(internal, oid, internal, integer)
RETURNS double precision
AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_neg_sel'
LANGUAGE C
IMMUTABLE STRICT PARALLEL SAFE;
COMMENT ON FUNCTION spoint_contained_by_circle_neg_sel(internal, oid, internal, integer) IS
'selectivity estimator function for spoint_contained_by_circle_neg';
CREATE FUNCTION spoint_contained_by_circle_neg_joinsel(internal, oid, internal, smallint, internal)
RETURNS double precision
AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_neg_joinsel'
LANGUAGE C
IMMUTABLE STRICT PARALLEL SAFE;
COMMENT ON FUNCTION spoint_contained_by_circle_neg_joinsel(internal, oid, internal, smallint, internal) IS
'join selectivity estimator function for spoint_contained_by_circle_neg';
CREATE FUNCTION spoint_contained_by_circle_com_sel(internal, oid, internal, integer)
RETURNS double precision
AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_com_sel'
LANGUAGE C
IMMUTABLE STRICT PARALLEL SAFE;
COMMENT ON FUNCTION spoint_contained_by_circle_com_sel(internal, oid, internal, integer) IS
'selectivity estimator function for spoint_contained_by_circle_com';
CREATE FUNCTION spoint_contained_by_circle_com_joinsel(internal, oid, internal, smallint, internal)
RETURNS double precision
AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_com_joinsel'
LANGUAGE C
IMMUTABLE STRICT PARALLEL SAFE;
COMMENT ON FUNCTION spoint_contained_by_circle_com_joinsel(internal, oid, internal, smallint, internal) IS
'join selectivity estimator function for spoint_contained_by_circle_com';
CREATE FUNCTION spoint_contained_by_circle_com_neg_sel(internal, oid, internal, integer)
RETURNS double precision
AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_com_neg_sel'
LANGUAGE C
IMMUTABLE STRICT PARALLEL SAFE;
COMMENT ON FUNCTION spoint_contained_by_circle_com_neg_sel(internal, oid, internal, integer) IS
'selectivity estimator function for spoint_contained_by_circle_com_neg';
CREATE FUNCTION spoint_contained_by_circle_com_neg_joinsel(internal, oid, internal, smallint, internal)
RETURNS double precision
AS 'MODULE_PATHNAME' , 'spherepoint_in_circle_com_neg_joinsel'
LANGUAGE C
IMMUTABLE STRICT PARALLEL SAFE;
COMMENT ON FUNCTION spoint_contained_by_circle_com_neg_joinsel(internal, oid, internal, smallint, internal) IS
'join selectivity estimator function for spoint_contained_by_circle_com_neg';
ALTER OPERATOR @> (scircle, spoint)
SET (
RESTRICT = spoint_contained_by_circle_com_sel,
JOIN = spoint_contained_by_circle_com_joinsel
);
ALTER OPERATOR <@ (spoint, scircle)
SET (
RESTRICT = spoint_contained_by_circle_sel,
JOIN = spoint_contained_by_circle_joinsel
);
ALTER OPERATOR !@> (scircle, spoint)
SET (
RESTRICT = spoint_contained_by_circle_com_neg_sel,
JOIN = spoint_contained_by_circle_com_neg_joinsel
);
ALTER OPERATOR !<@ (spoint, scircle)
SET (
RESTRICT = spoint_contained_by_circle_neg_sel,
JOIN = spoint_contained_by_circle_neg_joinsel
);
CREATE FUNCTION spoint_dwithin(spoint, spoint, float8)
RETURNS boolean
AS 'MODULE_PATHNAME', 'spherepoint_dwithin'
LANGUAGE C
IMMUTABLE STRICT PARALLEL SAFE;
COMMENT ON FUNCTION spoint_dwithin(spoint, spoint, float8) IS
'predicate matching spherical points less than a given distance apart';