Re: Fix generate_useful_gather_paths for parallel unsafe pathkeys

Tomas Vondra <tomas.vondra@enterprisedb.com>

From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: James Coleman <jtc331@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>, luis.roberto@siscobra.com.br, Tom Lane <tgl@sss.pgh.pa.us>, Robert Haas <robertmhaas@gmail.com>
Date: 2020-12-16T01:23:45Z
Lists: pgsql-hackers

Attachments

Hi,

I reviewed the patch series, tweaked a couple comments, added commit
messages etc. Barring objections, I'll push this in a couple days.

One thing that annoys me is that it breaks ABI because it adds two new
parameters to find_em_expr_usable_for_sorting_rel, but I don't think we
can get around that. We could assume require_parallel_safe=true, but we
still need to pass the PlannerInfo pointer.


regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Commits

  1. Improve find_em_expr_usable_for_sorting_rel comment

  2. Don't search for volatile expr in find_em_expr_usable_for_sorting_rel

  3. Disallow SRFs when considering sorts below Gather Merge

  4. Check parallel safety in generate_useful_gather_paths

  5. Consider unsorted paths in generate_useful_gather_paths

  6. Error out when Gather Merge input is not sorted