Use postgres 12's support functions for function row/cost estimation
Open
performance
technical debt
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
Currently we use the planner hook to adjust the cost for functions like `read_intermediate_result`. Postgres 12 [added](https://www.postgresql.org/docs/12/sql-createfunction.html) `SUPPORT support_function` syntax to `CREATE FUNCTION` with which we can provide cost/row estimation functions to postgres. See postgres'[ `src/include/nodes/supportnodes.h`](https://github.com/postgres/postgres/blob/REL_12_STABLE/src/include/nodes/supportnodes.h).
This syntax is not available in postgres 11, so we should probably wait until Citus support for postgres 11 is dropped.
Contributor guide
Assessment
This issue has not been assessed yet.