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
> -
For all that we know, it may already be happening. That looks like a
pretty reasonable optimization which may already be in place. If we
create a view:
mgogala=# select * from dept;
deptno | dname | loc
++--
10 | ACCOUNTING | NEW YORK
20 | RESEARCH
On Mon, 2 Aug 2021 at 19:53, Tom Lane wrote:
> Avi Weinberg writes:
> > Is there a way to compute a column in a view only if it is referenced in
> the query? I have a view's column that its value is computed by a
> function. If in the query that column is not used at all, can Postgres
> "skip"
Avi Weinberg writes:
> Is there a way to compute a column in a view only if it is referenced in the
> query? I have a view's column that its value is computed by a function. If
> in the query that column is not used at all, can Postgres "skip" computing it?
If the function is not volatile, an
Hi,
Is there a way to compute a column in a view only if it is referenced in the
query? I have a view's column that its value is computed by a function. If in
the query that column is not used at all, can Postgres "skip" computing it?
Thanks!
IMPORTANT - This email and any attachments is inte