PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
tsmapi.h File Reference
#include "nodes/execnodes.h"
#include "nodes/relation.h"
Include dependency graph for tsmapi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  TsmRoutine


typedef void(* SampleScanGetSampleSize_function )(PlannerInfo *root, RelOptInfo *baserel, List *paramexprs, BlockNumber *pages, double *tuples)
typedef void(* InitSampleScan_function )(SampleScanState *node, int eflags)
typedef void(* BeginSampleScan_function )(SampleScanState *node, Datum *params, int nparams, uint32 seed)
typedef BlockNumber(* NextSampleBlock_function )(SampleScanState *node)
typedef OffsetNumber(* NextSampleTuple_function )(SampleScanState *node, BlockNumber blockno, OffsetNumber maxoffset)
typedef void(* EndSampleScan_function )(SampleScanState *node)
typedef struct TsmRoutine TsmRoutine


TsmRoutineGetTsmRoutine (Oid tsmhandler)

Typedef Documentation

typedef void(* BeginSampleScan_function)(SampleScanState *node, Datum *params, int nparams, uint32 seed)

Definition at line 32 of file tsmapi.h.

typedef void(* EndSampleScan_function)(SampleScanState *node)

Definition at line 43 of file tsmapi.h.

typedef void(* InitSampleScan_function)(SampleScanState *node, int eflags)

Definition at line 29 of file tsmapi.h.

typedef BlockNumber(* NextSampleBlock_function)(SampleScanState *node)

Definition at line 37 of file tsmapi.h.

typedef OffsetNumber(* NextSampleTuple_function)(SampleScanState *node, BlockNumber blockno, OffsetNumber maxoffset)

Definition at line 39 of file tsmapi.h.

typedef void(* SampleScanGetSampleSize_function)(PlannerInfo *root, RelOptInfo *baserel, List *paramexprs, BlockNumber *pages, double *tuples)

Definition at line 23 of file tsmapi.h.

Function Documentation

TsmRoutine* GetTsmRoutine ( Oid  tsmhandler)

Definition at line 27 of file tablesample.c.

References DatumGetPointer, elog, ERROR, IsA, NULL, OidFunctionCall1, and PointerGetDatum.

Referenced by cost_samplescan(), ExecInitSampleScan(), set_tablesample_rel_pathlist(), set_tablesample_rel_size(), and transformRangeTableSample().

28 {
29  Datum datum;
30  TsmRoutine *routine;
32  datum = OidFunctionCall1(tsmhandler, PointerGetDatum(NULL));
33  routine = (TsmRoutine *) DatumGetPointer(datum);
35  if (routine == NULL || !IsA(routine, TsmRoutine))
36  elog(ERROR, "tablesample handler function %u did not return a TsmRoutine struct",
37  tsmhandler);
39  return routine;
40 }
#define IsA(nodeptr, _type_)
Definition: nodes.h:560
#define PointerGetDatum(X)
Definition: postgres.h:562
#define ERROR
Definition: elog.h:43
#define OidFunctionCall1(functionId, arg1)
Definition: fmgr.h:622
uintptr_t Datum
Definition: postgres.h:372
#define NULL
Definition: c.h:229
#define DatumGetPointer(X)
Definition: postgres.h:555
#define elog
Definition: elog.h:219