mirror of https://github.com/citusdata/citus.git
Use 'Chunk Groups' in EXPLAIN ANALYZE of columnar scan
parent
1d311b0709
commit
0a9fd91d8f
|
@ -490,9 +490,9 @@ ColumnarScan_ExplainCustomScan(CustomScanState *node, List *ancestors,
|
|||
|
||||
if (scanDesc != NULL)
|
||||
{
|
||||
int64 chunksFiltered = ColumnarGetChunksFiltered(scanDesc);
|
||||
ExplainPropertyInteger("Columnar Chunks Removed by Filter", NULL,
|
||||
chunksFiltered, es);
|
||||
int64 chunkGroupsFiltered = ColumnarGetChunkGroupsFiltered(scanDesc);
|
||||
ExplainPropertyInteger("Columnar Chunk Groups Removed by Filter", NULL,
|
||||
chunkGroupsFiltered, es);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ static StripeBuffers * LoadFilteredStripeBuffers(Relation relation,
|
|||
TupleDesc tupleDescriptor,
|
||||
List *projectedColumnList,
|
||||
List *whereClauseList,
|
||||
int64 *chunksFiltered);
|
||||
int64 *chunkGroupsFiltered);
|
||||
static void ReadStripeNextRow(StripeBuffers *stripeBuffers, List *projectedColumnList,
|
||||
uint64 chunkIndex, uint64 chunkRowIndex,
|
||||
ChunkData *chunkData, Datum *columnValues,
|
||||
|
@ -56,7 +56,7 @@ static ColumnBuffers * LoadColumnBuffers(Relation relation,
|
|||
Form_pg_attribute attributeForm);
|
||||
static bool * SelectedChunkMask(StripeSkipList *stripeSkipList,
|
||||
List *projectedColumnList, List *whereClauseList,
|
||||
int64 *chunksFiltered);
|
||||
int64 *chunkGroupsFiltered);
|
||||
static List * BuildRestrictInfoList(List *whereClauseList);
|
||||
static Node * BuildBaseConstraint(Var *variable);
|
||||
static OpExpr * MakeOpExpression(Var *variable, int16 strategyNumber);
|
||||
|
@ -106,7 +106,7 @@ ColumnarBeginRead(Relation relation, TupleDesc tupleDescriptor,
|
|||
readState->stripeBuffers = NULL;
|
||||
readState->readStripeCount = 0;
|
||||
readState->stripeReadRowCount = 0;
|
||||
readState->chunksFiltered = 0;
|
||||
readState->chunkGroupsFiltered = 0;
|
||||
readState->tupleDescriptor = tupleDescriptor;
|
||||
readState->stripeReadContext = stripeReadContext;
|
||||
readState->chunkData = NULL;
|
||||
|
@ -158,7 +158,7 @@ ColumnarReadNextRow(TableReadState *readState, Datum *columnValues, bool *column
|
|||
readState->
|
||||
whereClauseList,
|
||||
&readState->
|
||||
chunksFiltered);
|
||||
chunkGroupsFiltered);
|
||||
readState->readStripeCount++;
|
||||
readState->currentStripeMetadata = stripeMetadata;
|
||||
|
||||
|
@ -327,7 +327,7 @@ ColumnarTableRowCount(Relation relation)
|
|||
static StripeBuffers *
|
||||
LoadFilteredStripeBuffers(Relation relation, StripeMetadata *stripeMetadata,
|
||||
TupleDesc tupleDescriptor, List *projectedColumnList,
|
||||
List *whereClauseList, int64 *chunksFiltered)
|
||||
List *whereClauseList, int64 *chunkGroupsFiltered)
|
||||
{
|
||||
uint32 columnIndex = 0;
|
||||
uint32 columnCount = tupleDescriptor->natts;
|
||||
|
@ -340,7 +340,7 @@ LoadFilteredStripeBuffers(Relation relation, StripeMetadata *stripeMetadata,
|
|||
stripeMetadata->chunkCount);
|
||||
|
||||
bool *selectedChunkMask = SelectedChunkMask(stripeSkipList, projectedColumnList,
|
||||
whereClauseList, chunksFiltered);
|
||||
whereClauseList, chunkGroupsFiltered);
|
||||
|
||||
StripeSkipList *selectedChunkSkipList =
|
||||
SelectedChunkSkipList(stripeSkipList, projectedColumnMask,
|
||||
|
@ -479,7 +479,7 @@ LoadColumnBuffers(Relation relation, ColumnChunkSkipNode *chunkSkipNodeArray,
|
|||
*/
|
||||
static bool *
|
||||
SelectedChunkMask(StripeSkipList *stripeSkipList, List *projectedColumnList,
|
||||
List *whereClauseList, int64 *chunksFiltered)
|
||||
List *whereClauseList, int64 *chunkGroupsFiltered)
|
||||
{
|
||||
ListCell *columnCell = NULL;
|
||||
uint32 chunkIndex = 0;
|
||||
|
@ -532,7 +532,7 @@ SelectedChunkMask(StripeSkipList *stripeSkipList, List *projectedColumnList,
|
|||
if (predicateRefuted && selectedChunkMask[chunkIndex])
|
||||
{
|
||||
selectedChunkMask[chunkIndex] = false;
|
||||
*chunksFiltered += 1;
|
||||
*chunkGroupsFiltered += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1158,7 +1158,7 @@ columnar_tableam_finish()
|
|||
* Get the number of chunks filtered out during the given scan.
|
||||
*/
|
||||
int64
|
||||
ColumnarGetChunksFiltered(TableScanDesc scanDesc)
|
||||
ColumnarGetChunkGroupsFiltered(TableScanDesc scanDesc)
|
||||
{
|
||||
ColumnarScanDesc columnarScanDesc = (ColumnarScanDesc) scanDesc;
|
||||
TableReadState *readState = columnarScanDesc->cs_readState;
|
||||
|
@ -1166,7 +1166,7 @@ ColumnarGetChunksFiltered(TableScanDesc scanDesc)
|
|||
/* readState is initialized lazily */
|
||||
if (readState != NULL)
|
||||
{
|
||||
return readState->chunksFiltered;
|
||||
return readState->chunkGroupsFiltered;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -232,7 +232,7 @@ typedef struct TableReadState
|
|||
StripeBuffers *stripeBuffers;
|
||||
uint32 readStripeCount;
|
||||
uint64 stripeReadRowCount;
|
||||
int64 chunksFiltered;
|
||||
int64 chunkGroupsFiltered;
|
||||
ChunkData *chunkData;
|
||||
int32 deserializedChunkIndex;
|
||||
} TableReadState;
|
||||
|
|
|
@ -18,7 +18,7 @@ extern TableScanDesc columnar_beginscan_extended(Relation relation, Snapshot sna
|
|||
ParallelTableScanDesc parallel_scan,
|
||||
uint32 flags, Bitmapset *attr_needed,
|
||||
List *scanQual);
|
||||
extern int64 ColumnarGetChunksFiltered(TableScanDesc scanDesc);
|
||||
extern int64 ColumnarGetChunkGroupsFiltered(TableScanDesc scanDesc);
|
||||
extern bool IsColumnarTableAmTable(Oid relationId);
|
||||
extern TableDDLCommand * ColumnarGetTableOptionsDDL(Oid relationId);
|
||||
extern char * GetShardedTableDDLCommandColumnar(uint64 shardId, void *context);
|
||||
|
|
|
@ -127,7 +127,7 @@ EXPLAIN (analyze on, costs off, timing off, summary off)
|
|||
Custom Scan (ColumnarScan) on simple_chunk_filtering (actual rows=111111 loops=1)
|
||||
Filter: (i > 123456)
|
||||
Rows Removed by Filter: 3457
|
||||
Columnar Chunks Removed by Filter: 12
|
||||
Columnar Chunk Groups Removed by Filter: 12
|
||||
(4 rows)
|
||||
|
||||
SET columnar.enable_qual_pushdown = false;
|
||||
|
@ -138,7 +138,7 @@ EXPLAIN (analyze on, costs off, timing off, summary off)
|
|||
Custom Scan (ColumnarScan) on simple_chunk_filtering (actual rows=111111 loops=1)
|
||||
Filter: (i > 123456)
|
||||
Rows Removed by Filter: 123457
|
||||
Columnar Chunks Removed by Filter: 0
|
||||
Columnar Chunk Groups Removed by Filter: 0
|
||||
(4 rows)
|
||||
|
||||
SET columnar.enable_qual_pushdown TO DEFAULT;
|
||||
|
@ -153,7 +153,7 @@ EXPLAIN (analyze on, costs off, timing off, summary off)
|
|||
Custom Scan (ColumnarScan) on simple_chunk_filtering (actual rows=20000 loops=1)
|
||||
Filter: (i > 180000)
|
||||
Rows Removed by Filter: 1
|
||||
Columnar Chunks Removed by Filter: 18
|
||||
Columnar Chunk Groups Removed by Filter: 18
|
||||
(4 rows)
|
||||
|
||||
DROP TABLE simple_chunk_filtering;
|
||||
|
@ -167,7 +167,7 @@ EXPLAIN (analyze on, costs off, timing off, summary off)
|
|||
-> Custom Scan (ColumnarScan) on multi_column_chunk_filtering (actual rows=184567 loops=1)
|
||||
Filter: (a > 50000)
|
||||
Rows Removed by Filter: 1
|
||||
Columnar Chunks Removed by Filter: 5
|
||||
Columnar Chunk Groups Removed by Filter: 5
|
||||
(5 rows)
|
||||
|
||||
EXPLAIN (analyze on, costs off, timing off, summary off)
|
||||
|
@ -178,7 +178,7 @@ EXPLAIN (analyze on, costs off, timing off, summary off)
|
|||
-> Custom Scan (ColumnarScan) on multi_column_chunk_filtering (actual rows=184567 loops=1)
|
||||
Filter: ((a > 50000) AND (b > 50000))
|
||||
Rows Removed by Filter: 1
|
||||
Columnar Chunks Removed by Filter: 5
|
||||
Columnar Chunk Groups Removed by Filter: 5
|
||||
(5 rows)
|
||||
|
||||
DROP TABLE multi_column_chunk_filtering;
|
||||
|
|
Loading…
Reference in New Issue