Return-Path: X-Original-To: apmail-db-derby-user-archive@www.apache.org Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CEFFAF4F0 for ; Thu, 4 Apr 2013 18:10:51 +0000 (UTC) Received: (qmail 21646 invoked by uid 500); 4 Apr 2013 18:10:51 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 21579 invoked by uid 500); 4 Apr 2013 18:10:50 -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 21568 invoked by uid 99); 4 Apr 2013 18:10:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Apr 2013 18:10:50 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of john.foreign@gmail.com designates 209.85.214.52 as permitted sender) Received: from [209.85.214.52] (HELO mail-bk0-f52.google.com) (209.85.214.52) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Apr 2013 18:10:43 +0000 Received: by mail-bk0-f52.google.com with SMTP id it16so1667497bkc.39 for ; Thu, 04 Apr 2013 11:10:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=80SWAPtSQN+rwtLLGbsbFkHAhzxidkJglB51M2u8Tto=; b=0PZ+8UoJGD1VwZNSPQkl4LqFIIaJ5CbX52pTjH4uAHEgLAYfn/Ltjf+fRvmznaxg36 D28JAh74o8Epw4ZbQ4tV63+j/jYrDLhXOTbv2mknsw4qar85P2Dqi4IZHWCGmWKUNnuY TysyQKbCZxvwluT5XchJdj9ZfpTWMzGAx/scfbwuygav5aV15pVMAxGGAOY1G8wGygqI o+YXMHqipGyu1lpFYaL2Sw8/fiMJ7/VRyY2wPfEIzNWdTHBEd4diz4A2rv4Ub4+CZuuz DBKVkNAyDL8scAzgaQI47pn93FoSU3nuSXFhBh5XC86KHPzq8heBTcdhMwCHmLb5TwH3 eAUg== X-Received: by 10.204.201.1 with SMTP id ey1mr5144202bkb.110.1365099022758; Thu, 04 Apr 2013 11:10:22 -0700 (PDT) Received: from [192.168.1.100] (bzq-84-111-131-91.red.bezeqint.net. [84.111.131.91]) by mx.google.com with ESMTPS id b21sm6800477bkw.12.2013.04.04.11.10.19 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Apr 2013 11:10:21 -0700 (PDT) Message-ID: <515DC201.9010103@gmail.com> Date: Thu, 04 Apr 2013 21:10:09 +0300 From: John English User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 To: derby-user@db.apache.org Subject: Re: Peculiar sorting behaviour? References: <515AA74D.3030507@gmail.com> <87d2ud0wvn.fsf@oracle.com> In-Reply-To: <87d2ud0wvn.fsf@oracle.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 02/04/2013 18:34, Knut Anders Hatlen wrote: > My guess is that it's the sort avoidance code that somehow gets confused > into thinking the result is already in the correct order and that the > sorting could be skipped. My hunch is that it might also have to do with the fact that the ITEM_USAGE table has a composite primary key. I've now found two queries where this particular table sorts wrongly, but no other cases. Anybody got any thoughts whether this might be a factor? -- John English