Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id EEF05475EE4 for ; Tue, 14 Jan 2003 13:42:52 -0500 (EST) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by postgresql.org (Postfix) with ESMTP id 5A4D9475E10 for ; Tue, 14 Jan 2003 13:42:52 -0500 (EST) Received: from [66.219.92.2] (HELO chocolate-mousse) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 2313566; Tue, 14 Jan 2003 10:42:54 -0800 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Tomasz Myrta , PgSQL Performance ML Subject: Re: complicated queries in pl/pgsql Date: Mon, 13 Jan 2003 10:44:50 -0800 X-Mailer: KMail [version 1.4] References: <3E23EC83.9060802@klaster.net> In-Reply-To: <3E23EC83.9060802@klaster.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200301131044.50424.josh@agliodbs.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/104 X-Sequence-Number: 751 Tomasz, > What happens to view planning - is it performed=20 > during view creation, or rather each time view is quered? Each time the view is executed. The only savings in running a view over a= =20 regular query is that the view will have taken care of some reference=20 expansion and JOIN explication during the CREATE process, but not planning.= =20=20 Also, views can actually be slower if the view is complex enough that any= =20 query-time parameters cannot be "pushed down" into the view. --=20 -Josh Berkus Aglio Database Solutions San Francisco