postgresql/src/include/optimizer
Richard Guo c06e909c26 Track the number of presorted outer pathkeys in MergePath
When creating an explicit Sort node for the outer path of a mergejoin,
we need to determine the number of presorted keys of the outer path to
decide whether explicit incremental sort can be applied.  Currently,
this is done by repeatedly calling pathkeys_count_contained_in.

This patch caches the number of presorted outer pathkeys in MergePath,
allowing us to save several calls to pathkeys_count_contained_in.  It
can be considered a complement to the changes in commit 828e94c9d.

Reported-by: David Rowley <dgrowleyml@gmail.com>
Author: Richard Guo <guofenglinux@gmail.com>
Reviewed-by: Tender Wang <tndrwang@gmail.com>
Discussion: https://postgr.es/m/CAApHDvqvBireB_w6x8BN5txdvBEHxVgZBt=rUnpf5ww5P_E_ww@mail.gmail.com
2025-05-08 18:21:32 +09:00
..
appendinfo.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
clauses.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
cost.h Track the number of presorted outer pathkeys in MergePath 2025-05-08 18:21:32 +09:00
geqo.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
geqo_copy.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
geqo_gene.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
geqo_misc.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
geqo_mutation.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
geqo_pool.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
geqo_random.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
geqo_recombination.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
geqo_selection.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
inherit.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
joininfo.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
optimizer.h Extract make_SAOP_expr() function from match_orclause_to_indexcol() 2025-04-04 16:01:28 +03:00
orclauses.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
paramassign.h Add OLD/NEW support to RETURNING in DML queries. 2025-01-16 14:57:35 +00:00
pathnode.h Track the number of presorted outer pathkeys in MergePath 2025-05-08 18:21:32 +09:00
paths.h Speedup child EquivalenceMember lookup in planner 2025-04-08 18:09:57 +12:00
placeholder.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
plancat.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
planmain.h Harmonize function parameter names for Postgres 18. 2025-04-12 12:07:36 -04:00
planner.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
prep.h Expand virtual generated columns in the planner 2025-02-25 16:10:25 +09:00
restrictinfo.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
subselect.h Convert 'x IN (VALUES ...)' to 'x = ANY ...' then appropriate 2025-04-04 16:01:50 +03:00
tlist.h Update copyright for 2025 2025-01-01 11:21:55 -05:00