mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +03:00
pgindent run for 9.5
This commit is contained in:
@ -31,9 +31,9 @@
|
||||
typedef struct
|
||||
{
|
||||
BlockSamplerData bs;
|
||||
uint32 seed; /* random seed */
|
||||
uint32 seed; /* random seed */
|
||||
BlockNumber nblocks; /* number of block in relation */
|
||||
int samplesize; /* number of blocks to return */
|
||||
int samplesize; /* number of blocks to return */
|
||||
OffsetNumber lt; /* last tuple returned from current block */
|
||||
} SystemSamplerData;
|
||||
|
||||
@ -44,11 +44,11 @@ typedef struct
|
||||
Datum
|
||||
tsm_system_init(PG_FUNCTION_ARGS)
|
||||
{
|
||||
TableSampleDesc *tsdesc = (TableSampleDesc *) PG_GETARG_POINTER(0);
|
||||
uint32 seed = PG_GETARG_UINT32(1);
|
||||
float4 percent = PG_ARGISNULL(2) ? -1 : PG_GETARG_FLOAT4(2);
|
||||
HeapScanDesc scan = tsdesc->heapScan;
|
||||
SystemSamplerData *sampler;
|
||||
TableSampleDesc *tsdesc = (TableSampleDesc *) PG_GETARG_POINTER(0);
|
||||
uint32 seed = PG_GETARG_UINT32(1);
|
||||
float4 percent = PG_ARGISNULL(2) ? -1 : PG_GETARG_FLOAT4(2);
|
||||
HeapScanDesc scan = tsdesc->heapScan;
|
||||
SystemSamplerData *sampler;
|
||||
|
||||
if (percent < 0 || percent > 100)
|
||||
ereport(ERROR,
|
||||
@ -80,9 +80,9 @@ tsm_system_init(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
tsm_system_nextblock(PG_FUNCTION_ARGS)
|
||||
{
|
||||
TableSampleDesc *tsdesc = (TableSampleDesc *) PG_GETARG_POINTER(0);
|
||||
SystemSamplerData *sampler = (SystemSamplerData *) tsdesc->tsmdata;
|
||||
BlockNumber blockno;
|
||||
TableSampleDesc *tsdesc = (TableSampleDesc *) PG_GETARG_POINTER(0);
|
||||
SystemSamplerData *sampler = (SystemSamplerData *) tsdesc->tsmdata;
|
||||
BlockNumber blockno;
|
||||
|
||||
if (!BlockSampler_HasMore(&sampler->bs))
|
||||
PG_RETURN_UINT32(InvalidBlockNumber);
|
||||
@ -99,10 +99,10 @@ tsm_system_nextblock(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
tsm_system_nexttuple(PG_FUNCTION_ARGS)
|
||||
{
|
||||
TableSampleDesc *tsdesc = (TableSampleDesc *) PG_GETARG_POINTER(0);
|
||||
OffsetNumber maxoffset = PG_GETARG_UINT16(2);
|
||||
SystemSamplerData *sampler = (SystemSamplerData *) tsdesc->tsmdata;
|
||||
OffsetNumber tupoffset = sampler->lt;
|
||||
TableSampleDesc *tsdesc = (TableSampleDesc *) PG_GETARG_POINTER(0);
|
||||
OffsetNumber maxoffset = PG_GETARG_UINT16(2);
|
||||
SystemSamplerData *sampler = (SystemSamplerData *) tsdesc->tsmdata;
|
||||
OffsetNumber tupoffset = sampler->lt;
|
||||
|
||||
if (tupoffset == InvalidOffsetNumber)
|
||||
tupoffset = FirstOffsetNumber;
|
||||
@ -136,8 +136,8 @@ tsm_system_end(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
tsm_system_reset(PG_FUNCTION_ARGS)
|
||||
{
|
||||
TableSampleDesc *tsdesc = (TableSampleDesc *) PG_GETARG_POINTER(0);
|
||||
SystemSamplerData *sampler = (SystemSamplerData *) tsdesc->tsmdata;
|
||||
TableSampleDesc *tsdesc = (TableSampleDesc *) PG_GETARG_POINTER(0);
|
||||
SystemSamplerData *sampler = (SystemSamplerData *) tsdesc->tsmdata;
|
||||
|
||||
sampler->lt = InvalidOffsetNumber;
|
||||
BlockSampler_Init(&sampler->bs, sampler->nblocks, sampler->samplesize,
|
||||
@ -152,14 +152,14 @@ tsm_system_reset(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
tsm_system_cost(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PlannerInfo *root = (PlannerInfo *) PG_GETARG_POINTER(0);
|
||||
Path *path = (Path *) PG_GETARG_POINTER(1);
|
||||
RelOptInfo *baserel = (RelOptInfo *) PG_GETARG_POINTER(2);
|
||||
List *args = (List *) PG_GETARG_POINTER(3);
|
||||
BlockNumber *pages = (BlockNumber *) PG_GETARG_POINTER(4);
|
||||
double *tuples = (double *) PG_GETARG_POINTER(5);
|
||||
Node *pctnode;
|
||||
float4 samplesize;
|
||||
PlannerInfo *root = (PlannerInfo *) PG_GETARG_POINTER(0);
|
||||
Path *path = (Path *) PG_GETARG_POINTER(1);
|
||||
RelOptInfo *baserel = (RelOptInfo *) PG_GETARG_POINTER(2);
|
||||
List *args = (List *) PG_GETARG_POINTER(3);
|
||||
BlockNumber *pages = (BlockNumber *) PG_GETARG_POINTER(4);
|
||||
double *tuples = (double *) PG_GETARG_POINTER(5);
|
||||
Node *pctnode;
|
||||
float4 samplesize;
|
||||
|
||||
pctnode = linitial(args);
|
||||
pctnode = estimate_expression_value(root, pctnode);
|
||||
|
Reference in New Issue
Block a user