forked from VastlyBlank/5300-Ocelot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEvalPlan.h
executable file
·39 lines (29 loc) · 1.05 KB
/
EvalPlan.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#include "storage_engine.h"
typedef std::pair<DbRelation*,Handles*> EvalPipeline;
class EvalPlan {
public:
enum PlanType {
ProjectAll,
Project,
Select,
TableScan
};
EvalPlan(PlanType type, EvalPlan *relation); // use for ProjectAll, e.g., EvalPlan(EvalPlan::ProjectAll, table);
EvalPlan(ColumnNames *projection, EvalPlan *relation); // use for Project
EvalPlan(ValueDict* conjunction, EvalPlan *relation); // use for Select
EvalPlan(DbRelation &table); // use for TableScan
EvalPlan(const EvalPlan *other); // use for copying
virtual ~EvalPlan();
// Attempt to get the best equivalent evaluation plan
EvalPlan *optimize();
// Evaluate the plan: evaluate gets values, pipeline gets handles
ValueDicts *evaluate();
EvalPipeline pipeline();
protected:
PlanType type;
EvalPlan *relation; // for everything except TableScan
ColumnNames *projection; // for Project
ValueDict *select_conjunction; // for Select
DbRelation &table; // for TableScan
};