X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 477DE8B9E4A for ; Thu, 3 Feb 2005 03:30:24 +0000 (GMT) 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 68633-01 for ; Thu, 3 Feb 2005 03:30:17 +0000 (GMT) Received: from mailhub2.une.edu.au (mailhub.une.edu.au [129.180.1.142]) by svr1.postgresql.org (Postfix) with ESMTP id 48F828B9E43 for ; Thu, 3 Feb 2005 03:30:19 +0000 (GMT) Received: from icarus.une.edu.au (icarus.une.edu.au [129.180.47.120]) by mailhub2.une.edu.au (Postfix) with ESMTP id 48DD37F69; Thu, 3 Feb 2005 14:30:18 +1100 (EST) Received: from kgb ([129.180.47.225]) by icarus.une.edu.au (8.12.8/8.12.8) with SMTP id j133UHT4002666; Thu, 3 Feb 2005 14:30:17 +1100 Date: Thu, 03 Feb 2005 14:31:35 +1100 From: Klint Gore To: Gaetano Mendola Cc: pgsql-performance@postgresql.org Subject: Re: horizontal partition In-Reply-To: References: <200502021209.06878.josh@agliodbs.com> Message-Id: <42019B1735F.1271KG@129.180.47.120> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver 1.25.06 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/45 X-Sequence-Number: 10374 On Thu, 03 Feb 2005 02:10:15 +0100, Gaetano Mendola wrote: > why the index usage is lost if used in that way ? This is how I interpret it (if anyone wants to set me straight or improve on it feel free) Views are implemented as rules. Rules are pretty much just a macro to the query builder. When it sees the view, it replaces it with the implementation of the view. When you join a view to a table, it generates a subselect of the implementation and joins that to the other table. So the subselect will generate the entire set of data from the view before it can use the join to eliminate rows. I would like a way to make this work better as well. One of my views is 32 joins of the same table (to get tree like data for reports). klint. +---------------------------------------+-----------------+ : Klint Gore : "Non rhyming : : EMail : kg@kgb.une.edu.au : slang - the : : Snail : A.B.R.I. : possibilities : : Mail University of New England : are useless" : : Armidale NSW 2351 Australia : L.J.J. : : Fax : +61 2 6772 5376 : : +---------------------------------------+-----------------+