pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Add a planner support function for starts_with().
2+ messages / 2 participants
[nested] [flat]

* pgsql: Add a planner support function for starts_with().
@ 2021-11-17 21:54  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2021-11-17 21:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Add a planner support function for starts_with().

This fills in some gaps in planner support for starts_with() and
the equivalent ^@ operator:

* A condition such as "textcol ^@ constant" can now use a regular
btree index, not only an SP-GiST index, so long as the index's
collation is C.  (This works just like "textcol LIKE 'foo%'".)

* "starts_with(textcol, constant)" can be optimized the same as
"textcol ^@ constant".

* Fixed-prefix LIKE and regex patterns are now more like starts_with()
in another way: if you apply one to an SPGiST-indexed column, you'll
get an index condition using ^@ rather than two index conditions with
>= and <.

Per a complaint from Shay Rojansky.  Patch by me; thanks to
Nathan Bossart for review.

Discussion: https://postgr.es/m/232599.1633800229@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a148f8bc04b9980f019ea0d4b89311cf0bdc22b7

Modified Files
--------------
src/backend/utils/adt/like_support.c              | 65 ++++++++++++++++-------
src/include/catalog/catversion.h                  |  2 +-
src/include/catalog/pg_operator.dat               |  2 +-
src/include/catalog/pg_proc.dat                   |  8 ++-
src/test/regress/expected/create_index_spgist.out | 33 ++++++++++++
src/test/regress/sql/create_index_spgist.sql      |  8 +++
6 files changed, 95 insertions(+), 23 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Add a planner support function for numeric generate_series().
@ 2024-12-02 11:39  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Dean Rasheed @ 2024-12-02 11:39 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Add a planner support function for numeric generate_series().

This allows the planner to estimate the number of rows returned by
generate_series(numeric, numeric[, numeric]), when the input values
can be estimated at plan time.

Song Jinzhou, reviewed by Dean Rasheed and David Rowley.

Discussion: https://postgr.es/m/tencent_F43E7F4DD50EF5986D1051DE8DE547910206%40qq.com
Discussion: https://postgr.es/m/tencent_1F6D5B9A1545E02FD7D0EE508DFD056DE50A%40qq.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/97173536ed4b1c29dce0dc4119db136e142f60a2

Modified Files
--------------
src/backend/utils/adt/numeric.c              | 121 +++++++++++++++++++++++++++
src/include/catalog/catversion.h             |   2 +-
src/include/catalog/pg_proc.dat              |   9 +-
src/test/regress/expected/misc_functions.out |  65 ++++++++++++++
src/test/regress/sql/misc_functions.sql      |  38 +++++++++
5 files changed, 232 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-12-02 11:39 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17 21:54 pgsql: Add a planner support function for starts_with(). Tom Lane <tgl@sss.pgh.pa.us>
2024-12-02 11:39 pgsql: Add a planner support function for numeric generate_series(). Dean Rasheed <dean.a.rasheed@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox