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 7F58ED7758 for ; Thu, 27 Oct 2005 12:45:45 -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 92654-03 for ; Thu, 27 Oct 2005 15:45:43 +0000 (GMT) Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by svr1.postgresql.org (Postfix) with ESMTP id 4B651D76B8 for ; Thu, 27 Oct 2005 12:45:43 -0300 (ADT) Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 891B841BB54; Thu, 27 Oct 2005 16:45:30 +0100 (BST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id 856CA15ED5; Thu, 27 Oct 2005 16:40:53 +0100 (BST) Received: from mainbox.archonet.com ([127.0.0.1]) by localhost (mainbox [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 12820-10; Thu, 27 Oct 2005 16:40:47 +0100 (BST) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id DF24215EE1; Thu, 27 Oct 2005 16:40:39 +0100 (BST) Message-ID: <4360F4F7.8070503@archonet.com> Date: Thu, 27 Oct 2005 16:40:39 +0100 From: Richard Huxton User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jan Wieck Cc: Svenne Krap , 'Postgresql Performance' Subject: Re: Perfomance of views References: <435FA002.4060509@krap.dk> <43609EF4.8060907@archonet.com> <4360AE59.6010209@krap.dk> <4360BA22.5050606@archonet.com> <4360D906.3060504@Yahoo.com> In-Reply-To: <4360D906.3060504@Yahoo.com> 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.058 required=5 tests=[AWL=0.008, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200510/423 X-Sequence-Number: 15191 Jan Wieck wrote: > On 10/27/2005 7:29 AM, Richard Huxton wrote: >> Svenne Krap wrote: >> >>> What do you mean exactly but "pushing conditions inside" ? >> >> If I have something like "SELECT * FROM complicated_view WHERE foo = >> 7" then the planner can look "inside" complicated_view and see where >> it can attach the condition "foo=7", rather than running the query and >> applying the condition at the end. > > Sorry, but the planner doesn't attach the condition anywhere. It is the > rewriter that takes the actual query, replaces the views rangetable and > expression entries with the actual underlying objects and adds the views > condition with an AND to the queries condition. Simply example: Thanks for the correction Jan. -- Richard Huxton Archonet Ltd