Re: slow queries over information schema.tables - Mailing list pgsql-hackers

From Robert Haas
Subject Re: slow queries over information schema.tables
Date
Msg-id CA+TgmoYrs92UR6dEuzVp-ghuj0HAhZ0iyqb3memusje9Rr3uaw@mail.gmail.com
Whole thread Raw
In response to Re: slow queries over information schema.tables  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: slow queries over information schema.tables
List pgsql-hackers
On Thu, Dec 6, 2018 at 12:03 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> In my testing, that still hits AIM() during parserOpenTable().

Oh, I see.  relation_openrv_extended() calls it.

> [ 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.

If we called it at the start of every query, couldn't we dispense with
the call in relation_openrv_extended()?  On net, that would actually
mean fewer calls to AcceptInvalidationMessages(), assuming you
sometimes run queries that touch multiple relations.  And the behavior
would be more predictable, too, because you'd (hopefully) have no
cases where a command failed to see the results of DDL that committed
before the command was issued.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal: plpgsql pragma statement
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: plpgsql pragma statement