[MDEV-13473] CONNECT BY: Does Oracle use depth-first or breadth-first traversal? Created: 2017-08-08 Updated: 2017-08-14 Resolved: 2017-08-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
A Followup to slack/zoom discussions:
Here's one way to check it: let's make a "logging function":
sample dataset:
Oracle won't allow stored function to do DML if its a SELECT, so make it INSERT...SELECT:
The query:
|
| Comments |
| Comment by Sergei Petrunia [ 2017-08-08 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Rows come in depth-first order, just as documentation says. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2017-08-08 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Let's examine "the log":
So it first started from team-red-freshman and went up all the way to the CEO.
This was a kind of back tracking where it went back down and looked if there Anyhow, note that it was all team-red so far (number end with *1). Now it switches to doing the same to team-blue:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2017-08-08 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
EXPLAIN:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by jametong [ 2017-08-14 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
As I tested the case with a 25k rows,the results is depth first.
|