You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
postgres=# select count(*) from foo join bar on foo.c1=bar.c1;
106
119
```
107
120
Other backend can extract intermediate state of execution that query:
108
-
```
121
+
```sql
109
122
postgres=# \x
110
123
postgres=# select * from pg_query_state(49265);
111
124
-[ RECORD 1 ]+-------------------------------------------------------------------------------------------------------------------------
@@ -150,11 +163,11 @@ In example above working backend spawns two parallel workers with pids `49324` a
150
163
`Seq Scan` node has statistics on passed loops (average number of rows delivered to `Nested Loop` and number of passed loops are shown) and statistics on current loop. Other nodes has statistics only for current loop as this loop is first (`loop number` = 1).
151
164
152
165
Assume first backend executes some function:
153
-
```
166
+
```sql
154
167
postgres=# select n_join_foo_bar();
155
168
```
156
169
Other backend can get the follow output:
157
-
```
170
+
```sql
158
171
postgres=# select * from pg_query_state(49265);
159
172
-[ RECORD 1 ]+------------------------------------------------------------------------------------------------------------------
160
173
pid | 49265
@@ -180,7 +193,7 @@ leader_pid | (null)
180
193
First row corresponds to function call, second - to query which is in the body of that function.
181
194
182
195
We can get result plans in different format (e.g. `json`):
183
-
```
196
+
```sql
184
197
postgres=# select * from pg_query_state(pid := 49265, format := 'json');
185
198
-[ RECORD 1 ]+------------------------------------------------------------
0 commit comments