Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 67649 invoked from network); 12 Nov 2008 10:45:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Nov 2008 10:45:51 -0000 Received: (qmail 24519 invoked by uid 500); 12 Nov 2008 10:45:58 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 24487 invoked by uid 500); 12 Nov 2008 10:45:57 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 24476 invoked by uid 99); 12 Nov 2008 10:45:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2008 02:45:57 -0800 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [192.18.6.24] (HELO gmp-eb-inf-2.sun.com) (192.18.6.24) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Nov 2008 10:44:37 +0000 Received: from fe-emea-09.sun.com (gmp-eb-lb-2-fe3.eu.sun.com [192.18.6.12]) by gmp-eb-inf-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id mACAjHMN023756 for ; Wed, 12 Nov 2008 10:45:19 GMT Received: from conversion-daemon.fe-emea-09.sun.com by fe-emea-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0KA700501T4WD300@fe-emea-09.sun.com> (original mail from Knut.Hatlen@Sun.COM) for derby-user@db.apache.org; Wed, 12 Nov 2008 10:45:17 +0000 (GMT) Received: from localhost ([129.159.112.134]) by fe-emea-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0KA7009CHV77EJ50@fe-emea-09.sun.com> for derby-user@db.apache.org; Wed, 12 Nov 2008 10:45:07 +0000 (GMT) Date: Wed, 12 Nov 2008 11:45:06 +0100 From: Knut Anders Hatlen Subject: Re: Derby optimizer for Table Function In-reply-to: <20456636.post@talk.nabble.com> Sender: Knut.Hatlen@Sun.COM To: Derby Discussion Message-id: Organization: Sun Microsystems MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT References: <20456636.post@talk.nabble.com> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (usg-unix-v) X-Virus-Checked: Checked by ClamAV on apache.org Reda134 writes: > Hi all, > The Derby devoloppers mentions in the documentation of table functions, that > the optimizer takes 2 Assumtions : > > 1 - It Assumes by default that table functions are repeatable and thus place > them in the inner slot of a join. > > 2 - It Assumes by default that table functions are expensice and thus place > them in the outer slot of a join. > > Is this not paradoxal ?? Or i get it wrong ?? I assume you're talking about this section of the developer's guide: http://db.apache.org/derby/docs/10.4/devguide/cdevspecialtfoptimizer.html The clue here is that it doesn't say "thus place them in the [outer/inner] slot", but rather that it is _likely_ that the optimizer will place the table function in an outer slot and that the optimizer _can_ place it in an inner slot. If you for example join two table functions, only one of them can be in the outer slot. The other one will go in the inner slot. If none of them can go in the inner slot because they are not repeatable, one of them will be stored in a temporary table which can go in the inner slot. -- Knut Anders