Re: explain vs auto_explain - Mailing list pgsql-general

From Vijaykumar Jain
Subject Re: explain vs auto_explain
Date
Msg-id CAM+6J97kkL_EkCnK9weJLcxgJaTDPFJVV6EKq3Q1noV7JB8cnQ@mail.gmail.com
Whole thread Raw
In response to Re: explain vs auto_explain  (Vijaykumar Jain <vijaykumarjain.github@gmail.com>)
List pgsql-general


On Sat, 19 Oct 2024 at 23:48, Vijaykumar Jain <vijaykumarjain.github@gmail.com> wrote:


ok, it makes sense for the reason of having auto_explain. but maybe i did ask correctly, 
why do we not have the extended flags in auto_explain , in , explain wrt nested_statements, and triggers ...
a user who finds the console output complicated, could well use a pager or redirect the output to the file via \o which is client side.

 
actually my bad. pls ignore.

i forgot we could leverage client_min_messages to get the output to console 

/*
postgres=# explain analyze create materialized view mv as select * from t;
                                          QUERY PLAN
-----------------------------------------------------------------------------------------------
 Seq Scan on t  (cost=0.00..35.50 rows=2550 width=4) (actual time=0.027..0.028 rows=0 loops=1)
 Planning Time: 0.549 ms
 Execution Time: 7.309 ms
(3 rows)

                                 ^
postgres=# explain analyze refresh materialized view mv;
                QUERY PLAN
-------------------------------------------
 Utility statements have no plan structure
(1 row)

postgres=# alter system set client_min_messages TO log;
ALTER SYSTEM
postgres=# select pg_reload_conf();
 pg_reload_conf
----------------
 t
(1 row)

postgres=# refresh materialized view
postgres-# mv ;
LOG:  duration: 0.016 ms  plan:
Query Text: refresh materialized view
mv ;
Seq Scan on public.t  (cost=0.00..35.50 rows=2550 width=4) (actual time=0.009..0.009 rows=0 loops=1)
  Output: col1
REFRESH MATERIALIZED VIEW
*/


I think i am good. thanks all. 
--
Thanks,
Vijay

Open to work
Resume - Vijaykumar Jain

pgsql-general by date:

Previous
From: Vijaykumar Jain
Date:
Subject: Re: explain vs auto_explain
Next
From: user
Date:
Subject: Postgres attach partition: AccessExclusive lock set on different tables depending on how attaching is performed