Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 56210 invoked from network); 15 Nov 2006 18:06:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Nov 2006 18:06:31 -0000 Received: (qmail 19639 invoked by uid 500); 15 Nov 2006 18:06:41 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 19501 invoked by uid 500); 15 Nov 2006 18:06:41 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 19492 invoked by uid 99); 15 Nov 2006 18:06:41 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Nov 2006 10:06:41 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [63.82.107.6] (HELO red.amberpoint.com) (63.82.107.6) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Nov 2006 10:06:28 -0800 Received: from [127.0.0.1] (bpendleton-dsk2.edgility.com [10.10.11.13]) by red.amberpoint.com (8.12.11/8.12.11) with ESMTP id kAFI67k9016457 for ; Wed, 15 Nov 2006 10:06:07 -0800 (PST) Message-ID: <455B570F.1000005@amberpoint.com> Date: Wed, 15 Nov 2006 10:06:07 -0800 From: Bryan Pendleton User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Optimizer Timeout question Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org I've been working my way through Army's awesome Wiki pages and learning a lot about the Optimizer. I'm doing this in the context of a problematic query of mine. I've got a question about how Optimizer Timeout works. See http://wiki.apache.org/db-derby/LanguageOptimize to set the context for this question. In particular, I'm interested in the interaction between the following code loop in SelectNode.optimize and the optimizer timeout mechanism: * Optimize this SelectNode */ while (optimizer.getNextPermutation()) { while (optimizer.getNextDecoratedPermutation()) { optimizer.costPermutation(); } } So here's the question: as I understand it, the Optimizer Timeout mechanism kicks in during optimizer.getNextPermutation(). But what if the "inner" while loop has a very large number of decorated permutations to cost for this particular pass through the outer loop? Shouldn't we be checking for timeout in the inner loop as well? thanks, bryan