Re: Eh?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tod McQuillin <devin(at)spamcop(dot)net>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Eh?
Date: 2001-08-14 14:27:29
Message-ID: 17433.997799249@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tod McQuillin <devin(at)spamcop(dot)net> writes:
> This makes me wonder... in the case of a stored complex view, would it be
> helpful to ask PostgreSQL to spend extra time in query optimisation and
> then cache the result? Or does it do this already?

I don't see any value in caching plans for views as such. The planner
considers each query as a whole, which it has to do for performance.
Example:
create view v as select * from foo;
select * from v where bar = 42;
If there's an index on foo.bar, you'd want this query to use it, no?
So the plan has to be formed on the basis of the actual query; there's
no way to pull out the part for a view.

regards, tom lane

In response to

  • Re: Eh? at 2001-08-14 05:31:04 from Tod McQuillin

Browse pgsql-sql by date

  From Date Subject
Next Message Horst Herb 2001-08-14 14:34:33 how to use record type
Previous Message Jeff Eckermann 2001-08-14 13:40:41 Re: create function using language SQL