aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_utilcmd.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-09-28 12:05:03 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2020-09-28 12:05:03 -0400
commit0a87ddff5c83589e90de236bd55e6a19b017fe9a (patch)
tree6c35e1a6d9fcd89e7ede77e30b9f184f30dbaab3 /src/backend/parser/parse_utilcmd.c
parente21cbb4b893b85b5f1cf203b9a77ca0d9ee671d1 (diff)
downloadpostgresql-0a87ddff5c83589e90de236bd55e6a19b017fe9a.tar.gz
postgresql-0a87ddff5c83589e90de236bd55e6a19b017fe9a.zip
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
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
0 files changed, 0 insertions, 0 deletions