Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }
John Naylor <johncnaylorls@gmail.com>
From: John Naylor <johncnaylorls@gmail.com>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Robert Haas <robertmhaas@gmail.com>,
Peter Eisentraut <peter@eisentraut.org>, pgsql-hackers@postgresql.org
Date: 2023-12-05T16:22:14Z
Lists: pgsql-hackers
On Tue, Dec 5, 2023 at 7:55 AM Jeff Davis <pgsql@j-davis.com> wrote:
>
> On Tue, 2023-11-21 at 09:24 -0500, Robert Haas wrote:
> > As to the second, could we somehow come
> > up with an API for guc.c where you can ask for an opaque handle that
> > will later allow you to do a fast-SET of a GUC?
>
> Yes, attached. That provides a significant speedup: my test goes from
> around ~7300ms to ~6800ms.
>
> This doesn't seem very controversial or complex, so I'll probably
> commit this soon unless someone else has a comment.
+ * set_config_option_ext: sets option with the given handle to the given
+ * value.
Copy-paste-o of the other function name.
+config_handle *
+get_config_handle(const char *name)
+{
+ struct config_generic *record;
+
+ record = find_option(name, false, false, 0);
+ if (record == NULL)
+ return 0;
Part of this code this was copied from a function that returned int,
but this one returns a pointer.
Commits
-
Cache opaque handle for GUC option to avoid repeasted lookups.
- 867dd2dc8704 17.0 landed
-
Add cache for recomputeNamespacePath().
- f26c2368dcae 17.0 cited