Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUx3y-0008UI-1a for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Dec 2018 17:03:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gUx3w-0007qu-DX for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Dec 2018 17:03:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUx3w-0007qn-3N for pgsql-hackers@lists.postgresql.org; Thu, 06 Dec 2018 17:03:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUx3q-0007jt-D3 for pgsql-hackers@postgresql.org; Thu, 06 Dec 2018 17:03:42 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id wB6H3XNZ021729; Thu, 6 Dec 2018 12:03:33 -0500 From: Tom Lane To: Robert Haas cc: Andres Freund , Pavel Stehule , "pgsql-hackers@postgresql.org" Subject: Re: slow queries over information schema.tables In-reply-to: References: <5978.1544030694@sss.pgh.pa.us> <20181205175657.s7mt6as356kwvrji@alap3.anarazel.de> <8210.1544034143@sss.pgh.pa.us> <20181205182555.x4wtnzffmhwsc3c7@alap3.anarazel.de> <8843.1544035292@sss.pgh.pa.us> <20577.1544113962@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Thu, 06 Dec 2018 11:50:48 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21727.1544115813.1@sss.pgh.pa.us> Date: Thu, 06 Dec 2018 12:03:33 -0500 Message-ID: <21728.1544115813@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > On Thu, Dec 6, 2018 at 11:32 AM Tom Lane wrote: >> It's fairly hard to imagine practical cases where we'd not call >> AcceptInvalidationMessages at least once per query, so I'm not >> very sure what you're on about. > Unless I'm confused, it happens any time you run a query that only > touches tables using lockmodes previously acquired by the current > transaction. Like: > BEGIN; > some query; > the same query again; In my testing, that still hits AIM() during parserOpenTable(). [ further experimentation... ] It looks like if you prepare a query and then just execute it repeatedly in one transaction, you'd not reach AIM (as long as you were getting generic plans). Possibly that's a gap worth closing. regards, tom lane