-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Printer for the plan, ie: EXPLAIN #2075
base: master
Are you sure you want to change the base?
Conversation
be18b08
to
81adebc
Compare
1ca3567
to
75e1cbd
Compare
305e0bc
to
33c8978
Compare
33c8978
to
f8700bc
Compare
1aeeae9
to
a9569f6
Compare
a9569f6
to
c592668
Compare
c592668
to
2f53089
Compare
2f53089
to
692ebe2
Compare
4cc69d6
to
d954c44
Compare
419de9e
to
3681c2c
Compare
Is this achieving the same thing as #2065 ? |
No, this is for print the |
* Improve output of plan * Fix print of alias and the output of joins * Allow the test utils of the plan to be used elsewhere * Use the arrow only for nodes, make timing optional * Apply new clippy hints and remove old test logic
45e5e10
to
8ede66f
Compare
I'm removing myself as a reviewer, because there is no longer any review for the files that I am a CODEOWNER of. |
@@ -364,6 +364,7 @@ pub(crate) mod tests { | |||
let result = run_for_testing(&db, sql)?; | |||
assert_eq!(result, vec![product![5u64]], "Inventory"); | |||
|
|||
// TODO: This should return product![2u64] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO: This should return product![2u64] |
Aggregates are applied before LIMIT.
Index Join: Rhs on b | ||
-> Index Join: Rhs on q | ||
-> Index Join: Rhs on p | ||
-> Index Scan using Index id 0 on u | ||
Index Cond: (u.identity = U64(5)) | ||
Inner Unique: true | ||
Join Cond: (u.entity_id = p.entity_id) | ||
Inner Unique: false | ||
Join Cond: (p.chunk = q.chunk) | ||
Inner Unique: true | ||
Join Cond: (q.entity_id = b.entity_id) | ||
Output: b.entity_id, b.misc"#]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I would like this to look something like:
Index Join
Output: (b: RowId (table: b))
Index: <index name> (table: b, unique: true)
Index Cond: q.entity_id
-> Index Join
Output: (q: RowId (table: b))
Index: <index name> (table: l, unique: false)
Index Cond: p.chunk
-> Index Join
Output: (p: RowId (table: l))
Index: <index name> (table: l, unique: true)
Index Cond: u.entity_id
-> Index Scan
Output: (u: RowId (table: u))
Index Cond: (identity = U64(5))
or
Index Join using <index name> on b
Output: (b: RowId (table: b))
Index Cond: q.entity_id
-> Index Join using <index name> on l
Output: (q: RowId (table: l))
Index Cond: p.chunk
-> Index Join using <index name> on l
Output: (p: RowId (table: l))
Index Cond: u.entity_id
-> Index Scan using <index name> on u
Output: (u: RowId (table: u))
Index Cond: (identity = U64(5))
I.e., I want to know the index id or the index name that is being probed in an index join. I also want to know if an operator is returning row pointers vs product values.
Hash Join | ||
-> Hash Join | ||
-> Hash Join | ||
-> Hash Join | ||
-> Seq Scan on m | ||
-> Seq Scan on n | ||
Inner Unique: false | ||
Join Cond: (m.manager = n.manager) | ||
-> Seq Scan on u | ||
Inner Unique: false | ||
Join Cond: (n.employee = u.employee) | ||
-> Seq Scan on v | ||
Inner Unique: false | ||
Join Cond: (u.project = v.project) | ||
-> Seq Scan on p | ||
Inner Unique: false | ||
Join Cond: (p.id = v.project) | ||
Filter: (m.employee = U64(5) AND v.employee = U64(5)) | ||
Output: p.id, p.name"#]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct. This looks like the plan before it is optimized. Most of these hash joins should be index joins and the sequential scans should be index scans or index probes.
Limit: 5 | ||
-> Seq Scan on t | ||
Output: t.x, t.y"#]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Limit: 5 | |
-> Seq Scan on t | |
Output: t.x, t.y"#]], | |
Limit: 5 | |
Output: (t: RowId (table: t)) | |
-> Seq Scan on t"#]], |
I know this is a deviation from pg, but I find it much easier to read if the output comes before the input. In particular for left deep joins.
Description of Changes
Incipient support for
EXPLAIN
with close plan output as inPostgres
(but not yet conformant).It has the extra capability of showing extra metadata about the schema & indexes, useful for testing & debugging.
Example:
Closes #2058.
API and ABI breaking changes
None
Expected complexity level and risk
1
Testing