X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 14229DB0D4 for ; Thu, 27 Oct 2005 12:09:43 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 80389-03 for ; Thu, 27 Oct 2005 15:09:38 +0000 (GMT) Received: from cicero2.cybercity.dk (cicero2.cybercity.dk [212.242.40.53]) by svr1.postgresql.org (Postfix) with ESMTP id C731ADB0C1 for ; Thu, 27 Oct 2005 12:09:37 -0300 (ADT) Received: from [192.168.0.79] (0x3e42eeca.adsl.cybercity.dk [62.66.238.202]) by cicero2.cybercity.dk (Postfix) with ESMTP id C1FE1190099; Thu, 27 Oct 2005 17:09:34 +0200 (CEST) Message-ID: <4360EDE5.9050400@krap.dk> Date: Thu, 27 Oct 2005 17:10:29 +0200 From: Svenne Krap User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: pgsql-performance@postgresql.org Subject: Re: Perfomance of views References: <435FA002.4060509@krap.dk> <43609EF4.8060907@archonet.com> <4360B375.8000303@krap.dk> <18899.1130423882@sss.pgh.pa.us> In-Reply-To: <18899.1130423882@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200510/421 X-Sequence-Number: 15189 Tom Lane wrote: >There's been some discussion of inline-expanding SQL functions that >return sets when they are called in FROM, which would make a SQL >function that contains just a SELECT effectively equivalent to a view >as far as the planner's powers of optimization go. No one's tried to >make it happen yet though. > > This is exactly what would be brilliant in my case. Use the functions as a kind of strict, parameterized views, that in the planner (or wherever) gets replaced down to a simple (?!?!) sql-statement. This would imho be highly valuable for almost any kind of complex time-travel application (and surely dozens of other applications). And before anyone suggests it, I don't code C well enough (*cough* rusty) to try to do it myself. I would apriciate if it went on the todo for 8.2 though. (I might even be willing to sponsor some money (a single or perhpas two thousands of US dollars) for getting it done and release it immediately under postgresql standard license (BSD)). I by the way also support the idea of a way to force a table into a PgSQL managed cache like discussed a while ago. Sometimes overall speed for the system is less important than speed of a single query. I must also say, that I am very impressed with the performance enhancements of 8.1 beta, the bitmap index scans are amazing ! Good job, guys - PgSQL has come a far way from 7.0 (where I started) and the future looks bright ;) Svenne