public inbox for [email protected]  
help / color / mirror / Atom feed
From: Vijaykumar Jain <[email protected]>
To: Tom Lane <[email protected]>
Cc: David G. Johnston <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: explain vs auto_explain
Date: Sun, 20 Oct 2024 00:01:07 +0530
Message-ID: <CAM+6J97kkL_EkCnK9weJLcxgJaTDPFJVV6EKq3Q1noV7JB8cnQ@mail.gmail.com> (raw)
In-Reply-To: <CAM+6J97N7RY0WQg2u8qiEUhOKPVgZ=fO835CYdRkGoJ3TzCJmw@mail.gmail.com>
References: <CAM+6J96FeJxruxqPcZTxTuanKbZzmy0AUMOzChAr72y4iSd+7g@mail.gmail.com>
	<CAKFQuwYCf42_Gvf3pbyjgYzJ2-adS6j_hBgde+ORck2vXXKO5w@mail.gmail.com>
	<CAM+6J949waO2r35PDFJ65fy1Anc+oukOOy_CRw4wY65qiNc_2g@mail.gmail.com>
	<CAKFQuwY0SSLdm7KLmRVouXD_2=60-oOsdXfF56gx9n=bNhvWnw@mail.gmail.com>
	<[email protected]>
	<CAM+6J97N7RY0WQg2u8qiEUhOKPVgZ=fO835CYdRkGoJ3TzCJmw@mail.gmail.com>

On Sat, 19 Oct 2024 at 23:48, Vijaykumar Jain <
[email protected]> 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 <https://github.com/cabecada;


view thread (4+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: explain vs auto_explain
  In-Reply-To: <CAM+6J97kkL_EkCnK9weJLcxgJaTDPFJVV6EKq3Q1noV7JB8cnQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox