Parallel query, sequence scan.

This commit is contained in:
TotaJ
2020-09-16 20:10:45 +08:00
parent 2fe5d2dc09
commit 5dfa9d8ed1
109 changed files with 6485 additions and 185 deletions

View File

@ -26,7 +26,7 @@
#include "executor/nodeExtensible.h"
#include "executor/nodeForeignscan.h"
#include "executor/nodeFunctionscan.h"
#include "executor/nodeGroup.h"
#include "executor/nodeGather.h"
#include "executor/nodeGroup.h"
#include "executor/nodeHash.h"
#include "executor/nodeHashjoin.h"
@ -131,6 +131,10 @@ void ExecReScanByType(PlanState* node)
ExecReScanSeqScan((SeqScanState*)node);
break;
case T_GatherState:
ExecReScanGather((GatherState*)node);
break;
case T_IndexScanState:
ExecReScanIndexScan((IndexScanState*)node);
break;
@ -492,8 +496,19 @@ bool ExecSupportsMarkRestore(NodeTag plantype)
*/
bool ExecSupportsBackwardScan(Plan* node)
{
if (node == NULL)
if (node == NULL) {
return false;
}
/*
* Parallel-aware nodes return a subset of the tuples in each worker,
* and in general we can't expect to have enough bookkeeping state to
* know which ones we returned in this worker as opposed to some other
* worker.
*/
if (node->parallel_aware) {
return false;
}
switch (nodeTag(node)) {
case T_BaseResult:
@ -527,6 +542,9 @@ bool ExecSupportsBackwardScan(Plan* node)
case T_CteScan:
return target_list_supports_backward_scan(node->targetlist);
case T_Gather:
return false;
case T_IndexScan:
return index_supports_backward_scan(((IndexScan*)node)->indexid) &&
target_list_supports_backward_scan(node->targetlist);