MobilityDB 1.1
span_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 __SPAN_ANALYZE_H__
35#define __SPAN_ANALYZE_H__
36
37/* PostgreSQL */
38#include <postgres.h>
39#include <fmgr.h>
40#include <commands/vacuum.h>
41#include <statistics/extended_stats_internal.h>
42/* MEOS */
43#include "general/span.h"
44
45/*
46 * It is not possible to differentiate bound histogram of spans for the value
47 * and the time dimension with the combination stakind/staop values and thus
48 * it is necessary to define different stakind for each dimension even if the
49 * values collected are of the same type
50 */
51#define STATISTIC_KIND_VALUE_BOUNDS_HISTOGRAM 8
52#define STATISTIC_KIND_VALUE_LENGTH_HISTOGRAM 9
53#define STATISTIC_KIND_TIME_BOUNDS_HISTOGRAM 10
54#define STATISTIC_KIND_TIME_LENGTH_HISTOGRAM 11
55
56/*****************************************************************************/
57
58extern int float8_qsort_cmp(const void *a1, const void *a2);
59
60extern void span_compute_stats_generic(VacAttrStats *stats, int non_null_cnt,
61 int *slot_idx, SpanBound *lowers, SpanBound *uppers, float8 *lengths,
62 bool valuedim);
63extern Datum set_analyze(FunctionCallInfo fcinfo,
64 void (*func)(VacAttrStats *, AnalyzeAttrFetchFunc, int, double));
65
66/*****************************************************************************/
67
68#endif
double float8
Definition: c.h:570
uintptr_t Datum
Definition: pg_ext_defs.in.h:4
void span_compute_stats_generic(VacAttrStats *stats, int non_null_cnt, int *slot_idx, SpanBound *lowers, SpanBound *uppers, float8 *lengths, bool valuedim)
Compute statistics for time type columns and for the time dimension of all temporal types whose subty...
Definition: span_analyze.c:91
int float8_qsort_cmp(const void *a1, const void *a2)
Functions for gathering statistics from time type columns.
Definition: span_analyze.c:66
Datum set_analyze(FunctionCallInfo fcinfo, void(*func)(VacAttrStats *, AnalyzeAttrFetchFunc, int, double))
Basic routines for spans (a.k.a.
Definition: span.h:50