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

Explain node summary #3

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

robozmey
Copy link
Contributor

@robozmey robozmey commented Oct 31, 2024

Dumps CdbExplain_NodeSummary struct in EXPLAIN ANALYZE

set gp_enable_explain_node_summary=on;

drop table if exists tt; create table tt (a int, b int) distributed randomly;

explain (analyze,verbose) insert into tt select * from generate_series(1,1000)a,generate_series(1,1000)b;

explain (analyze,verbose) select * from tt where a > b;

                                                                                                               QUERY PLAN                                                                                                                
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Gather Motion 3:1  (slice1; segments: 3)  (cost=0.00..431.00 rows=1 width=8) (actual time=33.612..78.159 rows=1000 loops=1)
   Output: a, b
   Node Summary:                  vmax       vsum       vcnt       imax
     ntuples:                     1000       1000          1         -1
     execmemused:                    0          0          0          0
     workmemused:                    0          0          0          0
     workmemwanted:                  0          0          0          0
     totalWorkfileCreated:           0          0          0          0
     peakMemBalance:             44592      44592          1         -1
     totalPartTableScanned:          0          0          0          0
     segindex0: -1
     ninst: 1
     StatInsts:
       (segN) pstype starttime counter firsttuple startup total ntuples nloops execmemused workmemused workmemwanted workfileCreated firststart peakMemBalance numPartScanned sortMethod sortSpaceType sortSpaceUsed bnotes enotes
       (seg-1) 241 0.00 0.03 0.08 1000.00 1.00 0 0 0 0 0 0 44592.00 0 0 0 0 0 0 0
   ->  Seq Scan on public.tt  (cost=0.00..431.00 rows=1 width=8) (actual time=2.512..77.640 rows=353 loops=1)
         Output: a, b
         Filter: (tt.a = 100)
         Node Summary:                  vmax       vsum       vcnt       imax
           ntuples:                      353       1000          3          0
           execmemused:                    0          0          0          0
           workmemused:                    0          0          0          0
           workmemwanted:                  0          0          0          0
           totalWorkfileCreated:           0          0          0          0
           peakMemBalance:             19072      57216          3          0
           totalPartTableScanned:          0          0          0          0
           segindex0: 0
           ninst: 3
           StatInsts:
             (segN) pstype starttime counter firsttuple startup total ntuples nloops execmemused workmemused workmemwanted workfileCreated firststart peakMemBalance numPartScanned sortMethod sortSpaceType sortSpaceUsed bnotes enotes
             (seg0) 211 0.00 0.00 0.08 353.00 1.00 0 0 0 0 0 0 19072.00 0 0 0 0 0 0 0
             (seg1) 211 0.00 0.00 0.03 330.00 1.00 0 0 0 0 0 0 19072.00 0 0 0 0 0 0 0
             (seg2) 211 0.00 0.00 0.05 317.00 1.00 0 0 0 0 0 0 19072.00 0 0 0 0 0 0 0
 Planning time: 4.514 ms
   (slice0)    Executor memory: 119K bytes.
   (slice1)    Executor memory: 27K bytes avg x 3 workers, 27K bytes max (seg0).
 Memory used:  128000kB
 Optimizer: Pivotal Optimizer (GPORCA)
 Execution time: 78.584 ms
(39 rows)

Here are some reminders before you submit the pull request

  • Add tests for the change
  • Document changes
  • Communicate in the mailing list if needed
  • Pass make installcheck
  • Review a PR in return to support the community

@robozmey robozmey marked this pull request as ready for review October 31, 2024 11:54
@leborchuk
Copy link
Contributor

All looks great, but there are 12 separate commits. Can you squash them into one? It would be useful for future readers (making commit history cleaner).

@robozmey robozmey force-pushed the explain-node-summary branch from 0ea0043 to d1f8171 Compare November 13, 2024 08:21
Dumps CdbExplain_NodeSummary struct in EXPLAIN ANALYZE

`set gp_enable_explain_node_summary=on;`

`drop table if exists tt; create table tt (a int, b int) distributed randomly;`

`explain (analyze,verbose) insert into tt select * from generate_series(1,1000)a,generate_series(1,1000)b;`

`explain (analyze,verbose) select * from tt where a > b;`

```
                                                                                                               QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Gather Motion 3:1  (slice1; segments: 3)  (cost=0.00..431.00 rows=1 width=8) (actual time=33.612..78.159 rows=1000 loops=1)
   Output: a, b
   Node Summary:                  vmax       vsum       vcnt       imax
     ntuples:                     1000       1000          1         -1
     execmemused:                    0          0          0          0
     workmemused:                    0          0          0          0
     workmemwanted:                  0          0          0          0
     totalWorkfileCreated:           0          0          0          0
     peakMemBalance:             44592      44592          1         -1
     totalPartTableScanned:          0          0          0          0
     segindex0: -1
     ninst: 1
     StatInsts:
       (segN) pstype starttime counter firsttuple startup total ntuples nloops execmemused workmemused workmemwanted workfileCreated firststart peakMemBalance numPartScanned sortMethod sortSpaceType sortSpaceUsed bnotes enotes
       (seg-1) 241 0.00 0.03 0.08 1000.00 1.00 0 0 0 0 0 0 44592.00 0 0 0 0 0 0 0
   ->  Seq Scan on public.tt  (cost=0.00..431.00 rows=1 width=8) (actual time=2.512..77.640 rows=353 loops=1)
         Output: a, b
         Filter: (tt.a = 100)
         Node Summary:                  vmax       vsum       vcnt       imax
           ntuples:                      353       1000          3          0
           execmemused:                    0          0          0          0
           workmemused:                    0          0          0          0
           workmemwanted:                  0          0          0          0
           totalWorkfileCreated:           0          0          0          0
           peakMemBalance:             19072      57216          3          0
           totalPartTableScanned:          0          0          0          0
           segindex0: 0
           ninst: 3
           StatInsts:
             (segN) pstype starttime counter firsttuple startup total ntuples nloops execmemused workmemused workmemwanted workfileCreated firststart peakMemBalance numPartScanned sortMethod sortSpaceType sortSpaceUsed bnotes enotes
             (seg0) 211 0.00 0.00 0.08 353.00 1.00 0 0 0 0 0 0 19072.00 0 0 0 0 0 0 0
             (seg1) 211 0.00 0.00 0.03 330.00 1.00 0 0 0 0 0 0 19072.00 0 0 0 0 0 0 0
             (seg2) 211 0.00 0.00 0.05 317.00 1.00 0 0 0 0 0 0 19072.00 0 0 0 0 0 0 0
 Planning time: 4.514 ms
   (slice0)    Executor memory: 119K bytes.
   (slice1)    Executor memory: 27K bytes avg x 3 workers, 27K bytes max (seg0).
 Memory used:  128000kB
 Optimizer: Pivotal Optimizer (GPORCA)
 Execution time: 78.584 ms
(39 rows)
```
@robozmey robozmey force-pushed the explain-node-summary branch from d1f8171 to 6f6849a Compare November 13, 2024 08:27
@reshke reshke merged commit 4b05cbf into open-gpdb:OPENGPDB_STABLE Nov 14, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants