Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qR453-000QtA-6X for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Aug 2023 05:07:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qR451-002YVC-4C for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Aug 2023 05:07:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qR450-002YV4-RW for pgsql-hackers@lists.postgresql.org; Wed, 02 Aug 2023 05:07:27 +0000 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qR44y-00058S-JF for pgsql-hackers@postgresql.org; Wed, 02 Aug 2023 05:07:26 +0000 Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3a43cbb432aso4781965b6e.3 for ; Tue, 01 Aug 2023 22:07:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690952842; x=1691557642; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=iJXGnw+pNi+TZaH321ZiB93icRHshfxgiFPkJiwjjW0=; b=Nbn5TwH6+gANHmbMveVo5V9Fmfq2yt4L82o8mz//z8c1YcifUN5O75lk0g2Y/ROmRT 6DgJXUcedTXOGv/o6b5M+vEfB7MC+dU5guwGQ+DCdktC0ZFzm7jVEDlLedTCxqvBFeXh HQk4XjPHeIGfvnh3m/0y805EaIdc97vWUrzx+BT/UfokTtamor5/E+Zzu5ezV8umzlOY wrUhArU8zWJX3rYgqCNofEfNdLiyV8Cxg1XqNUsRiq7xi1VAiHmkFX/J1MTkvxCBGnuI 2entjdwLmMiTWCNmAdSHzYW7WZAOUNpz1V2D8Kn7QhfXJWqxCWyQE36PiId6uqdt23fT Q0ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690952842; x=1691557642; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=iJXGnw+pNi+TZaH321ZiB93icRHshfxgiFPkJiwjjW0=; b=BSqqJeZ9hojVKEy3tTu/aC3T/Yn5ZUDPUVlmeKMZJ8CA3n7Jzu1iaFrqu0Dx1fzYty azN30mLIQ703rx35UMgtdajbnpNHzebnoATIcD+/L7B5Ltfnv4V+8svZnvfwWB9BJaxp fiviJF91bO3n3eyjDiuptkojpZCx1kG/15PKO+bcW+xpvjEi1Ss47plb9HPVDEtl9VMj SYvz6+k4AnGxFKgq4KhaNRcq2eelNCHiX07dLTuFn8JG/8H5t0k6MuNHcralnglBYVr4 2M/p6ybD2Wdv8H/kNH4GXm9pFuMQlcLK87TQdTV+ziuVsiHnNO+KSVDw6qY+HywL4ZXq kXFQ== X-Gm-Message-State: ABy/qLYv9WAZggVShW1HEAnNAQOgMC/xwjHYULQDbdY1ixKeXjsciDoZ i0S9sgPtw7BdGkIwm/qbP8s= X-Google-Smtp-Source: APBJJlH7Jc+zFA0OjD+gQF9t/WCXDh4rDCSfnt1aYTeKyRvSc985WxHTBlUmqoGfCT6jNK5vYJg66Q== X-Received: by 2002:a05:6808:20a5:b0:3a7:37ae:4a47 with SMTP id s37-20020a05680820a500b003a737ae4a47mr9461251oiw.12.1690952842522; Tue, 01 Aug 2023 22:07:22 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id a9-20020a631a09000000b00563590be25esm10631826pga.29.2023.08.01.22.07.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 22:07:21 -0700 (PDT) Date: Tue, 1 Aug 2023 22:07:20 -0700 From: Nathan Bossart To: Jeff Davis Cc: Isaac Morland , pgsql-hackers@postgresql.org Subject: Re: Faster "SET search_path" Message-ID: <20230802050720.GB866741@nathanxps13> References: <04c8592dbd694e4114a3ed87139a7a04e4363030.camel@j-davis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jul 31, 2023 at 10:28:31PM -0700, Jeff Davis wrote: > On Sat, 2023-07-29 at 12:44 -0400, Isaac Morland wrote: >> Essentially, "just" observe efficiently (somehow) that no change is >> needed, and skip changing it? > > I gave this a try and it speeds things up some more. > > There might be a surprise factor with an optimization like that, > though. If someone becomes accustomed to the function running fast, > then changing the search_path in the caller could slow things down a > lot and it would be hard for the user to understand what happened. I wonder if this is a good enough reason to _not_ proceed with this optimization. At the moment, I'm on the fence about it. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com