Re: Skip temporary table schema name from explain-verbose output. - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: Skip temporary table schema name from explain-verbose output.
Date
Msg-id CALj2ACWjxZxyEe8we3kD-W_5xPrWB8rJh+mdKouTzeT9LL23Eg@mail.gmail.com
Whole thread Raw
In response to Skip temporary table schema name from explain-verbose output.  (Amul Sul <sulamul@gmail.com>)
Responses Re: Skip temporary table schema name from explain-verbose output.
List pgsql-hackers
On Tue, Apr 27, 2021 at 10:51 AM Amul Sul <sulamul@gmail.com> wrote:
>
> Hi,
>
> Temporary tables usually gets a unique schema name, see this:
>
> postgres=# create temp table foo(i int);
> CREATE TABLE
> postgres=# explain verbose select * from foo;
>                            QUERY PLAN
> -----------------------------------------------------------------
>  Seq Scan on pg_temp_3.foo  (cost=0.00..35.50 rows=2550 width=4)
>    Output: i
> (2 rows)
>
> The problem is that explain-verbose regression test output becomes
> unstable when several concurrently running tests operate on temporary
> tables.
>
> I was wondering can we simply skip the temporary schema name from the
> explain-verbose output or place the "pg_temp" schema name?
>
> Thoughts/Suggestions?

How about using an explain filter to replace the unstable text
pg_temp_3 to pg_temp_N instead of changing it in the core? Following
are the existing explain filters: explain_filter,
explain_parallel_append, explain_analyze_without_memory,
explain_resultcache, explain_parallel_sort_stats, explain_sq_limit.

Looks like some of the test cases already replace pg_temp_nn with pg_temp:
-- \dx+ would expose a variable pg_temp_nn schema name, so we can't use it here
select regexp_replace(pg_describe_object(classid, objid, objsubid),
                      'pg_temp_\d+', 'pg_temp', 'g') as "Object description"

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Performance degradation of REFRESH MATERIALIZED VIEW
Next
From: Japin Li
Date:
Subject: Re: [PATCH] Re: pg_identify_object_as_address() doesn't support pg_event_trigger oids