MobilityDB 1.1
tnumber_gist.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 * This MobilityDB code is provided under The PostgreSQL License.
4 * Copyright (c) 2016-2023, Université libre de Bruxelles and MobilityDB
5 * contributors
6 *
7 * MobilityDB includes portions of PostGIS version 3 source code released
8 * under the GNU General Public License (GPLv2 or later).
9 * Copyright (c) 2001-2023, PostGIS contributors
10 *
11 * Permission to use, copy, modify, and distribute this software and its
12 * documentation for any purpose, without fee, and without a written
13 * agreement is hereby granted, provided that the above copyright notice and
14 * this paragraph and the following two paragraphs appear in all copies.
15 *
16 * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
17 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
18 * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
19 * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
20 * OF SUCH DAMAGE.
21 *
22 * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
23 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
25 * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
26 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
27 *
28 *****************************************************************************/
29
34#ifndef __TNUMBER_GIST_H__
35#define __TNUMBER_GIST_H__
36
37/* PostgreSQL */
38#include <postgres.h>
39#include <fmgr.h>
40#include <access/gist.h>
41#include <access/stratnum.h>
42/* MEOS */
43#include "general/temporal.h"
44
45/*****************************************************************************/
46
53typedef struct
54{
58 bool first;
59 double leftUpper;
60 double rightLower;
63 int dim;
64 double range;
66
67/*****************************************************************************/
68
69/* The following functions are also called by tpoint_gist.c */
70extern void bbox_gist_fallback_split(GistEntryVector *entryvec,
71 GIST_SPLITVEC *v, meosType bboxtype, void (*bbox_adjust)(void *, void *));
72extern int interval_cmp_lower(const void *i1, const void *i2);
73extern int interval_cmp_upper(const void *i1, const void *i2);
74extern float non_negative(float val);
75extern void bbox_gist_consider_split(ConsiderSplitContext *context, int dimNum,
76 meosType bboxtype, double rightLower, int minLeftCount, double leftUpper,
77 int maxLeftCount);
78extern Datum bbox_gist_picksplit_ext(FunctionCallInfo fcinfo, meosType bboxtype,
79 void (*bbox_adjust)(void *, void *), double (*bbox_penalty)(void *, void *));
80
81/* The following functions are also called by tnumber_spgist.c */
82extern bool tbox_index_consistent_leaf(const TBox *key, const TBox *query,
83 StrategyNumber strategy);
84
85/*****************************************************************************/
86
87#endif
float float4
Definition: c.h:569
meosType
Enumeration that defines the built-in and temporal types used in MobilityDB.
Definition: meos_catalog.h:53
uintptr_t Datum
Definition: pg_ext_defs.in.h:4
double rightLower
lower bound of right interval
Definition: tnumber_gist.h:60
int dim
axis of this split
Definition: tnumber_gist.h:63
int entriesCount
total number of entries being split
Definition: tnumber_gist.h:55
double leftUpper
upper bound of left interval
Definition: tnumber_gist.h:59
float4 ratio
split ratio
Definition: tnumber_gist.h:61
bboxunion boundingBox
minimum bounding box across all entries
Definition: tnumber_gist.h:56
double range
width of general MBR projection to the selected axis
Definition: tnumber_gist.h:64
float4 overlap
overlap between left and right predicate
Definition: tnumber_gist.h:62
bool first
Information about currently selected split follows.
Definition: tnumber_gist.h:58
R-tree GiST index for temporal integers and temporal floats.
Definition: tnumber_gist.h:54
Structure to represent temporal boxes.
Definition: meos.h:97
float non_negative(float val)
Replace negative (or NaN) value with zero.
Definition: tnumber_gist.c:462
int interval_cmp_upper(const void *i1, const void *i2)
Interval comparison function by upper bound of the interval.
Definition: tnumber_gist.c:450
void bbox_gist_fallback_split(GistEntryVector *entryvec, GIST_SPLITVEC *v, meosType bboxtype, void(*bbox_adjust)(void *, void *))
Trivial split: half of entries will be placed on one page and the other half on another page.
Definition: tnumber_gist.c:619
bool tbox_index_consistent_leaf(const TBox *key, const TBox *query, StrategyNumber strategy)
R-tree GiST index for temporal integers and temporal floats.
Definition: tnumber_gist.c:77
void bbox_gist_consider_split(ConsiderSplitContext *context, int dimNum, meosType bboxtype, double rightLower, int minLeftCount, double leftUpper, int maxLeftCount)
Consider replacement of currently selected split with the better one.
Definition: tnumber_gist.c:474
Datum bbox_gist_picksplit_ext(FunctionCallInfo fcinfo, meosType bboxtype, void(*bbox_adjust)(void *, void *), double(*bbox_penalty)(void *, void *))
Double sorting split algorithm.
Definition: tnumber_gist.c:677
int interval_cmp_lower(const void *i1, const void *i2)
Interval comparison function by lower bound of the interval.
Definition: tnumber_gist.c:438
Structure to represent all types of bounding boxes.
Definition: temporal.h:314