Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1001368

Browse files
committed
Clean up EXPLAIN's handling of per-worker details.
Previously, it was possible for EXPLAIN ANALYZE of a parallel queryto produce several different "Workers" fields for a single plan node,because different portions of explain.c independently generatedper-worker data and wrapped that output in separate fields. Thisis pretty bogus, especially for the structured output formats: evenif it's not technically illegal, most programs would have a hard timedealing with such data.To improve matters, add infrastructure that allows redirectingper-worker values into a side data structure, and then collect thatdata into a single "Workers" field after we've finished running allthe relevant code for a given plan node.There are a few visible side-effects:* In text format, instead of something like Sort Method: external merge Disk: 4920kB Worker 0: Sort Method: external merge Disk: 5880kB Worker 1: Sort Method: external merge Disk: 5920kB Buffers: shared hit=682 read=10188, temp read=1415 written=2101 Worker 0: actual time=130.058..130.324 rows=1324 loops=1 Buffers: shared hit=337 read=3489, temp read=505 written=739 Worker 1: actual time=130.273..130.512 rows=1297 loops=1 Buffers: shared hit=345 read=3507, temp read=505 written=744you get Sort Method: external merge Disk: 4920kB Buffers: shared hit=682 read=10188, temp read=1415 written=2101 Worker 0: actual time=130.058..130.324 rows=1324 loops=1 Sort Method: external merge Disk: 5880kB Buffers: shared hit=337 read=3489, temp read=505 written=739 Worker 1: actual time=130.273..130.512 rows=1297 loops=1 Sort Method: external merge Disk: 5920kB Buffers: shared hit=345 read=3507, temp read=505 written=744* When JIT is enabled, any relevant per-worker JIT stats are attachedto the child node of the Gather or Gather Merge node, which is wherethe other per-worker output has always been. Previously, that infowas attached directly to a Gather node, or missed entirely for GatherMerge.* A query's summary JIT data no longer includes a bogus"Worker Number: -1" field.A notable code-level change is that indenting for lines of text-formatoutput should now be handled by calling "ExplainIndentText(es)",instead of hard-wiring how much space to emit. This seems a good dealcleaner anyway.This patch also adds a new "explain.sql" regression test script that'sdedicated to testing EXPLAIN. There is more that can be done in thatline, certainly, but for now it just adds some coverage of the XML andYAML output formats, which had been completely untested.Although this is surely a bug fix, it's not clear that people wouldbe happy with rearranging EXPLAIN output in a minor release, so applyto HEAD only.Maciek Sakrejda and Tom Lane, based on an idea of Andres Freund's;reviewed by Georgios KokolatosDiscussion:https://postgr.es/m/CAOtHd0AvAA8CLB9Xz0wnxu1U=zJCKrr1r4QwwXi_kcQsHDVU=Q@mail.gmail.com
1 parent13661dd commit1001368

File tree

6 files changed

+876
-130
lines changed

6 files changed

+876
-130
lines changed

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp