MobilityDB 1.1
temporal_analyze.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 __TEMPORAL_ANALYZE_H__
35#define __TEMPORAL_ANALYZE_H__
36
37/* PostgreSQL */
38#include <postgres.h>
39#include <statistics/extended_stats_internal.h>
40#include <fmgr.h>
41
42/*****************************************************************************/
43
44/*
45 * Extra data for compute_stats function
46 * Structure based on the ArrayAnalyzeExtraData from file array_typanalyze.c
47 */
48typedef struct
49{
50 /* Information about array element type */
54 bool typbyval;
57
58 /* Information about the value part of array element */
65
66 /* Information about the temporal part of array element */
73
74 /*
75 * Lookup data for element type's comparison and hash functions (these are
76 * in the type's typcache entry, which we expect to remain valid over the
77 * lifespan of the ANALYZE run)
78 */
79 FmgrInfo *cmp;
80 FmgrInfo *hash;
81 FmgrInfo *value_cmp;
82 FmgrInfo *value_hash;
83 FmgrInfo *time_cmp;
84 FmgrInfo *time_hash;
85
86 /* Saved state from std_typanalyze() */
87 AnalyzeAttrComputeStatsFunc std_compute_stats;
90
91/*
92 * Extra information used by the default analysis routines
93 */
94typedef struct
95{
96 int count;
97 int first;
99
100typedef struct
101{
102 SortSupport ssup;
105
106/*****************************************************************************
107 * Statistics information for temporal types
108 *****************************************************************************/
109
110extern Datum temporal_analyze(FunctionCallInfo fcinfo,
111 void (*functemp)(VacAttrStats *, AnalyzeAttrFetchFunc, int, double));
112
113/*****************************************************************************/
114
115#endif
signed short int16
Functions for building a cache of temporal types and operators.
Definition: meos_catalog.h:41
uintptr_t Datum
Definition: pg_ext_defs.in.h:4
unsigned int Oid
Definition: postgres_ext.h:31
SortSupport ssup
Definition: temporal_analyze.h:102
int * tupnoLink
Definition: temporal_analyze.h:103
Definition: temporal_analyze.h:101
int first
values[] index of first occurrence
Definition: temporal_analyze.h:97
int count
Definition: temporal_analyze.h:96
Definition: temporal_analyze.h:95
Oid lt_opr
default less than operator's OID
Definition: temporal_analyze.h:53
FmgrInfo * value_hash
Definition: temporal_analyze.h:82
FmgrInfo * hash
Definition: temporal_analyze.h:80
int16 value_typlen
Definition: temporal_analyze.h:63
int16 typlen
Definition: temporal_analyze.h:55
FmgrInfo * value_cmp
Definition: temporal_analyze.h:81
bool time_typbyval
physical properties of element type
Definition: temporal_analyze.h:70
FmgrInfo * time_hash
Definition: temporal_analyze.h:84
char typalign
Definition: temporal_analyze.h:56
bool typbyval
physical properties of element type
Definition: temporal_analyze.h:54
char time_typalign
Definition: temporal_analyze.h:72
Oid time_typid
element type's OID
Definition: temporal_analyze.h:67
void * std_extra_data
Definition: temporal_analyze.h:88
FmgrInfo * cmp
Definition: temporal_analyze.h:79
char value_typalign
Definition: temporal_analyze.h:64
bool value_typbyval
physical properties of element type
Definition: temporal_analyze.h:62
AnalyzeAttrComputeStatsFunc std_compute_stats
Definition: temporal_analyze.h:87
Oid time_lt_opr
default less than operator's OID
Definition: temporal_analyze.h:69
Oid value_lt_opr
default less than operator's OID
Definition: temporal_analyze.h:61
Oid eq_opr
default equality operator's OID
Definition: temporal_analyze.h:52
Oid typid
element type's OID
Definition: temporal_analyze.h:51
Oid value_eq_opr
default equality operator's OID
Definition: temporal_analyze.h:60
int16 time_typlen
Definition: temporal_analyze.h:71
Oid time_eq_opr
default equality operator's OID
Definition: temporal_analyze.h:68
Oid value_typid
element type's OID
Definition: temporal_analyze.h:59
FmgrInfo * time_cmp
Definition: temporal_analyze.h:83
Functions for gathering statistics from temporal alphanumeric columns.
Definition: temporal_analyze.h:49
Datum temporal_analyze(FunctionCallInfo fcinfo, void(*functemp)(VacAttrStats *, AnalyzeAttrFetchFunc, int, double))
Generic analyze function for temporal columns.
Definition: temporal_analyze.c:314