Re: RangeTblEntry jumble omissions - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: RangeTblEntry jumble omissions
Date
Msg-id 202402232200.msal7gqyyexg@alvherre.pgsql
Whole thread Raw
In response to RangeTblEntry jumble omissions  (Peter Eisentraut <peter@eisentraut.org>)
Responses Re: RangeTblEntry jumble omissions
List pgsql-hackers
On 2024-Feb-23, Peter Eisentraut wrote:

> - alias
> 
> Currently, two queries like
> 
> SELECT * FROM t1 AS foo
> SELECT * FROM t1 AS bar
> 
> are counted together by pg_stat_statements -- that might be ok, but they
> both get listed under whichever one is run first, so here if you are looking
> for the "AS bar" query, you won't find it.

Another, similar but not quite: if you do

SET search_path TO foo;
SELECT * FROM t1;
SET search_path TO bar;
SELECT * FROM t1;

and you have both foo.t1 and bar.t1, you'll get two identical-looking
queries in pg_stat_statements with different jumble IDs, with no way to
know which is which.  Not sure if the jumbling of the RTE (which
includes the OID of the table in question) itself is to blame, or
whether we want to store the relevant schemas with the entry somehow, or
what.  Obviously, failing to differentiate them would not be an
improvement.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/



pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: Re: cleanup patches for dshash
Next
From: Alvaro Herrera
Date:
Subject: Re: Running the fdw test from the terminal crashes into the core-dump