Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7EERbP29883 for ; Tue, 14 Aug 2001 10:27:37 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id f7EERTY17436; Tue, 14 Aug 2001 10:27:29 -0400 (EDT) To: Tod McQuillin cc: Josh Berkus , pgsql-sql@postgresql.org Subject: Re: Eh? In-reply-to: References: Comments: In-reply-to Tod McQuillin message dated "Tue, 14 Aug 2001 00:31:04 -0500" Date: Tue, 14 Aug 2001 10:27:29 -0400 Message-ID: <17433.997799249@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200108/191 X-Sequence-Number: 4416 Tod McQuillin 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