X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id AB776D1B220 for ; Fri, 4 Jun 2004 15:12:50 -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 52327-02 for ; Fri, 4 Jun 2004 18:12:49 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 950D3D1B19D for ; Fri, 4 Jun 2004 15:12:43 -0300 (ADT) Received: (qmail 20815 invoked by uid 500); 4 Jun 2004 18:18:23 -0000 Date: Fri, 4 Jun 2004 13:18:23 -0500 From: Bruno Wolff III To: Christopher Dedels Cc: pgsql-sql@postgresql.org Subject: Re: dynamic rules? Message-ID: <20040604181823.GA20549@wolff.to> Mail-Followup-To: Christopher Dedels , pgsql-sql@postgresql.org References: <20040604161340.GA15526@wolff.to> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/37 X-Sequence-Number: 17982 On Fri, Jun 04, 2004 at 09:16:04 -0700, Christopher Dedels wrote: > Bruno, > > Thanks for the response. You should keep the discussion copied to the list as long as it is on topic. That way other people can help out. > I was wondering if I was possible to union the tables if necessary. So, if > I choose type=1 it selects from only the 'one' table and likewise with 2. > However, if I query type=1 or type=2 it will union the two and return the > results from both tables. That is a planner issue. I suspect that currently postgres won't be able to see that a union isn't necessary. However unless performance is a real problem for you, you are better off using simpler code to help maintainance.