From: Nathan Bossart <nathandbossart@gmail.com>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Isaac Morland <isaac.morland@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Faster "SET search_path"
Date: Mon, 7 Aug 2023 15:39:08 -0700
Message-ID: <20230807223908.GB1284531@nathanxps13> (raw)
In-Reply-To: <fec7f3bea50112323d9b6e700b5e2762a14af809.camel@j-davis.com>
References: <04c8592dbd694e4114a3ed87139a7a04e4363030.camel@j-davis.com>
<CAMsGm5fZ2xiVDLYH4-_Ld8bfe1qwY23ZLgPc7zBpH8d1WUw70A@mail.gmail.com>
<f555c41554c7f5ff2699c085836ea94beac09bad.camel@j-davis.com>
<20230802050720.GB866741@nathanxps13>
<CAMsGm5dt6szoTe5oAzk5nfbHHOEpMDVhLTOGWCJGCQ3Wq8+J0w@mail.gmail.com>
<fec7f3bea50112323d9b6e700b5e2762a14af809.camel@j-davis.com>
0001 and 0002 LGTM. 0003 is looking pretty good, too, but I think we
should get some more eyes on it, given the complexity.
On Mon, Aug 07, 2023 at 12:57:27PM -0700, Jeff Davis wrote:
> (Aside: part of the reason set_config_option() is slow is because of
> the lookup in guc_hashtab. That's slower than some other hash lookups
> because it does case-folding, which needs to be done in both the hash
> function and also the match function. The hash lookups in
> SearchPathCache are significantly faster. I also have a patch to change
> guc_hashtab to simplehash, but I didn't see much difference.)
I wonder if it'd be faster to downcase first and then pass it to
hash_bytes(). This would require modifying the key, which might be a
deal-breaker, but maybe there's some way to improve find_option() for all
GUCs.
> But in general I'd prefer to optimize cases that are going to work
> nicely by default for a lot of users (especially switching to a safe
> search path), without the need for obscure knowledge about the
> performance implications of the session search_path. And to the extent
> that we do optimize for the pre-existing search_path, I'd like to
> understand the inherent overhead of changing the search path versus
> incidental overhead.
+1
--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: nathandbossart@gmail.com, pgsql@j-davis.com, isaac.morland@gmail.com
Subject: Re: Faster "SET search_path"
In-Reply-To: <20230807223908.GB1284531@nathanxps13>
References: <04c8592dbd694e4114a3ed87139a7a04e4363030.camel@j-davis.com> <CAMsGm5fZ2xiVDLYH4-_Ld8bfe1qwY23ZLgPc7zBpH8d1WUw70A@mail.gmail.com> <f555c41554c7f5ff2699c085836ea94beac09bad.camel@j-davis.com> <20230802050720.GB866741@nathanxps13> <CAMsGm5dt6szoTe5oAzk5nfbHHOEpMDVhLTOGWCJGCQ3Wq8+J0w@mail.gmail.com> <fec7f3bea50112323d9b6e700b5e2762a14af809.camel@j-davis.com> <20230807223908.GB1284531@nathanxps13>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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