Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
validator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Foxido
validator
Commits
e714f59e
Commit
e714f59e
authored
8 months ago
by
Foxido
Browse files
Options
Downloads
Patches
Plain Diff
add costs to node dump
parent
9eada4e3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
inc/operators.h
+4
-4
4 additions, 4 deletions
inc/operators.h
src/operators.cpp
+7
-7
7 additions, 7 deletions
src/operators.cpp
with
11 additions
and
11 deletions
inc/operators.h
+
4
−
4
View file @
e714f59e
...
...
@@ -33,7 +33,7 @@ struct std::hash<ColumnTag> {
class
Operator
{
public:
std
::
string
format
()
const
{
return
inner_format
(
0
);
}
std
::
string
format
(
const
TaskState
&
state
)
const
{
return
inner_format
(
state
,
0
);
}
virtual
void
update_eqclasses
(
const
TaskState
&
task_state
,
CHM
&
eq_classes
)
const
=
0
;
...
...
@@ -47,7 +47,7 @@ class Operator {
virtual
double
cardinality
(
const
TaskState
&
task_state
)
const
=
0
;
virtual
~
Operator
()
=
default
;
virtual
std
::
string
inner_format
(
size_t
padding
)
const
=
0
;
virtual
std
::
string
inner_format
(
const
TaskState
&
state
,
size_t
padding
)
const
=
0
;
};
class
JoinOperator
:
Operator
{
...
...
@@ -66,7 +66,7 @@ class JoinOperator : Operator {
std
::
set
<
size_t
>
get_known_tables
()
const
override
;
std
::
string
inner_format
(
size_t
padding
)
const
override
;
std
::
string
inner_format
(
const
TaskState
&
state
,
size_t
padding
)
const
override
;
private:
Operator
*
left_tree_
;
...
...
@@ -89,7 +89,7 @@ class ScanOperator : Operator {
std
::
set
<
size_t
>
get_known_tables
()
const
override
;
std
::
string
inner_format
(
size_t
padding
)
const
override
;
std
::
string
inner_format
(
const
TaskState
&
state
,
size_t
padding
)
const
override
;
public:
size_t
table_
;
...
...
This diff is collapsed.
Click to expand it.
src/operators.cpp
+
7
−
7
View file @
e714f59e
...
...
@@ -28,12 +28,12 @@ ColumnTag::ColumnTag(const char *inp) {
col
=
inp
[
1
];
// Next character after dot
}
std
::
string
ScanOperator
::
inner_format
(
size_t
padding
)
const
{
std
::
string
ScanOperator
::
inner_format
(
const
TaskState
&
state
,
size_t
padding
)
const
{
std
::
string
res
;
std
::
string
padding_str
(
padding
,
' '
);
res
+=
fmt
::
format
(
"{}Scan Operator on table {}
\n
{}Constants: "
,
padding_str
,
table_
,
padding_str
);
res
+=
fmt
::
format
(
"{}Scan Operator on table {}
[cost = {}]
\n
{}Constants: "
,
padding_str
,
table_
,
cost
(
state
),
padding_str
);
for
(
auto
&
constant
:
constants_
)
{
res
+=
fmt
::
format
(
"{} "
,
constant
.
col
);
}
...
...
@@ -42,7 +42,7 @@ std::string ScanOperator::inner_format(size_t padding) const {
return
res
;
}
std
::
string
JoinOperator
::
inner_format
(
size_t
padding
)
const
{
std
::
string
JoinOperator
::
inner_format
(
const
TaskState
&
state
,
size_t
padding
)
const
{
std
::
string
padding_str
(
padding
,
' '
);
std
::
string
clause_list
=
""
;
...
...
@@ -52,9 +52,9 @@ std::string JoinOperator::inner_format(size_t padding) const {
clause
.
second
.
table
,
clause
.
second
.
col
);
}
return
fmt
::
format
(
"{}Join on {}
\n
{}{}"
,
padding_str
,
clause_list
,
left_tree_
->
inner_format
(
padding
+
1
),
right_tree_
->
inner_format
(
padding
+
1
));
return
fmt
::
format
(
"{}Join on {}
[cost = {}]
\n
{}{}"
,
padding_str
,
clause_list
,
cost
(
state
),
left_tree_
->
inner_format
(
state
,
padding
+
1
),
right_tree_
->
inner_format
(
state
,
padding
+
1
));
}
ScanOperator
::
ScanOperator
(
const
char
*
inp
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment