diff options
| author | Andrew Gierth | 2018-09-14 16:35:42 +0000 |
|---|---|---|
| committer | Andrew Gierth | 2018-09-14 16:35:42 +0000 |
| commit | 728202b63cdcd7fb73fdba114903ed235eb02f3a (patch) | |
| tree | a0f4f8f04b68fba0a42faea8335b8bc4cec630cd /src/backend/nodes | |
| parent | 75f9c4ca5a8047d7a9cfbc7d51a610933d04dc7f (diff) | |
Order active window clauses for greater reuse of Sort nodes.
By sorting the active window list lexicographically by the sort clause
list but putting longer clauses before shorter prefixes, we generate
more chances to elide Sort nodes when building the path.
Author: Daniel Gustafsson (with some editorialization by me)
Reviewed-by: Alexander Kuzmenkov, Masahiko Sawada, Tom Lane
Discussion: https://postgr.es/m/124A7F69-84CD-435B-BA0E-2695BE21E5C2%40yesql.se
Diffstat (limited to 'src/backend/nodes')
| -rw-r--r-- | src/backend/nodes/list.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/backend/nodes/list.c b/src/backend/nodes/list.c index f3e18007086..55fd4c359b1 100644 --- a/src/backend/nodes/list.c +++ b/src/backend/nodes/list.c @@ -1011,8 +1011,11 @@ list_append_unique_oid(List *list, Oid datum) * via equal(). * * This is almost the same functionality as list_union(), but list1 is - * modified in-place rather than being copied. Note also that list2's cells - * are not inserted in list1, so the analogy to list_concat() isn't perfect. + * modified in-place rather than being copied. However, callers of this + * function may have strict ordering expectations -- i.e. that the relative + * order of those list2 elements that are not duplicates is preserved. Note + * also that list2's cells are not inserted in list1, so the analogy to + * list_concat() isn't perfect. */ List * list_concat_unique(List *list1, List *list2) |
