MobilityDB 1.3
Loading...
Searching...
No Matches
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-2025, 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-2025, 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 __PG_TNUMBER_GIST_H__
35#define __PG_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 <meos.h>
44#include "temporal/temporal.h"
45
46/*****************************************************************************/
47
54typedef struct
55{
59 bool first;
60 double leftUpper;
61 double rightLower;
64 int dim;
65 double range;
67
68/*****************************************************************************/
69
70/* The following functions are also called by tpoint_gist.c */
71extern void bbox_gist_fallback_split(GistEntryVector *entryvec,
72 GIST_SPLITVEC *v, meosType bboxtype, void (*bbox_adjust)(void *, void *));
73extern int interval_cmp_lower(const void *i1, const void *i2);
74extern int interval_cmp_upper(const void *i1, const void *i2);
75extern float non_negative(float val);
76extern void bbox_gist_consider_split(ConsiderSplitContext *context, int dimNum,
77 meosType bboxtype, double rightLower, int minLeftCount, double leftUpper,
78 int maxLeftCount);
79extern Datum bbox_gist_picksplit(FunctionCallInfo fcinfo, meosType bboxtype,
80 void (*bbox_adjust)(void *, void *), double (*bbox_penalty)(void *, void *));
81
82/* The following functions are also called by tnumber_spgist.c */
83extern bool tbox_index_leaf_consistent(const TBox *key, const TBox *query,
84 StrategyNumber strategy);
85
86/*****************************************************************************/
87
88#endif /* __PG_TNUMBER_GIST_H__ */
float float4
Definition: c.h:580
meosType
Enumeration that defines the built-in and temporal types used in MobilityDB.
Definition: meos_catalog.h:55
External API of the Mobility Engine Open Source (MEOS) library.
uint16 StrategyNumber
Definition: stratnum.h:22
uintptr_t Datum
Definition: postgres_ext_defs.in.h:7
double rightLower
lower bound of right interval
Definition: tnumber_gist.h:61
int dim
axis of this split
Definition: tnumber_gist.h:64
int entriesCount
total number of entries being split
Definition: tnumber_gist.h:56
double leftUpper
upper bound of left interval
Definition: tnumber_gist.h:60
float4 ratio
split ratio
Definition: tnumber_gist.h:62
bboxunion boundingBox
minimum bounding box across all entries
Definition: tnumber_gist.h:57
double range
width of general MBR projection to the selected axis
Definition: tnumber_gist.h:65
float4 overlap
overlap between left and right predicate
Definition: tnumber_gist.h:63
bool first
Information about currently selected split follows.
Definition: tnumber_gist.h:59
R-tree GiST index for temporal integers and temporal floats.
Definition: tnumber_gist.h:55
Structure to represent temporal boxes.
Definition: meos.h:124
float non_negative(float val)
Replace negative (or NaN) value with zero.
Definition: tnumber_gist.c:339
int interval_cmp_upper(const void *i1, const void *i2)
Interval comparison function by upper bound of the intervals.
Definition: tnumber_gist.c:327
Datum bbox_gist_picksplit(FunctionCallInfo fcinfo, meosType bboxtype, void(*bbox_adjust)(void *, void *), double(*bbox_penalty)(void *, void *))
Double sorting split algorithm.
Definition: tnumber_gist.c:552
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:494
bool tbox_index_leaf_consistent(const TBox *key, const TBox *query, StrategyNumber strategy)
Leaf consistency for temporal numbers.
Definition: tbox_index.c:73
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:348
int interval_cmp_lower(const void *i1, const void *i2)
Interval comparison function by lower bound of the intervals.
Definition: tnumber_gist.c:315
Structure to represent all types of bounding boxes.
Definition: temporal.h:266