aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/postgres_fdw.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2023-01-07 15:24:35 +1300
committerDavid Rowley <drowley@postgresql.org>2023-01-07 15:24:35 +1300
commita14a5832923e10ef14a74864c94358d5bc8720e4 (patch)
tree225436ed538626fa48f1ef7c432e137d864cc7b3 /contrib/postgres_fdw/postgres_fdw.c
parentc6e1f62e2cee817cad58cccc1dd685e908678241 (diff)
downloadpostgresql-a14a5832923e10ef14a74864c94358d5bc8720e4.tar.gz
postgresql-a14a5832923e10ef14a74864c94358d5bc8720e4.zip
Add additional regression tests for select_active_windows
During the development of 728202b63, which was aimed at reducing the number of sorts required to evaluate multiple window functions with different WindowClause definitions, the code written sorted the WindowClauses in reverse tleSortGroupRef order. There appears to be no discussion in the thread which was opened to discuss the development of this patch and no comments mentioning the fact that having the WindowClauses in reverse tleSortGroupRef order makes it more likely that the final WindowClause to be evaluated will provide presorted input to the query's DISTINCT or ORDER BY clause. The reason for this is that the tleSortGroupRef indexes are assigned for the DISTINCT and ORDER BY clauses before they are for the WindowClauses PARTITION BY and ORDER BY clauses. Putting the WindowClause with the lowest tleSortGroupRef last means that it's more likely that no additional sorting is required for the query's DISTINCT or ORDER BY clause. All we're doing here is adding some tests and a comment to help ensure that remains true and that we don't accidentally forget to consider this again should we ever rewrite that code. Author: Ankit Kumar Pandey, David Rowley Discussion: https://postgr.es/m/CAApHDvq=g2=ny59f1bvwRVvupsgPHK-KjLPBsSL25fVuGZ4idQ@mail.gmail.com
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
0 files changed, 0 insertions, 0 deletions