Skip to content
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

Parse global info lines with depth 1 #623

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/services/__tests__/from-text/39-expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Plan": {
"Node Type": "Nested Loop Join",
"Plans": [{
"Node Type": "Bitmap Heap Scan",
"Plans": [{
"Node Type": "Bitmap Index Scan"
}]
}]
},
"Execution Time": 9762.684
}
5 changes: 5 additions & 0 deletions src/services/__tests__/from-text/39-plan
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Nested Loop Left Join (cost=11.95..28.52 rows=5 width=157)
-> Bitmap Heap Scan on public.rel_users_exams (cost=11.80..20.27 rows=5 width=52)
Output: rel_users_exams.user_username, rel_users_exams.exam_id
-> Bitmap Index Scan on rel_users_exams_pkey (cost=0.00..11.80 rows=5 width=0)
Execution Time: 9762.684 ms
5 changes: 4 additions & 1 deletion src/services/plan-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,10 @@ export class PlanService {
//const prefix = extraMatches[1]

// Remove elements from elementsAtDepth for deeper levels
_.remove(elementsAtDepth, (e) => e[0] >= depth)
// Depth == 1 is a special case here. Global info (for example
// execution|planning time) have a depth of 1 but shouldn't be removed
// in case first node was at depth 0.
_.remove(elementsAtDepth, (e) => e[0] >= depth || depth == 1)

let element
if (elementsAtDepth.length === 0) {
Expand Down
Loading