Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mAhWL-0004tC-32 for pgsql-general@arkaria.postgresql.org; Mon, 02 Aug 2021 23:38:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mAhWI-0002TS-Ui for pgsql-general@arkaria.postgresql.org; Mon, 02 Aug 2021 23:38:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mAhWI-0002SZ-Lg for pgsql-general@lists.postgresql.org; Mon, 02 Aug 2021 23:38:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mAhWG-0004bz-Bn for pgsql-general@lists.postgresql.org; Mon, 02 Aug 2021 23:38:54 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 172NcnQZ1661402; Mon, 2 Aug 2021 19:38:49 -0400 From: Tom Lane To: Mladen Gogala cc: pgsql-general@lists.postgresql.org Subject: Re: Lazy View's Column Computing In-reply-to: <65c04e3a-ca63-166c-8689-9c8cd89d972f@gmail.com> References: <65c04e3a-ca63-166c-8689-9c8cd89d972f@gmail.com> Comments: In-reply-to Mladen Gogala message dated "Mon, 02 Aug 2021 19:27:02 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1661400.1627947529.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Mon, 02 Aug 2021 19:38:49 -0400 Message-ID: <1661401.1627947529@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Mladen Gogala writes: > The query from the view would probably merge view  with the original and > optimize everything as a single query. Unfortunately, there is no way to > tell: > mgogala=# explain select ename,job,sal from acct_view; >                      QUERY PLAN > ---------------------------------------------------- >  Seq Scan on emp  (cost=0.00..1.18 rows=3 width=21) >    Filter: (deptno = 10) > (2 rows) > The only tool that you have at your disposal is EXPLAIN. No ... EXPLAIN VERBOSE would fill in the detail you want, as somebody else already demonstrated in this thread. regards, tom lane