Skip to content
This repository was archived by the owner on Feb 20, 2023. It is now read-only.

Commit b7c3234

Browse files
authored
Skip recording the un-modeled LIMIT operating unit (#1437)
1 parent 711df3e commit b7c3234

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

script/model/data_class/grouped_op_unit_data.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,6 @@ def _pipeline_get_grouped_op_unit_data(filename, warmup_period, ee_sample_interv
150150
features = line[features_vector_index].split(';')
151151
concurrency = 0
152152
for idx, feature in enumerate(features):
153-
if feature == 'LIMIT':
154-
continue
155-
156153
opunit = OpUnit[feature]
157154
x_loc = [v[idx] if type(v) == list else v for v in x_multiple]
158155
if x_loc[data_info.instance.input_csv_index[ExecutionFeature.NUM_ROWS]] == 0:

src/include/self_driving/modeling/operating_unit_defs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ enum class ExecutionOperatingUnitType : uint32_t {
104104
OUTPUT,
105105
/**
106106
* LIMIT
107-
* num_rows:
108-
* cardinality:
107+
* We don't model LIMIT for now since there's no LIMIT operator. But we keep this OpUnit type since there's a LIMIT
108+
* translator (which requires an OpUnit type). We skip this OpUnit in the OperatingUnitRecorder.
109109
*/
110110
LIMIT,
111111

src/self_driving/modeling/operating_unit_recorder.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -611,13 +611,7 @@ void OperatingUnitRecorder::Visit(const planner::CSVScanPlanNode *plan) {
611611
}
612612

613613
void OperatingUnitRecorder::Visit(const planner::LimitPlanNode *plan) {
614-
VisitAbstractPlanNode(plan);
615-
RecordArithmeticFeatures(plan, 1);
616-
617-
// Copy outwards
618-
auto num_keys = plan->GetOutputSchema()->GetColumns().size();
619-
auto key_size = ComputeKeySizeOutputSchema(plan, &num_keys);
620-
AggregateFeatures(plan_feature_type_, key_size, num_keys, plan, 1, 1);
614+
// Limit plan does not have its own operator and we don't model Limit with our operating units. So we skip.
621615
}
622616

623617
void OperatingUnitRecorder::Visit(const planner::OrderByPlanNode *plan) {

0 commit comments

Comments
 (0)