PostgreSQL Source Code git master
|
#include "postgres.h"
#include "access/brin_internal.h"
#include "access/brin_tuple.h"
#include "access/genam.h"
#include "access/skey.h"
#include "catalog/pg_amop.h"
#include "catalog/pg_type.h"
#include "utils/datum.h"
#include "utils/fmgrprotos.h"
#include "utils/lsyscache.h"
#include "utils/rel.h"
#include "utils/syscache.h"
Go to the source code of this file.
Data Structures | |
struct | InclusionOpaque |
Macros | |
#define | INCLUSION_MAX_PROCNUMS 4 /* maximum support procs we need */ |
#define | PROCNUM_MERGE 11 /* required */ |
#define | PROCNUM_MERGEABLE 12 /* optional */ |
#define | PROCNUM_CONTAINS 13 /* optional */ |
#define | PROCNUM_EMPTY 14 /* optional */ |
#define | PROCNUM_BASE 11 |
#define | INCLUSION_UNION 0 |
#define | INCLUSION_UNMERGEABLE 1 |
#define | INCLUSION_CONTAINS_EMPTY 2 |
Typedefs | |
typedef struct InclusionOpaque | InclusionOpaque |
Functions | |
static FmgrInfo * | inclusion_get_procinfo (BrinDesc *bdesc, uint16 attno, uint16 procnum, bool missing_ok) |
static FmgrInfo * | inclusion_get_strategy_procinfo (BrinDesc *bdesc, uint16 attno, Oid subtype, uint16 strategynum) |
Datum | brin_inclusion_opcinfo (PG_FUNCTION_ARGS) |
Datum | brin_inclusion_add_value (PG_FUNCTION_ARGS) |
Datum | brin_inclusion_consistent (PG_FUNCTION_ARGS) |
Datum | brin_inclusion_union (PG_FUNCTION_ARGS) |
#define INCLUSION_CONTAINS_EMPTY 2 |
Definition at line 73 of file brin_inclusion.c.
#define INCLUSION_MAX_PROCNUMS 4 /* maximum support procs we need */ |
Definition at line 46 of file brin_inclusion.c.
#define INCLUSION_UNION 0 |
Definition at line 71 of file brin_inclusion.c.
#define INCLUSION_UNMERGEABLE 1 |
Definition at line 72 of file brin_inclusion.c.
#define PROCNUM_BASE 11 |
Definition at line 57 of file brin_inclusion.c.
#define PROCNUM_CONTAINS 13 /* optional */ |
Definition at line 49 of file brin_inclusion.c.
#define PROCNUM_EMPTY 14 /* optional */ |
Definition at line 50 of file brin_inclusion.c.
#define PROCNUM_MERGE 11 /* required */ |
Definition at line 47 of file brin_inclusion.c.
#define PROCNUM_MERGEABLE 12 /* optional */ |
Definition at line 48 of file brin_inclusion.c.
typedef struct InclusionOpaque InclusionOpaque |
Datum brin_inclusion_add_value | ( | PG_FUNCTION_ARGS | ) |
Definition at line 138 of file brin_inclusion.c.
References Assert(), CompactAttribute::attbyval, CompactAttribute::attlen, BrinDesc::bd_tupdesc, BoolGetDatum(), BrinValues::bv_allnulls, BrinValues::bv_attno, BrinValues::bv_values, datumCopy(), DatumGetBool(), DatumGetPointer(), FunctionCall1Coll(), FunctionCall2Coll(), INCLUSION_CONTAINS_EMPTY, inclusion_get_procinfo(), INCLUSION_UNION, INCLUSION_UNMERGEABLE, newval, pfree(), PG_GET_COLLATION, PG_GETARG_BOOL, PG_GETARG_DATUM, PG_GETARG_POINTER, PG_RETURN_BOOL, PG_USED_FOR_ASSERTS_ONLY, PROCNUM_CONTAINS, PROCNUM_EMPTY, PROCNUM_MERGE, PROCNUM_MERGEABLE, and TupleDescCompactAttr().
Datum brin_inclusion_consistent | ( | PG_FUNCTION_ARGS | ) |
Definition at line 250 of file brin_inclusion.c.
References Assert(), BrinValues::bv_allnulls, BrinValues::bv_values, DatumGetBool(), elog, ERROR, FunctionCall2Coll(), INCLUSION_CONTAINS_EMPTY, inclusion_get_strategy_procinfo(), INCLUSION_UNION, INCLUSION_UNMERGEABLE, sort-test::key, PG_GET_COLLATION, PG_GETARG_POINTER, PG_NARGS, PG_RETURN_BOOL, PG_RETURN_DATUM, RTAboveStrategyNumber, RTAdjacentStrategyNumber, RTBelowStrategyNumber, RTContainedByStrategyNumber, RTContainsElemStrategyNumber, RTContainsStrategyNumber, RTEqualStrategyNumber, RTGreaterEqualStrategyNumber, RTGreaterStrategyNumber, RTLeftStrategyNumber, RTLessEqualStrategyNumber, RTLessStrategyNumber, RTOverAboveStrategyNumber, RTOverBelowStrategyNumber, RTOverlapStrategyNumber, RTOverLeftStrategyNumber, RTOverRightStrategyNumber, RTRightStrategyNumber, RTSameStrategyNumber, RTSubEqualStrategyNumber, RTSubStrategyNumber, RTSuperEqualStrategyNumber, and RTSuperStrategyNumber.
Datum brin_inclusion_opcinfo | ( | PG_FUNCTION_ARGS | ) |
Definition at line 94 of file brin_inclusion.c.
References INCLUSION_CONTAINS_EMPTY, INCLUSION_UNION, INCLUSION_UNMERGEABLE, lookup_type_cache(), MAXALIGN, BrinOpcInfo::oi_nstored, BrinOpcInfo::oi_opaque, BrinOpcInfo::oi_regular_nulls, BrinOpcInfo::oi_typcache, palloc0(), PG_GETARG_OID, PG_RETURN_POINTER, and SizeofBrinOpcInfo.
Datum brin_inclusion_union | ( | PG_FUNCTION_ARGS | ) |
Definition at line 474 of file brin_inclusion.c.
References Assert(), CompactAttribute::attbyval, CompactAttribute::attlen, BrinDesc::bd_tupdesc, BoolGetDatum(), BrinValues::bv_allnulls, BrinValues::bv_attno, BrinValues::bv_values, datumCopy(), DatumGetBool(), DatumGetPointer(), FunctionCall2Coll(), INCLUSION_CONTAINS_EMPTY, inclusion_get_procinfo(), INCLUSION_UNION, INCLUSION_UNMERGEABLE, pfree(), PG_GET_COLLATION, PG_GETARG_POINTER, PG_RETURN_VOID, PROCNUM_MERGE, PROCNUM_MERGEABLE, and TupleDescCompactAttr().
|
static |
Definition at line 544 of file brin_inclusion.c.
References BrinDesc::bd_context, BrinDesc::bd_index, BrinDesc::bd_info, ereport, errcode(), errdetail_internal(), errmsg_internal(), ERROR, InclusionOpaque::extra_proc_missing, InclusionOpaque::extra_procinfos, fmgr_info_copy(), FmgrInfo::fn_oid, if(), index_getprocid(), index_getprocinfo(), InvalidOid, BrinOpcInfo::oi_opaque, PROCNUM_BASE, and RegProcedureIsValid.
Referenced by brin_inclusion_add_value(), and brin_inclusion_union().
|
static |
Definition at line 608 of file brin_inclusion.c.
References Assert(), BrinDesc::bd_context, BrinDesc::bd_index, BrinDesc::bd_info, BrinDesc::bd_tupdesc, InclusionOpaque::cached_subtype, DatumGetObjectId(), elog, ERROR, fmgr_info_cxt(), FmgrInfo::fn_oid, get_opcode(), HeapTupleIsValid, i, if(), Int16GetDatum(), InvalidOid, ObjectIdGetDatum(), BrinOpcInfo::oi_opaque, oprid(), RelationData::rd_opfamily, RegProcedureIsValid, ReleaseSysCache(), RTMaxStrategyNumber, SearchSysCache4(), InclusionOpaque::strategy_procinfos, SysCacheGetAttrNotNull(), and TupleDescAttr().
Referenced by brin_inclusion_consistent().