X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id F005E9DC81F for ; Thu, 2 Mar 2006 12:19:37 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 00815-03 for ; Thu, 2 Mar 2006 12:19:36 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.195]) by postgresql.org (Postfix) with ESMTP id AD1D79DC812 for ; Thu, 2 Mar 2006 12:19:35 -0400 (AST) Received: by xproxy.gmail.com with SMTP id t15so289051wxc for ; Thu, 02 Mar 2006 08:19:35 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:user-agent:mime-version:to:subject:content-type:content-transfer-encoding; b=Jtqpf8C5jx4U3AWjUJePXgPv8T2/ErFOxkymE9PVInMlvRFfAauMW6IHB+eDtTkaj4y45A0C5MjMsS/v71YGk1c76tDWHq4kTQu9Z/7pEm/gOjV6Y3cOMbS6E6N1KK7192xhxA2KcMTsJlT5yRW4Etm7lyzaRtu9X/5YmHxImcs= Received: by 10.70.29.4 with SMTP id c4mr3461053wxc; Thu, 02 Mar 2006 08:19:35 -0800 (PST) Received: from ?192.168.0.100? ( [71.162.121.152]) by mx.gmail.com with ESMTP id h34sm1935351wxd.2006.03.02.08.19.34; Thu, 02 Mar 2006 08:19:34 -0800 (PST) Message-ID: <44071B14.4060906@gmail.com> Date: Thu, 02 Mar 2006 11:19:32 -0500 From: "Chaz." Reply-To: eprparadocs@gmail.com User-Agent: Mail/News 1.5 (X11/20060206) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Question about Sql SELECT and optimizer Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200603/49 X-Sequence-Number: 24395 I am trying to understand something I have seen happen. I had a select that looked like: select f(A) from A, B, C where g(A) Where f(A) is the select that only depends on table A; g(A) is the where part that only depends on table A. What I saw happen was the optimizer will waste a lot of time (seconds!) bringing in table B and C. I was wondering why doesn't the optimizer drop references to tables B and C since they aren't used any where? Peace and thanks in advance Chuck Wegrzyn