36 #ifndef __SKIPLIST_H__ 37 #define __SKIPLIST_H__ 40 #include <catalog/pg_type.h> 49 #define SKIPLIST_MAXLEVEL 32 50 #define SKIPLIST_INITIAL_CAPACITY 1024 51 #define SKIPLIST_GROW 1 52 #define SKIPLIST_INITIAL_FREELIST 32 103 void **values,
int count,
datum_func2 func,
bool crossings);
106 void *data,
size_t size);
112 TimestampTz *
timestamp_agg(TimestampTz *times1,
int count1, TimestampTz *times2,
113 int count2,
int *newcount);
115 int count2,
int *newcount);
117 int count2, Datum (*func)(Datum, Datum),
int *newcount);
119 int count2, Datum (*func)(Datum, Datum),
bool crossings,
int *newcount);
Structure to represent periods.
Definition: timetypes.h:52
int length
Definition: skiplist.h:82
ElemType
Definition: skiplist.h:67
void ** skiplist_values(SkipList *list)
Returns the values contained in the skiplist.
Definition: skiplist.c:556
void skiplist_splice(FunctionCallInfo fcinfo, SkipList *list, void **values, int count, datum_func2 func, bool crossings)
Splice the skiplist with the array of values using the aggregation function.
Definition: skiplist.c:369
void aggstate_set_extra(FunctionCallInfo fcinfo, SkipList *state, void *data, size_t size)
Reads the state value from the buffer.
Definition: skiplist.c:681
Basic functions for temporal types of any subtype.
void * value
Definition: skiplist.h:62
int * freed
Definition: skiplist.h:83
Structure to represent skiplists that keep the current state of an aggregation.
Definition: skiplist.h:77
Datum tagg_serialize(PG_FUNCTION_ARGS)
Serialize the state value.
Definition: skiplist.c:698
int freecount
Definition: skiplist.h:84
int height
Definition: skiplist.h:63
void * extra
Definition: skiplist.h:87
Definition: skiplist.h:70
TSequence ** tsequence_tagg(TSequence **sequences1, int count1, TSequence **sequences2, int count2, Datum(*func)(Datum, Datum), bool crossings, int *newcount)
Generic aggregate function for temporal sequences.
Definition: temporal_aggfuncs.c:362
Period ** period_agg(Period **periods1, int count1, Period **periods2, int count2, int *newcount)
Generic aggregate function for periods.
Definition: time_aggfuncs.c:130
Elem * elems
Definition: skiplist.h:89
TInstant ** tinstant_tagg(TInstant **instants1, int count1, TInstant **instants2, int count2, Datum(*func)(Datum, Datum), int *newcount)
Definition: temporal_aggfuncs.c:173
Definition: skiplist.h:69
Datum(* datum_func2)(Datum, Datum)
Definition: temporal.h:358
TimestampTz * timestamp_agg(TimestampTz *times1, int count1, TimestampTz *times2, int count2, int *newcount)
Definition: time_aggfuncs.c:82
SkipList * skiplist_make(FunctionCallInfo fcinfo, void **values, int count, ElemType elemtype)
Outputs the skiplist in graphviz dot format for visualisation and debugging purposes.
Definition: skiplist.c:270
ElemType elemtype
Definition: skiplist.h:79
Datum tagg_deserialize(PG_FUNCTION_ARGS)
Deserialize the state value.
Definition: skiplist.c:712
void * skiplist_headval(SkipList *list)
Returns the value at the head of the skiplist.
Definition: skiplist.c:337
int capacity
Definition: skiplist.h:80
Definition: skiplist.h:71
size_t extrasize
Definition: skiplist.h:88
#define SKIPLIST_MAXLEVEL
maximum possible is 47 with current RNG
Definition: skiplist.h:49
int tail
Definition: skiplist.h:86
Structure to represent temporal values of sequence subtype.
Definition: temporal.h:279
int freecap
Definition: skiplist.h:85
Structure to represent elements in the skiplists.
Definition: skiplist.h:60
int next
Definition: skiplist.h:81
Structure to represent temporal values of instant subtype.
Definition: temporal.h:253