@@ -109,7 +109,7 @@ begin
109109 for group_key in select unnest(array['Full-sort Groups', 'Presorted Groups']::text[]) t loop
110110 for space_key in select unnest(array['Sort Space Memory', 'Sort Space Disk']::text[]) t loop
111111 node := jsonb_set(node, array[group_key, space_key, 'Average Sort Space Used'], '"NN"', false);
112- node := jsonb_set(node, array[group_key, space_key, 'Maximum Sort Space Used'], '"NN"', false);
112+ node := jsonb_set(node, array[group_key, space_key, 'Peak Sort Space Used'], '"NN"', false);
113113 end loop;
114114 end loop;
115115 nodes := nodes || node;
@@ -131,7 +131,7 @@ begin
131131 for group_key in select unnest(array['Full-sort Groups', 'Presorted Groups']::text[]) t loop
132132 group_stats := node->group_key;
133133 for space_key in select unnest(array['Sort Space Memory', 'Sort Space Disk']::text[]) t loop
134- if (group_stats->space_key->'Maximum Sort Space Used')::bigint < (group_stats->space_key->'Maximum Sort Space Used')::bigint then
134+ if (group_stats->space_key->'Peak Sort Space Used')::bigint < (group_stats->space_key->'Peak Sort Space Used')::bigint then
135135 raise exception '% has invalid max space < average space', group_key;
136136 end if;
137137 end loop;
@@ -545,34 +545,34 @@ select explain_analyze_without_memory('select * from (select * from t order by a
545545(9 rows)
546546
547547select jsonb_pretty(explain_analyze_inc_sort_nodes_without_memory('select * from (select * from t order by a) s order by a, b limit 55'));
548- jsonb_pretty
549- --------------------------------------------------
550- [ +
551- { +
552- "Sort Key": [ +
553- "t.a", +
554- "t.b" +
555- ], +
556- "Node Type": "Incremental Sort", +
557- "Actual Rows": 55, +
558- "Actual Loops": 1, +
559- "Presorted Key": [ +
560- "t.a" +
561- ], +
562- "Parallel Aware": false, +
563- "Full-sort Groups": { +
564- "Group Count": 2, +
565- "Sort Methods Used": [ +
566- "top-N heapsort", +
567- "quicksort" +
568- ], +
569- "Sort Space Memory": { +
570- "Average Sort Space Used": "NN",+
571- "Maximum Sort Space Used": "NN" +
572- } +
573- }, +
574- "Parent Relationship": "Outer" +
575- } +
548+ jsonb_pretty
549+ -------------------------------------------------
550+ [ +
551+ { +
552+ "Sort Key": [ +
553+ "t.a", +
554+ "t.b" +
555+ ], +
556+ "Node Type": "Incremental Sort", +
557+ "Actual Rows": 55, +
558+ "Actual Loops": 1, +
559+ "Presorted Key": [ +
560+ "t.a" +
561+ ], +
562+ "Parallel Aware": false, +
563+ "Full-sort Groups": { +
564+ "Group Count": 2, +
565+ "Sort Methods Used": [ +
566+ "top-N heapsort", +
567+ "quicksort" +
568+ ], +
569+ "Sort Space Memory": { +
570+ "Peak Sort Space Used": "NN", +
571+ "Average Sort Space Used": "NN"+
572+ } +
573+ }, +
574+ "Parent Relationship": "Outer" +
575+ } +
576576 ]
577577(1 row)
578578
@@ -719,43 +719,43 @@ select explain_analyze_without_memory('select * from (select * from t order by a
719719(9 rows)
720720
721721select jsonb_pretty(explain_analyze_inc_sort_nodes_without_memory('select * from (select * from t order by a) s order by a, b limit 70'));
722- jsonb_pretty
723- --------------------------------------------------
724- [ +
725- { +
726- "Sort Key": [ +
727- "t.a", +
728- "t.b" +
729- ], +
730- "Node Type": "Incremental Sort", +
731- "Actual Rows": 70, +
732- "Actual Loops": 1, +
733- "Presorted Key": [ +
734- "t.a" +
735- ], +
736- "Parallel Aware": false, +
737- "Full-sort Groups": { +
738- "Group Count": 1, +
739- "Sort Methods Used": [ +
740- "quicksort" +
741- ], +
742- "Sort Space Memory": { +
743- "Average Sort Space Used": "NN",+
744- "Maximum Sort Space Used": "NN" +
745- } +
746- }, +
747- "Presorted Groups": { +
748- "Group Count": 5, +
749- "Sort Methods Used": [ +
750- "quicksort" +
751- ], +
752- "Sort Space Memory": { +
753- "Average Sort Space Used": "NN",+
754- "Maximum Sort Space Used": "NN" +
755- } +
756- }, +
757- "Parent Relationship": "Outer" +
758- } +
722+ jsonb_pretty
723+ -------------------------------------------------
724+ [ +
725+ { +
726+ "Sort Key": [ +
727+ "t.a", +
728+ "t.b" +
729+ ], +
730+ "Node Type": "Incremental Sort", +
731+ "Actual Rows": 70, +
732+ "Actual Loops": 1, +
733+ "Presorted Key": [ +
734+ "t.a" +
735+ ], +
736+ "Parallel Aware": false, +
737+ "Full-sort Groups": { +
738+ "Group Count": 1, +
739+ "Sort Methods Used": [ +
740+ "quicksort" +
741+ ], +
742+ "Sort Space Memory": { +
743+ "Peak Sort Space Used": "NN", +
744+ "Average Sort Space Used": "NN"+
745+ } +
746+ }, +
747+ "Presorted Groups": { +
748+ "Group Count": 5, +
749+ "Sort Methods Used": [ +
750+ "quicksort" +
751+ ], +
752+ "Sort Space Memory": { +
753+ "Peak Sort Space Used": "NN", +
754+ "Average Sort Space Used": "NN"+
755+ } +
756+ }, +
757+ "Parent Relationship": "Outer" +
758+ } +
759759 ]
760760(1 row)
761761
0 commit comments