postgresql/src/backend
Tom Lane 0a87ddff5c Cache the result of converting now() to a struct pg_tm.
SQL operations such as CURRENT_DATE, CURRENT_TIME, LOCALTIME, and
conversion of "now" in a datetime input string have to obtain the
transaction start timestamp ("now()") as a broken-down struct pg_tm.
This is a remarkably expensive conversion, and since now() does not
change intra-transaction, it doesn't really need to be done more than
once per transaction.  Introducing a simple cache provides visible
speedups in queries that compute these values many times, for example
insertion of many rows that use a default value of CURRENT_DATE.

Peter Smith, with a bit of kibitzing by me

Discussion: https://postgr.es/m/CAHut+Pu89TWjq530V2gY5O6SWi=OEJMQ_VHMt8bdZB_9JFna5A@mail.gmail.com
2020-09-28 12:05:03 -04:00
..
access
bootstrap
catalog Minor mop-up for List improvements. 2020-09-27 22:30:52 -04:00
commands Minor mop-up for List improvements. 2020-09-27 22:30:52 -04:00
executor Move resolution of AlternativeSubPlan choices to the planner. 2020-09-27 12:51:28 -04:00
foreign
jit
lib
libpq
main
nodes
optimizer
parser
partitioning
po
port
postmaster
regex
replication Fix the logical replication from HEAD to lower versions. 2020-09-26 10:13:51 +05:30
rewrite
snowball
statistics
storage
tcop Fix bogus completion tag usage in walsender 2020-09-16 21:16:25 -03:00
tsearch
utils Cache the result of converting now() to a struct pg_tm. 2020-09-28 12:05:03 -04:00
.gitignore
common.mk
Makefile
nls.mk