forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita363bc6

Etsuro Fujita
Fix EXPLAIN ANALYZE for async-capable nodes.
EXPLAIN ANALYZE for an async-capable ForeignScan node associated withpostgres_fdw is done just by using instrumentation for ExecProcNode()called from the node's callbacks, causing the following problems:1) If the remote table to scan is empty, the node is incorrectly considered as "never executed" by the command even if the node is executed, as ExecProcNode() isn't called from the node's callbacks at all in that case.2) The command fails to collect timings for things other than ExecProcNode() done in the node, such as creating a cursor for the node's remote query.To fix these problems, add instrumentation for async-capable nodes, andmodify postgres_fdw accordingly.My oversight in commit27e1f14.While at it, update a comment for the AsyncRequest struct in execnodes.hand the documentation for the ForeignAsyncRequest API in fdwhandler.sgmlto match the code in ExecAsyncAppendResponse() in nodeAppend.c, and fixtypos in comments in nodeAppend.c.Per report from Andrey Lepikhov, though I didn't use his patch.Reviewed-by: Andrey LepikhovDiscussion:https://postgr.es/m/2eb662bb-105d-fc20-7412-2f027cc3ca72%40postgrespro.ru1 parente135743 commita363bc6
File tree
14 files changed
+134
-26
lines changed- contrib
- auto_explain
- pg_stat_statements
- postgres_fdw
- expected
- sql
- doc/src/sgml
- src
- backend/executor
- include
- executor
- nodes
14 files changed
+134
-26
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
314 | 314 |
| |
315 | 315 |
| |
316 | 316 |
| |
317 |
| - | |
| 317 | + | |
318 | 318 |
| |
319 | 319 |
| |
320 | 320 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
974 | 974 |
| |
975 | 975 |
| |
976 | 976 |
| |
977 |
| - | |
| 977 | + | |
978 | 978 |
| |
979 | 979 |
| |
980 | 980 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10051 | 10051 |
| |
10052 | 10052 |
| |
10053 | 10053 |
| |
| 10054 | + | |
| 10055 | + | |
| 10056 | + | |
| 10057 | + | |
| 10058 | + | |
| 10059 | + | |
| 10060 | + | |
| 10061 | + | |
| 10062 | + | |
| 10063 | + | |
| 10064 | + | |
| 10065 | + | |
| 10066 | + | |
| 10067 | + | |
| 10068 | + | |
10054 | 10069 |
| |
10055 | 10070 |
| |
10056 | 10071 |
| |
| |||
10132 | 10147 |
| |
10133 | 10148 |
| |
10134 | 10149 |
| |
| 10150 | + | |
| 10151 | + | |
| 10152 | + | |
| 10153 | + | |
| 10154 | + | |
10135 | 10155 |
| |
10136 | 10156 |
| |
| 10157 | + | |
| 10158 | + | |
| 10159 | + | |
| 10160 | + | |
| 10161 | + | |
| 10162 | + | |
| 10163 | + | |
| 10164 | + | |
| 10165 | + | |
| 10166 | + | |
| 10167 | + | |
| 10168 | + | |
| 10169 | + | |
| 10170 | + | |
10137 | 10171 |
| |
10138 | 10172 |
| |
10139 | 10173 |
| |
10140 | 10174 |
| |
10141 | 10175 |
| |
10142 |
| - | |
10143 |
| - | |
10144 |
| - | |
10145 |
| - | |
10146 |
| - | |
10147 | 10176 |
| |
10148 | 10177 |
| |
10149 | 10178 |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1542 | 1542 |
| |
1543 | 1543 |
| |
1544 | 1544 |
| |
1545 |
| - | |
| 1545 | + | |
1546 | 1546 |
| |
1547 | 1547 |
| |
1548 | 1548 |
| |
| |||
6867 | 6867 |
| |
6868 | 6868 |
| |
6869 | 6869 |
| |
6870 |
| - | |
| 6870 | + | |
6871 | 6871 |
| |
6872 | 6872 |
| |
6873 | 6873 |
| |
| |||
6956 | 6956 |
| |
6957 | 6957 |
| |
6958 | 6958 |
| |
| 6959 | + | |
| 6960 | + | |
| 6961 | + | |
| 6962 | + | |
| 6963 | + | |
6959 | 6964 |
| |
6960 | 6965 |
| |
6961 | 6966 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3195 | 3195 |
| |
3196 | 3196 |
| |
3197 | 3197 |
| |
| 3198 | + | |
| 3199 | + | |
3198 | 3200 |
| |
3199 | 3201 |
| |
3200 | 3202 |
| |
| |||
3226 | 3228 |
| |
3227 | 3229 |
| |
3228 | 3230 |
| |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
| 3234 | + | |
| 3235 | + | |
| 3236 | + | |
3229 | 3237 |
| |
3230 | 3238 |
| |
3231 | 3239 |
| |
| 3240 | + | |
| 3241 | + | |
| 3242 | + | |
| 3243 | + | |
| 3244 | + | |
| 3245 | + | |
| 3246 | + | |
| 3247 | + | |
3232 | 3248 |
| |
3233 | 3249 |
| |
3234 | 3250 |
| |
3235 | 3251 |
| |
3236 | 3252 |
| |
3237 |
| - | |
3238 |
| - | |
3239 |
| - | |
3240 |
| - | |
3241 |
| - | |
3242 | 3253 |
| |
3243 | 3254 |
| |
3244 | 3255 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1597 | 1597 |
| |
1598 | 1598 |
| |
1599 | 1599 |
| |
1600 |
| - | |
| 1600 | + | |
1601 | 1601 |
| |
1602 | 1602 |
| |
1603 | 1603 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
| 18 | + | |
18 | 19 |
| |
19 | 20 |
| |
20 | 21 |
| |
| |||
24 | 25 |
| |
25 | 26 |
| |
26 | 27 |
| |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
27 | 35 |
| |
28 | 36 |
| |
29 | 37 |
| |
| |||
36 | 44 |
| |
37 | 45 |
| |
38 | 46 |
| |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
39 | 52 |
| |
40 | 53 |
| |
41 | 54 |
| |
| |||
48 | 61 |
| |
49 | 62 |
| |
50 | 63 |
| |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
51 | 68 |
| |
52 | 69 |
| |
53 | 70 |
| |
| |||
58 | 75 |
| |
59 | 76 |
| |
60 | 77 |
| |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
61 | 82 |
| |
62 | 83 |
| |
63 | 84 |
| |
| |||
66 | 87 |
| |
67 | 88 |
| |
68 | 89 |
| |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
69 | 94 |
| |
70 | 95 |
| |
71 | 96 |
| |
| |||
78 | 103 |
| |
79 | 104 |
| |
80 | 105 |
| |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
81 | 111 |
| |
82 | 112 |
| |
83 | 113 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1214 | 1214 |
| |
1215 | 1215 |
| |
1216 | 1216 |
| |
1217 |
| - | |
| 1217 | + | |
1218 | 1218 |
| |
1219 | 1219 |
| |
1220 | 1220 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
407 | 407 |
| |
408 | 408 |
| |
409 | 409 |
| |
410 |
| - | |
| 410 | + | |
| 411 | + | |
411 | 412 |
| |
412 | 413 |
| |
413 | 414 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
31 |
| - | |
| 31 | + | |
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
| 49 | + | |
49 | 50 |
| |
50 | 51 |
| |
51 | 52 |
| |
| |||
82 | 83 |
| |
83 | 84 |
| |
84 | 85 |
| |
| 86 | + | |
85 | 87 |
| |
86 | 88 |
| |
87 | 89 |
| |
| |||
114 | 116 |
| |
115 | 117 |
| |
116 | 118 |
| |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
117 | 136 |
| |
118 | 137 |
| |
119 | 138 |
| |
|
0 commit comments
Comments
(0)