Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id AC4D447606A for ; Mon, 6 Jan 2003 05:59:38 -0500 (EST) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by postgresql.org (Postfix) with ESMTP id 17A43475C98 for ; Mon, 6 Jan 2003 05:59:38 -0500 (EST) Received: from klaster.net (pa236.krakow.cvx.ppp.tpnet.pl [213.76.36.236]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 51AD12B21C for ; Mon, 6 Jan 2003 11:58:10 +0100 (CET) Message-ID: <3E196277.5020904@klaster.net> Date: Mon, 06 Jan 2003 12:03:19 +0100 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.2b) Gecko/20021016 X-Accept-Language: en-us, en MIME-Version: 1.0 To: PgSQL Performance ML Subject: views vs pl/pgsql Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/32 X-Sequence-Number: 679 Hi 1. I have plpgsql function having only one query returning 1 value. This query joins some tables. I read, that plpgsql function saves execution plan for all queries inside one database connection. 2. Instead of this I can create a view returning one row. How does postgres work with views? When the plan is being created? What happens to views which don't have explicit joins? What happens if I create index on tables after creating a view? Which one is better and when? Regards, Tomasz Myrta