PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <math.h>
#include "access/gist.h"
#include "access/stratnum.h"
#include "utils/float.h"
#include "utils/fmgrprotos.h"
#include "utils/geo_decls.h"
#include "utils/sortsupport.h"
Go to the source code of this file.
Data Structures | |
struct | CommonEntry |
struct | ConsiderSplitContext |
struct | SplitInterval |
Macros | |
#define | LIMIT_RATIO 0.3 |
#define | PLACE_LEFT(box, off) |
#define | PLACE_RIGHT(box, off) |
#define | point_point_distance(p1, p2) |
#define | GeoStrategyNumberOffset 20 |
#define | PointStrategyNumberGroup 0 |
#define | BoxStrategyNumberGroup 1 |
#define | PolygonStrategyNumberGroup 2 |
#define | CircleStrategyNumberGroup 3 |
#define BoxStrategyNumberGroup 1 |
Definition at line 1332 of file gistproc.c.
#define CircleStrategyNumberGroup 3 |
Definition at line 1334 of file gistproc.c.
#define GeoStrategyNumberOffset 20 |
Definition at line 1330 of file gistproc.c.
#define LIMIT_RATIO 0.3 |
Definition at line 44 of file gistproc.c.
#define PLACE_LEFT | ( | box, | |
off | |||
) |
#define PLACE_RIGHT | ( | box, | |
off | |||
) |
#define point_point_distance | ( | p1, | |
p2 | |||
) |
Definition at line 1216 of file gistproc.c.
#define PointStrategyNumberGroup 0 |
Definition at line 1331 of file gistproc.c.
#define PolygonStrategyNumberGroup 2 |
Definition at line 1333 of file gistproc.c.
Definition at line 146 of file gistproc.c.
References b, float8_gt(), float8_lt(), BOX::high, BOX::low, Point::x, and Point::y.
Referenced by fallbackSplit(), gist_box_picksplit(), and gist_box_union().
Definition at line 97 of file gistproc.c.
References float8_mi(), rt_box_union(), and size_box().
Referenced by gist_box_penalty(), and gist_box_picksplit().
|
static |
Definition at line 460 of file gistproc.c.
References float8_cmp_internal().
Referenced by gist_box_picksplit().
Definition at line 1221 of file gistproc.c.
References Assert, elog, ERROR, float8_mi(), BOX::high, BOX::low, point_point_distance, Point::x, and Point::y.
Referenced by gist_bbox_distance(), and gist_point_distance().
|
static |
Definition at line 216 of file gistproc.c.
References adjustBox(), BoxPGetDatum(), cur, DatumGetBoxP(), FirstOffsetNumber, i, GISTENTRY::key, GistEntryVector::n, OffsetNumberNext, palloc(), GIST_SPLITVEC::spl_ldatum, GIST_SPLITVEC::spl_left, GIST_SPLITVEC::spl_nleft, GIST_SPLITVEC::spl_nright, GIST_SPLITVEC::spl_rdatum, GIST_SPLITVEC::spl_right, and GistEntryVector::vector.
Referenced by gist_box_picksplit().
|
inlinestatic |
Definition at line 351 of file gistproc.c.
References context, float4_div(), float8_div(), float8_mi(), LIMIT_RATIO, Min, non_negative(), and range().
Referenced by gist_box_picksplit().
|
static |
Definition at line 1479 of file gistproc.c.
References computeDistance(), DatumGetBoxP(), DatumGetPointP(), elog, ERROR, GeoStrategyNumberOffset, GISTENTRY::key, and PointStrategyNumberGroup.
Referenced by gist_box_distance(), gist_circle_distance(), and gist_poly_distance().
|
static |
Definition at line 1736 of file gistproc.c.
Referenced by gist_point_sortsupport().
|
static |
Definition at line 1714 of file gistproc.c.
References DatumGetBoxP(), BOX::low, point_zorder_internal(), Point::x, and Point::y.
Referenced by gist_point_sortsupport().
|
static |
Definition at line 1681 of file gistproc.c.
References a, b, DatumGetBoxP(), BOX::low, p2, point_zorder_internal(), Point::x, and Point::y.
Referenced by gist_point_sortsupport().
Datum gist_box_consistent | ( | PG_FUNCTION_ARGS | ) |
Definition at line 113 of file gistproc.c.
References DatumGetBoxP(), gist_box_leaf_consistent(), GIST_LEAF, GISTENTRY::key, PG_GETARG_BOX_P, PG_GETARG_POINTER, PG_GETARG_UINT16, PG_RETURN_BOOL, and rtree_internal_consistent().
Datum gist_box_distance | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1500 of file gistproc.c.
References gist_bbox_distance(), PG_GETARG_DATUM, PG_GETARG_POINTER, PG_GETARG_UINT16, and PG_RETURN_FLOAT8.
|
static |
Definition at line 872 of file gistproc.c.
References box_above(), box_below(), box_contain(), box_contained(), box_left(), box_overabove(), box_overbelow(), box_overlap(), box_overleft(), box_overright(), box_right(), box_same(), DatumGetBool(), DirectFunctionCall2, elog, ERROR, sort-test::key, PointerGetDatum(), RTAboveStrategyNumber, RTBelowStrategyNumber, RTContainedByStrategyNumber, RTContainsStrategyNumber, RTLeftStrategyNumber, RTOverAboveStrategyNumber, RTOverBelowStrategyNumber, RTOverlapStrategyNumber, RTOverLeftStrategyNumber, RTOverRightStrategyNumber, RTRightStrategyNumber, and RTSameStrategyNumber.
Referenced by gist_box_consistent().
Datum gist_box_penalty | ( | PG_FUNCTION_ARGS | ) |
Definition at line 199 of file gistproc.c.
References box_penalty(), DatumGetBoxP(), GISTENTRY::key, PG_GETARG_POINTER, and PG_RETURN_POINTER.
Datum gist_box_picksplit | ( | PG_FUNCTION_ARGS | ) |
Definition at line 495 of file gistproc.c.
References adjustBox(), Assert, box_penalty(), common_entry_cmp(), context, DatumGetBoxP(), CommonEntry::delta, fallbackSplit(), FirstOffsetNumber, float8_eq(), float8_ge(), float8_gt(), float8_le(), float8_lt(), float8_mi(), g_box_consider_split(), BOX::high, i, CommonEntry::index, interval_cmp_lower(), interval_cmp_upper(), GISTENTRY::key, LIMIT_RATIO, BOX::low, SplitInterval::lower, lower(), GistEntryVector::n, OffsetNumberNext, palloc(), palloc0(), PG_GETARG_POINTER, PG_RETURN_POINTER, PLACE_LEFT, PLACE_RIGHT, PointerGetDatum(), qsort, GIST_SPLITVEC::spl_ldatum, GIST_SPLITVEC::spl_left, GIST_SPLITVEC::spl_nleft, GIST_SPLITVEC::spl_nright, GIST_SPLITVEC::spl_rdatum, GIST_SPLITVEC::spl_right, SplitInterval::upper, upper(), GistEntryVector::vector, Point::x, and Point::y.
Datum gist_box_same | ( | PG_FUNCTION_ARGS | ) |
Definition at line 852 of file gistproc.c.
References float8_eq(), BOX::high, BOX::low, PG_GETARG_BOX_P, PG_GETARG_POINTER, PG_RETURN_POINTER, Point::x, and Point::y.
Datum gist_box_union | ( | PG_FUNCTION_ARGS | ) |
Definition at line 164 of file gistproc.c.
References adjustBox(), cur, DatumGetBoxP(), i, GISTENTRY::key, GistEntryVector::n, palloc(), PG_GETARG_POINTER, PG_RETURN_POINTER, and GistEntryVector::vector.
Datum gist_circle_compress | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1100 of file gistproc.c.
References CIRCLE::center, DatumGetCircleP(), float8_mi(), float8_pl(), gistentryinit, BOX::high, GISTENTRY::key, GISTENTRY::leafkey, BOX::low, GISTENTRY::offset, GISTENTRY::page, palloc(), PG_GETARG_POINTER, PG_RETURN_POINTER, PointerGetDatum(), CIRCLE::radius, GISTENTRY::rel, Point::x, and Point::y.
Datum gist_circle_consistent | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1130 of file gistproc.c.
References CIRCLE::center, DatumGetBoxP(), float8_mi(), float8_pl(), BOX::high, GISTENTRY::key, BOX::low, PG_GETARG_CIRCLE_P, PG_GETARG_POINTER, PG_GETARG_UINT16, PG_RETURN_BOOL, CIRCLE::radius, rtree_internal_consistent(), Point::x, and Point::y.
Referenced by gist_point_consistent().
Datum gist_circle_distance | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1526 of file gistproc.c.
References gist_bbox_distance(), PG_GETARG_DATUM, PG_GETARG_POINTER, PG_GETARG_UINT16, and PG_RETURN_FLOAT8.
Datum gist_point_compress | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1168 of file gistproc.c.
References BoxPGetDatum(), DatumGetPointP(), gistentryinit, BOX::high, GISTENTRY::key, GISTENTRY::leafkey, BOX::low, GISTENTRY::offset, GISTENTRY::page, palloc(), PG_GETARG_POINTER, PG_RETURN_POINTER, and GISTENTRY::rel.
Datum gist_point_consistent | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1337 of file gistproc.c.
References Assert, BoxStrategyNumberGroup, circle_contain_pt(), CirclePGetDatum(), CircleStrategyNumberGroup, DatumGetBool(), DatumGetBoxP(), DirectFunctionCall2, DirectFunctionCall5, elog, ERROR, GeoStrategyNumberOffset, gist_circle_consistent(), GIST_LEAF, gist_point_consistent_internal(), gist_poly_consistent(), BOX::high, Int16GetDatum(), GISTENTRY::key, sort-test::key, BOX::low, PG_GETARG_BOX_P, PG_GETARG_CIRCLE_P, PG_GETARG_POINT_P, PG_GETARG_POINTER, PG_GETARG_POLYGON_P, PG_GETARG_UINT16, PG_RETURN_BOOL, PointerGetDatum(), PointPGetDatum(), PointStrategyNumberGroup, poly_contain_pt(), PolygonPGetDatum(), PolygonStrategyNumberGroup, RTAboveStrategyNumber, RTBelowStrategyNumber, RTOldAboveStrategyNumber, RTOldBelowStrategyNumber, RTOverlapStrategyNumber, Point::x, and Point::y.
|
static |
Definition at line 1287 of file gistproc.c.
References elog, ERROR, FPeq(), FPge(), FPgt(), FPle(), FPlt(), sort-test::key, RTAboveStrategyNumber, RTBelowStrategyNumber, RTLeftStrategyNumber, RTRightStrategyNumber, RTSameStrategyNumber, Point::x, and Point::y.
Referenced by gist_point_consistent().
Datum gist_point_distance | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1455 of file gistproc.c.
References computeDistance(), DatumGetBoxP(), elog, ERROR, GeoStrategyNumberOffset, GIST_LEAF, GISTENTRY::key, PG_GETARG_POINT_P, PG_GETARG_POINTER, PG_GETARG_UINT16, PG_RETURN_FLOAT8, and PointStrategyNumberGroup.
Datum gist_point_fetch | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1196 of file gistproc.c.
References DatumGetBoxP(), gistentryinit, BOX::high, GISTENTRY::key, GISTENTRY::offset, GISTENTRY::page, palloc(), PG_GETARG_POINTER, PG_RETURN_POINTER, PointerGetDatum(), GISTENTRY::rel, Point::x, and Point::y.
Datum gist_point_sortsupport | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1745 of file gistproc.c.
References SortSupportData::abbrev_abort, SortSupportData::abbrev_converter, SortSupportData::abbrev_full_comparator, SortSupportData::abbreviate, SortSupportData::comparator, gist_bbox_zorder_abbrev_abort(), gist_bbox_zorder_abbrev_convert(), gist_bbox_zorder_cmp(), PG_GETARG_POINTER, PG_RETURN_VOID, and ssup_datum_unsigned_cmp().
Datum gist_poly_compress | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1035 of file gistproc.c.
References POLYGON::boundbox, DatumGetPolygonP(), gistentryinit, GISTENTRY::key, GISTENTRY::leafkey, GISTENTRY::offset, GISTENTRY::page, palloc(), PG_GETARG_POINTER, PG_RETURN_POINTER, PointerGetDatum(), and GISTENTRY::rel.
Datum gist_poly_consistent | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1062 of file gistproc.c.
References POLYGON::boundbox, DatumGetBoxP(), GISTENTRY::key, PG_FREE_IF_COPY, PG_GETARG_POINTER, PG_GETARG_POLYGON_P, PG_GETARG_UINT16, PG_RETURN_BOOL, and rtree_internal_consistent().
Referenced by gist_point_consistent().
Datum gist_poly_distance | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1543 of file gistproc.c.
References gist_bbox_distance(), PG_GETARG_DATUM, PG_GETARG_POINTER, PG_GETARG_UINT16, and PG_RETURN_FLOAT8.
|
static |
|
static |
Definition at line 315 of file gistproc.c.
References float8_cmp_internal().
Referenced by gist_box_picksplit().
|
static |
Definition at line 327 of file gistproc.c.
References float8_cmp_internal().
Referenced by gist_box_picksplit().
|
inlinestatic |
|
static |
Definition at line 1575 of file gistproc.c.
References ieee_float32_to_uint32(), part_bits32_by2(), x, and y.
Referenced by gist_bbox_zorder_abbrev_convert(), and gist_bbox_zorder_cmp().
Definition at line 55 of file gistproc.c.
References a, b, float8_max(), float8_min(), BOX::high, BOX::low, Point::x, and Point::y.
Referenced by box_penalty().
|
static |
Definition at line 957 of file gistproc.c.
References box_above(), box_below(), box_contain(), box_left(), box_overabove(), box_overbelow(), box_overlap(), box_overleft(), box_overright(), box_right(), DatumGetBool(), DirectFunctionCall2, elog, ERROR, sort-test::key, PointerGetDatum(), RTAboveStrategyNumber, RTBelowStrategyNumber, RTContainedByStrategyNumber, RTContainsStrategyNumber, RTLeftStrategyNumber, RTOverAboveStrategyNumber, RTOverBelowStrategyNumber, RTOverlapStrategyNumber, RTOverLeftStrategyNumber, RTOverRightStrategyNumber, RTRightStrategyNumber, and RTSameStrategyNumber.
Referenced by gist_box_consistent(), gist_circle_consistent(), and gist_poly_consistent().
Definition at line 68 of file gistproc.c.
References float8_le(), float8_mi(), float8_mul(), get_float8_infinity(), BOX::high, BOX::low, Point::x, and Point::y.
Referenced by box_penalty().