Commit 58054de
committed
Improve the implementation of information_schema._pg_expandarray().
This function was originally coded with a handmade expansion
of the array subscripts. We can do it a little faster and far
more legibly today, by using unnest() WITH ORDINALITY.
While at it, let's apply the rowcount estimation support that exists
for the underlying unnest() function: reduce the default ROWS estimate
to 100 and attach array_unnest_support. I'm not sure that
array_unnest_support can do anything useful today with the call sites
that exist in information_schema, but it can't hurt, and the existing
default rowcount of 1000 is surely much too high for any of these
cases.
The psql.sql regression script is using _pg_expandarray() as a
test case for \sf+. While we could keep doing so, the new one-line
function body makes a poor test case for \sf+ row-numbering, so
switch it to print another information_schema function.
Discussion: https://postgr.es/m/1424303.1703355485@sss.pgh.pa.us1 parent 6c361d3 commit 58054de
File tree
5 files changed
+30
-26
lines changed- src
- backend
- catalog
- utils/adt
- include/catalog
- test/regress
- expected
- sql
5 files changed
+30
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 46 | + | |
| 47 | + | |
51 | 48 | | |
52 | 49 | | |
53 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6317 | 6317 | | |
6318 | 6318 | | |
6319 | 6319 | | |
| 6320 | + | |
| 6321 | + | |
| 6322 | + | |
6320 | 6323 | | |
6321 | 6324 | | |
6322 | 6325 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5293 | 5293 | | |
5294 | 5294 | | |
5295 | 5295 | | |
5296 | | - | |
5297 | | - | |
5298 | | - | |
| 5296 | + | |
| 5297 | + | |
| 5298 | + | |
5299 | 5299 | | |
5300 | | - | |
5301 | | - | |
5302 | | - | |
5303 | | - | |
5304 | | - | |
5305 | | - | |
5306 | | - | |
5307 | | - | |
5308 | | - | |
| 5300 | + | |
| 5301 | + | |
| 5302 | + | |
| 5303 | + | |
| 5304 | + | |
| 5305 | + | |
| 5306 | + | |
| 5307 | + | |
| 5308 | + | |
| 5309 | + | |
| 5310 | + | |
5309 | 5311 | | |
5310 | | - | |
5311 | | - | |
5312 | | - | |
5313 | | - | |
5314 | | - | |
5315 | | - | |
| 5312 | + | |
| 5313 | + | |
| 5314 | + | |
| 5315 | + | |
| 5316 | + | |
| 5317 | + | |
| 5318 | + | |
| 5319 | + | |
5316 | 5320 | | |
5317 | 5321 | | |
5318 | 5322 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1312 | 1312 | | |
1313 | 1313 | | |
1314 | 1314 | | |
1315 | | - | |
1316 | | - | |
| 1315 | + | |
| 1316 | + | |
1317 | 1317 | | |
1318 | 1318 | | |
1319 | 1319 | | |
| |||
0 commit comments