Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t2EEb-002YIr-EC for pgsql-general@arkaria.postgresql.org; Sat, 19 Oct 2024 18:31:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t2EEZ-006Mnv-3f for pgsql-general@arkaria.postgresql.org; Sat, 19 Oct 2024 18:31:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t2EEY-006Mnl-Nc for pgsql-general@lists.postgresql.org; Sat, 19 Oct 2024 18:31:27 +0000 Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t2EES-001wUr-JT for pgsql-general@postgresql.org; Sat, 19 Oct 2024 18:31:26 +0000 Received: by mail-ej1-x644.google.com with SMTP id a640c23a62f3a-a9932aa108cso476083766b.2 for ; Sat, 19 Oct 2024 11:31:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729362678; x=1729967478; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=EI+LPvJ8+Oh6I1tfNqiqnHdIEwbCiKbm6qUyKESMp3E=; b=AH4I49K54xgDwA35WgqVIro0QFgp6/DqOD6I3rQhd5l3HX5g5EHcJXeqy5DnW8kafN h5BFu8I1ZCbCsmJhsnMTu0766tMZqs95ZOnWabtLQmCc2/D+Pw+GV+dG5If92e1NbvYn X2zjoV9MSHsw4kKRTYi1QSKJgshSZIXKuwQRWLBSB9lvS8fWbisRVT36rFRXVQvlxL80 fAALNens4dvWfYWaLDVcMyP6Qc4NtRoAmhJJlsr64pjujYL4UYLzkCHPgqbCxgvxykHZ nN2a5S1SuVgM/RKpMAFHCW3qyWeuhYml3lwzMdHTofGtfq41cUcIzap5h70KNU3b/dfK 9oIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729362678; x=1729967478; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EI+LPvJ8+Oh6I1tfNqiqnHdIEwbCiKbm6qUyKESMp3E=; b=Xq6YfptdAcO1UanB4evsWZgzYeIwanUVkrKqaS8Pp8d19K2BWrYXjXAawjbRwca+ts fKV3yLymm+ySvmdOr7sTpjo7ZykV+rMpEZt+hNmYU2i06hfKqrr+Y7jnwkxaFmtop10D DwyHDzu9yh7zaTSokBt8a95q6gT1ZR1EFEqRWCWAh/Vn9U7fwrCTTqZG3YL0t94+MO9+ NwxajMITQU+Kmw90t+RCdzsUX65PAmgjcU4tJBIPzZFgev8BDjRH3qz5P8X0jTZktIG/ 9n55e/I7tiRQl+2NWvmzgyUp5ZLKv2WFkbNFxQ+dfBKPqW/IQCyzWYfhVECvtlvk28gl 3vxQ== X-Forwarded-Encrypted: i=1; AJvYcCWoO2EqAaB0YBf9KlILBPH4NE4c1sb49NdADzLa6I+4X7rnDM97icLVVbSgMg1HxRWHGpJfpALeqSk6RxBW@postgresql.org X-Gm-Message-State: AOJu0YxeO4ExfDAQVElZIZgOJJe68TTU0Fgj2M2fKrIQ0NrmNfIYUSuC oueiKBfOBg5pdHyMJNfF/QqgQzs1SrV3Mu23JE34uHEvJYFRam6+Vn9pJsOWYJINjZ3QpfnYr8j nncCHOlaL0IEd7fmsDWFDVtMYZFw= X-Google-Smtp-Source: AGHT+IHkrS096WsVj7kRmnScYGHBikwrYlRsVGNMop+wE29Hn2ezUtzeMdMu7w2MKaT04/HUxnvzQl8vh8nqxUb14c4= X-Received: by 2002:a17:907:9623:b0:a9a:90c:8bc with SMTP id a640c23a62f3a-a9a6996989dmr590659066b.12.1729362678153; Sat, 19 Oct 2024 11:31:18 -0700 (PDT) MIME-Version: 1.0 References: <1128627.1729360916@sss.pgh.pa.us> In-Reply-To: From: Vijaykumar Jain Date: Sun, 20 Oct 2024 00:01:07 +0530 Message-ID: Subject: Re: explain vs auto_explain To: Tom Lane Cc: "David G. Johnston" , pgsql-general Content-Type: multipart/alternative; boundary="0000000000001e91120624d8a096" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001e91120624d8a096 Content-Type: text/plain; charset="UTF-8" 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 --0000000000001e91120624d8a096 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


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


ok, it makes sense for the re= ason of having auto_explain. but maybe i did ask correctly,=C2=A0
why do we not have the extended flags in auto_explain , in , explain wrt n= ested_statements, and triggers ...
a user who finds the console o= utput complicated, could well use a pager or redirect the output to the fil= e via \o which is client side.

=C2=A0
actually my bad. pls ignore.

i forgot we could leverage client_min_messages to get the output to conso= le=C2=A0

/*
postgres=3D# explain analyze= create materialized view mv as select * from t;
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 QUERY PLAN
---------------------------------------------------------------------= --------------------------
=C2=A0Seq Scan on t=C2=A0 (cost=3D0.00= ..35.50 rows=3D2550 width=3D4) (actual time=3D0.027..0.028 rows=3D0 loops= =3D1)
=C2=A0Planning Time: 0.549 ms
=C2=A0Execution Tim= e: 7.309 ms
(3 rows)

=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0^
postgres=3D# explain analyze refresh= materialized view mv;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 QUERY PLAN
----------------------------------------= ---
=C2=A0Utility statements have no plan structure
(1 = row)

postgres=3D# alter system set client_min_mess= ages TO log;
ALTER SYSTEM
postgres=3D# select pg_reload= _conf();
=C2=A0pg_reload_conf
----------------
=C2=A0t
(1 row)

postgres=3D# refresh m= aterialized view
postgres-# mv ;
LOG:=C2=A0 duration: 0= .016 ms=C2=A0 plan:
Query Text: refresh materialized view
mv ;
Seq Scan on public.t=C2=A0 (cost=3D0.00..35.50 rows=3D255= 0 width=3D4) (actual time=3D0.009..0.009 rows=3D0 loops=3D1)
=C2= =A0 Output: col1
REFRESH MATERIALIZED VIEW
*/


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

<= /div>
Open to work
Resume -=C2=A0Vijaykumar Jain
--0000000000001e91120624d8a096--