MobilityDB  1.0
time_gist.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * This MobilityDB code is provided under The PostgreSQL License.
4  *
5  * Copyright (c) 2016-2021, Université libre de Bruxelles and MobilityDB
6  * contributors
7  *
8  * MobilityDB includes portions of PostGIS version 3 source code released
9  * under the GNU General Public License (GPLv2 or later).
10  * Copyright (c) 2001-2021, PostGIS contributors
11  *
12  * Permission to use, copy, modify, and distribute this software and its
13  * documentation for any purpose, without fee, and without a written
14  * agreement is hereby granted, provided that the above copyright notice and
15  * this paragraph and the following two paragraphs appear in all copies.
16  *
17  * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
18  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
19  * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
20  * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
21  * OF SUCH DAMAGE.
22  *
23  * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
24  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
25  * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
26  * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
27  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
28  *
29  *****************************************************************************/
30 
36 #ifndef __TIME_GIST_H__
37 #define __TIME_GIST_H__
38 
39 #include <postgres.h>
40 #include <catalog/pg_type.h>
41 #include "timetypes.h"
42 
43 /*****************************************************************************/
44 
45 extern Datum period_gist_union(PG_FUNCTION_ARGS);
46 extern Datum timestampset_gist_compress(PG_FUNCTION_ARGS);
47 extern Datum period_gist_compress(PG_FUNCTION_ARGS);
48 extern Datum periodset_gist_compress(PG_FUNCTION_ARGS);
49 extern Datum period_gist_penalty(PG_FUNCTION_ARGS);
50 extern Datum period_gist_picksplit(PG_FUNCTION_ARGS);
51 extern Datum period_gist_same(PG_FUNCTION_ARGS);
52 extern Datum period_gist_fetch(PG_FUNCTION_ARGS);
53 
54 extern int common_entry_cmp(const void *i1, const void *i2);
55 
56 extern bool period_index_consistent_leaf(const Period *key, const Period *query,
57  StrategyNumber strategy);
58 extern bool period_gist_consistent_internal(const Period *key, const Period *query,
59  StrategyNumber strategy);
60 extern bool period_index_recheck(StrategyNumber strategy);
61 
62 #endif
63 
64 /*****************************************************************************/
Structure to represent periods.
Definition: timetypes.h:52
Datum period_gist_fetch(PG_FUNCTION_ARGS)
GiST fetch method for time types (result in a period)
Definition: time_gist.c:903
Datum period_gist_picksplit(PG_FUNCTION_ARGS)
GiST picksplit method for time types.
Definition: time_gist.c:859
bool period_gist_consistent_internal(const Period *key, const Period *query, StrategyNumber strategy)
GiST internal-page consistency for time types.
Definition: time_gist.c:103
Datum period_gist_penalty(PG_FUNCTION_ARGS)
GiST page split penalty function for periods.
Definition: time_gist.c:337
bool period_index_recheck(StrategyNumber strategy)
Returns true if a recheck is necessary depending on the strategy.
Definition: time_gist.c:136
Datum period_gist_union(PG_FUNCTION_ARGS)
GiST union method for time types.
Definition: time_gist.c:226
Datum periodset_gist_compress(PG_FUNCTION_ARGS)
GiST compress method for period sets.
Definition: time_gist.c:288
Functions for time types based on TimestampTz, that is, TimestampSet, Period, and PeriodSet...
bool period_index_consistent_leaf(const Period *key, const Period *query, StrategyNumber strategy)
Leaf-level consistency for time types.
Definition: time_gist.c:65
Datum period_gist_same(PG_FUNCTION_ARGS)
GiST same method for time types.
Definition: time_gist.c:885
int common_entry_cmp(const void *i1, const void *i2)
Compare CommonEntrys by their deltas.
Definition: time_gist.c:547
Datum timestampset_gist_compress(PG_FUNCTION_ARGS)
GiST compress method for timestamp sets.
Definition: time_gist.c:245
Datum period_gist_compress(PG_FUNCTION_ARGS)
GiST compress method for periods.
Definition: time_gist.c:268