pgsql: Teach planner how to estimate rows for timestamp generate_series

Started by David Rowleyover 2 years ago2 messagescommitters
Jump to latest
#1David Rowley
drowley@postgresql.org

Teach planner how to estimate rows for timestamp generate_series

This provides the planner with row estimates for
generate_series(TIMESTAMP, TIMESTAMP, INTERVAL),
generate_series(TIMESTAMPTZ, TIMESTAMPTZ, INTERVAL) and
generate_series(TIMESTAMPTZ, TIMESTAMPTZ, INTERVAL, TEXT) when the input
parameter values can be estimated during planning.

Author: David Rowley
Reviewed-by: jian he <jian.universality@gmail.com>
Discussion: /messages/by-id/CAApHDvrBE=+ASo_sGYmQJ3GvO8GPvX5yxXhRS=t_ybd4odFkhQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/036bdcec9f9998a6e50711fadce69e482ff18f55

Modified Files
--------------
src/backend/utils/adt/timestamp.c | 88 +++++++++++++++++++++
src/include/catalog/pg_proc.dat | 12 ++-
src/test/regress/expected/misc_functions.out | 110 +++++++++++++++++++++++++++
src/test/regress/sql/misc_functions.sql | 84 ++++++++++++++++++++
4 files changed, 291 insertions(+), 3 deletions(-)

#2David Rowley
dgrowleyml@gmail.com
In reply to: David Rowley (#1)
Re: pgsql: Teach planner how to estimate rows for timestamp generate_series

On Tue, 9 Jul 2024 at 09:55, David Rowley <drowley@postgresql.org> wrote:

src/test/regress/expected/misc_functions.out | 110 +++++++++++++++++++++++++++
src/test/regress/sql/misc_functions.sql | 84 ++++++++++++++++++++

I'll look at fixing bushmaster [1]https://buildfarm.postgresql.org/cgi-bin/show_history.pl?nm=bushmaster&br=HEAD shortly.

David

[1]: https://buildfarm.postgresql.org/cgi-bin/show_history.pl?nm=bushmaster&br=HEAD