MobilityDB  1.0
tpoint_selfuncs.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  * Permission to use, copy, modify, and distribute this software and its
9  * documentation for any purpose, without fee, and without a written
10  * agreement is hereby granted, provided that the above copyright notice and
11  * this paragraph and the following two paragraphs appear in all copies.
12  *
13  * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
14  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
15  * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
16  * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
17  * OF SUCH DAMAGE.
18  *
19  * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21  * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
22  * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
23  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
24  *
25  *****************************************************************************/
26 
35 #ifndef __TPOINT_SELFUNCS_H__
36 #define __TPOINT_SELFUNCS_H__
37 
38 #include <postgres.h>
39 #include <catalog/pg_statistic.h>
40 #include <utils/selfuncs.h>
41 
42 #include "general/tempcache.h"
43 #include "tpoint.h"
44 #include "tpoint_analyze.h"
45 
51 #define X_DIM 0
52 #define Y_DIM 1
53 #define Z_DIM 2
54 #define T_DIM 3
55 #define ND_DIMS 4
56 
57 /*****************************************************************************
58  * Definitions copied from PostGIS file gserialized_estimate.c
59  *****************************************************************************/
60 
61 /*
62 * The SD factor restricts the side of the statistics histogram
63 * based on the standard deviation of the extent of the data.
64 * SDFACTOR is the number of standard deviations from the mean
65 * the histogram will extend.
66 */
67 #define SDFACTOR 3.25
68 
75 #define MIN_DIMENSION_WIDTH 0.000000001
76 
77 #define STATISTIC_KIND_ND 102
78 #define STATISTIC_KIND_2D 103
79 #define STATISTIC_SLOT_ND 0
80 #define STATISTIC_SLOT_2D 1
81 
85 #define FALLBACK_ND_SEL 0.2
86 #define FALLBACK_ND_JOINSEL 0.3
87 
88 /*****************************************************************************/
89 
90 extern Datum tpoint_sel(PG_FUNCTION_ARGS);
91 extern Datum tpoint_joinsel(PG_FUNCTION_ARGS);
92 
93 /*****************************************************************************/
94 
95 #endif
Functions for gathering statistics from temporal point columns.
Datum tpoint_sel(PG_FUNCTION_ARGS)
Estimate the join selectivity value of the operators for temporal points.
Definition: tpoint_selfuncs.c:810
Functions for temporal points.
Functions for building a cache of type and operator Oids.
Datum tpoint_joinsel(PG_FUNCTION_ARGS)
Estimate the join selectivity value of the operators for temporal points.
Definition: tpoint_selfuncs.c:927