|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <math.h>#include "catalog/pg_aggregate.h"#include "catalog/pg_operator.h"#include "catalog/pg_type.h"#include "executor/executor.h"#include "miscadmin.h"#include "nodes/nodeFuncs.h"#include "optimizer/optimizer.h"#include "utils/array.h"#include "utils/fmgrprotos.h"#include "utils/lsyscache.h"#include "utils/tuplesort.h"
Go to the source code of this file.
Data Structures | |
| struct | OSAPerQueryState |
| struct | OSAPerGroupState |
| struct | pct_info |
Typedefs | |
| typedef struct OSAPerQueryState | OSAPerQueryState |
| typedef struct OSAPerGroupState | OSAPerGroupState |
| typedef Datum(* | LerpFunc) (Datum lo, Datum hi, double pct) |
Definition at line 500 of file orderedsetaggs.c.
Definition at line 503 of file orderedsetaggs.c.
References DatumGetFloat8(), fb(), and Float8GetDatum().
Referenced by percentile_cont_float8_final(), and percentile_cont_float8_multi_final().
|
static |
Definition at line 1142 of file orderedsetaggs.c.
References elog, ERROR, fb(), FunctionCallInfoBaseData::flinfo, get_fn_expr_argtype(), i, TupleDescData::natts, and TupleDescAttr().
Referenced by hypothetical_dense_rank_final(), and hypothetical_rank_common().
| Datum hypothetical_cume_dist_final | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1278 of file orderedsetaggs.c.
References fb(), hypothetical_rank_common(), and PG_RETURN_FLOAT8.
| Datum hypothetical_dense_rank_final | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1295 of file orderedsetaggs.c.
References AGG_CONTEXT_AGGREGATE, AggCheckCallContext(), Assert, CHECK_FOR_INTERRUPTS, CreateStandaloneExprContext(), DatumGetInt32(), ExprContext::ecxt_innertuple, ExprContext::ecxt_outertuple, elog, ERROR, ExecClearTuple(), ExecDropSingleTupleTableSlot(), ExecQualAndReset(), ExecStoreVirtualTuple(), execTuplesMatchPrepare(), fb(), hypothetical_check_argtypes(), i, Int32GetDatum(), MakeSingleTupleTableSlot(), MemoryContextSwitchTo(), PG_ARGISNULL, PG_GETARG_DATUM, PG_GETARG_POINTER, PG_NARGS, PG_RETURN_INT64, slot_getattr(), TupleTableSlot::tts_isnull, TupleTableSlot::tts_values, TTSOpsMinimalTuple, TupIsNull, tuplesort_gettupleslot(), tuplesort_performsort(), and tuplesort_puttupleslot().
| Datum hypothetical_percent_rank_final | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1258 of file orderedsetaggs.c.
References fb(), hypothetical_rank_common(), and PG_RETURN_FLOAT8.
|
static |
Definition at line 1171 of file orderedsetaggs.c.
References AGG_CONTEXT_AGGREGATE, AggCheckCallContext(), Assert, CHECK_FOR_INTERRUPTS, DatumGetInt32(), elog, ERROR, ExecClearTuple(), ExecStoreVirtualTuple(), fb(), flag(), hypothetical_check_argtypes(), i, Int32GetDatum(), PG_ARGISNULL, PG_GETARG_DATUM, PG_GETARG_POINTER, PG_NARGS, slot_getattr(), TupleTableSlot::tts_isnull, TupleTableSlot::tts_values, tuplesort_gettupleslot(), tuplesort_performsort(), and tuplesort_puttupleslot().
Referenced by hypothetical_cume_dist_final(), hypothetical_percent_rank_final(), and hypothetical_rank_final().
| Datum hypothetical_rank_final | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1244 of file orderedsetaggs.c.
References hypothetical_rank_common(), and PG_RETURN_INT64.
Definition at line 512 of file orderedsetaggs.c.
References DirectFunctionCall2, fb(), Float8GetDatumFast, interval_mi(), interval_mul(), and interval_pl().
Referenced by percentile_cont_interval_final(), and percentile_cont_interval_multi_final().
| Datum mode_final | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1033 of file orderedsetaggs.c.
References AGG_CONTEXT_AGGREGATE, AggCheckCallContext(), Assert, CHECK_FOR_INTERRUPTS, DatumGetBool(), DatumGetPointer(), fb(), fmgr_info_cxt(), FmgrInfo::fn_oid, FunctionCall2Coll(), get_opcode(), OidIsValid, pfree(), PG_ARGISNULL, PG_GET_COLLATION, PG_GETARG_POINTER, PG_RETURN_DATUM, PG_RETURN_NULL, tuplesort_getdatum(), tuplesort_performsort(), tuplesort_rescan(), and val.
Definition at line 339 of file orderedsetaggs.c.
References arg, DatumGetPointer(), ExecClearTuple(), fb(), and tuplesort_end().
Referenced by ordered_set_startup().
|
static |
Definition at line 113 of file orderedsetaggs.c.
References AGG_CONTEXT_AGGREGATE, AggCheckCallContext(), AggGetAggref(), Aggref::aggorder, OSAPerQueryState::aggref, AggRegisterCallback(), AggStateIsShared(), Aggref::args, Assert, CreateTemplateTupleDesc(), elog, OSAPerQueryState::eqOperator, OSAPerQueryState::eqOperators, ERROR, ExecTypeFromTL(), exprCollation(), exprType(), fb(), FunctionCallInfoBaseData::flinfo, FmgrInfo::fn_extra, FmgrInfo::fn_mcxt, FreeTupleDesc(), get_sortgroupclause_tle(), get_typlenbyvalalign(), i, InvalidOid, lfirst, linitial, list_length(), MakeSingleTupleTableSlot(), MemoryContextSwitchTo(), TupleDescData::natts, OSAPerQueryState::numSortCols, OidIsValid, ordered_set_shutdown(), palloc(), palloc0_object, palloc_object, PointerGetDatum(), OSAPerQueryState::qcontext, OSAPerQueryState::rescan_needed, OSAPerQueryState::sortColIdx, OSAPerQueryState::sortCollation, OSAPerQueryState::sortCollations, OSAPerQueryState::sortColType, OSAPerQueryState::sortNullsFirst, OSAPerQueryState::sortNullsFirsts, OSAPerQueryState::sortOperator, OSAPerQueryState::sortOperators, TTSOpsMinimalTuple, OSAPerQueryState::tupdesc, TupleDescCopyEntry(), TupleDescInitEntry(), tuplesort_begin_datum(), tuplesort_begin_heap(), TUPLESORT_NONE, TUPLESORT_RANDOMACCESS, OSAPerQueryState::tupslot, OSAPerQueryState::typAlign, OSAPerQueryState::typByVal, OSAPerQueryState::typLen, and work_mem.
Referenced by ordered_set_transition(), and ordered_set_transition_multi().
| Datum ordered_set_transition | ( | PG_FUNCTION_ARGS | ) |
Definition at line 358 of file orderedsetaggs.c.
References fb(), ordered_set_startup(), PG_ARGISNULL, PG_GETARG_DATUM, PG_GETARG_POINTER, PG_RETURN_POINTER, and tuplesort_putdatum().
| Datum ordered_set_transition_multi | ( | PG_FUNCTION_ARGS | ) |
Definition at line 383 of file orderedsetaggs.c.
References Assert, ExecClearTuple(), ExecStoreVirtualTuple(), fb(), i, Int32GetDatum(), TupleDescData::natts, ordered_set_startup(), PG_ARGISNULL, PG_GETARG_DATUM, PG_GETARG_POINTER, PG_NARGS, PG_RETURN_POINTER, TupleTableSlot::tts_isnull, TupleTableSlot::tts_tupleDescriptor, TupleTableSlot::tts_values, and tuplesort_puttupleslot().
Definition at line 646 of file orderedsetaggs.c.
Referenced by setup_pct_info().
|
static |
Definition at line 526 of file orderedsetaggs.c.
References AGG_CONTEXT_AGGREGATE, AggCheckCallContext(), Assert, elog, ereport, errcode(), errmsg(), ERROR, fb(), PG_ARGISNULL, PG_GETARG_FLOAT8, PG_GETARG_POINTER, PG_RETURN_DATUM, PG_RETURN_NULL, tuplesort_getdatum(), tuplesort_performsort(), tuplesort_rescan(), tuplesort_skiptuples(), and val.
Referenced by percentile_cont_float8_final(), and percentile_cont_interval_final().
| Datum percentile_cont_float8_final | ( | PG_FUNCTION_ARGS | ) |
Definition at line 613 of file orderedsetaggs.c.
References fb(), float8_lerp(), and percentile_cont_final_common().
| Datum percentile_cont_float8_multi_final | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1004 of file orderedsetaggs.c.
References fb(), float8_lerp(), and percentile_cont_multi_final_common().
| Datum percentile_cont_interval_final | ( | PG_FUNCTION_ARGS | ) |
Definition at line 622 of file orderedsetaggs.c.
References fb(), interval_lerp(), and percentile_cont_final_common().
| Datum percentile_cont_interval_multi_final | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1019 of file orderedsetaggs.c.
References fb(), interval_lerp(), and percentile_cont_multi_final_common().
|
static |
Definition at line 848 of file orderedsetaggs.c.
References AGG_CONTEXT_AGGREGATE, AggCheckCallContext(), ARR_DIMS, ARR_LBOUND, ARR_NDIM, Assert, construct_empty_array(), construct_md_array(), deconstruct_array_builtin(), elog, ERROR, fb(), pct_info::first_row, i, idx(), pct_info::idx, palloc(), PG_ARGISNULL, PG_GETARG_ARRAYTYPE_P, PG_GETARG_POINTER, PG_RETURN_NULL, PG_RETURN_POINTER, pct_info::proportion, pct_info::second_row, setup_pct_info(), tuplesort_getdatum(), tuplesort_performsort(), tuplesort_rescan(), and tuplesort_skiptuples().
Referenced by percentile_cont_float8_multi_final(), and percentile_cont_interval_multi_final().
| Datum percentile_disc_final | ( | PG_FUNCTION_ARGS | ) |
Definition at line 427 of file orderedsetaggs.c.
References AGG_CONTEXT_AGGREGATE, AggCheckCallContext(), Assert, elog, ereport, errcode(), errmsg(), ERROR, fb(), PG_ARGISNULL, PG_GETARG_FLOAT8, PG_GETARG_POINTER, PG_RETURN_DATUM, PG_RETURN_NULL, tuplesort_getdatum(), tuplesort_performsort(), tuplesort_rescan(), tuplesort_skiptuples(), and val.
| Datum percentile_disc_multi_final | ( | PG_FUNCTION_ARGS | ) |
Definition at line 731 of file orderedsetaggs.c.
References AGG_CONTEXT_AGGREGATE, AggCheckCallContext(), ARR_DIMS, ARR_LBOUND, ARR_NDIM, Assert, construct_empty_array(), construct_md_array(), deconstruct_array_builtin(), elog, ERROR, fb(), pct_info::first_row, i, idx(), pct_info::idx, palloc(), PG_ARGISNULL, PG_GETARG_ARRAYTYPE_P, PG_GETARG_POINTER, PG_RETURN_NULL, PG_RETURN_POINTER, setup_pct_info(), tuplesort_getdatum(), tuplesort_performsort(), tuplesort_rescan(), tuplesort_skiptuples(), and val.
|
static |
Definition at line 662 of file orderedsetaggs.c.
References DatumGetFloat8(), ereport, errcode(), errmsg(), ERROR, fb(), pct_info::first_row, i, pct_info::idx, Max, palloc(), pct_info_cmp(), pct_info::proportion, qsort, and pct_info::second_row.
Referenced by percentile_cont_multi_final_common(), and percentile_disc_multi_final().