Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lTdcV-0004jM-Un for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Apr 2021 04:47:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lTdcU-0002C4-T6 for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Apr 2021 04:47:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lTdcU-000296-Mx for pgsql-hackers@lists.postgresql.org; Tue, 06 Apr 2021 04:47:18 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lTdcS-0003DW-HO for pgsql-hackers@postgresql.org; Tue, 06 Apr 2021 04:47:17 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 1364lDFt947173; Tue, 6 Apr 2021 00:47:13 -0400 From: Tom Lane To: Andres Freund cc: pgsql-hackers@postgresql.org Subject: Re: subtransaction performance regression [kind of] due to snapshot caching In-reply-to: <20210406043521.lopeo7bbigad3n6t@alap3.anarazel.de> References: <20210406043521.lopeo7bbigad3n6t@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Mon, 05 Apr 2021 21:35:21 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <947171.1617684433.1@sss.pgh.pa.us> Date: Tue, 06 Apr 2021 00:47:13 -0400 Message-ID: <947172.1617684433@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > The time in 14 is spent mostly below: > - 94.58% 0.01% postgres postgres [.] CreateFunction > - 94.57% CreateFunction > - 94.49% ProcedureCreate > - 90.95% record_object_address_dependencies > - 90.93% recordMultipleDependencies > - 89.65% isObjectPinned > - 89.12% systable_getnext > - 89.06% index_getnext_slot > - 56.13% index_fetch_heap > - 54.82% table_index_fetch_tuple > + 53.79% heapam_index_fetch_tuple > 0.07% heap_hot_search_buffer > 0.01% ReleaseAndReadBuffer > 0.01% LockBuffer > 0.08% heapam_index_fetch_tuple Not wanting to distract from your point about xactCompletionCount, but ... I wonder if we could get away with defining "isObjectPinned" as "is the OID <= 9999" (and, in consequence, dropping explicit pin entries from pg_depend). I had not previously seen a case where the cost of looking into pg_depend for this info was this much of the total query runtime. regards, tom lane