Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 39157 invoked from network); 6 Oct 2008 09:05:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Oct 2008 09:05:35 -0000 Received: (qmail 11991 invoked by uid 500); 6 Oct 2008 09:05:31 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 11969 invoked by uid 500); 6 Oct 2008 09:05:31 -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 11955 invoked by uid 99); 6 Oct 2008 09:05:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Oct 2008 02:05:31 -0700 X-ASF-Spam-Status: No, hits=-0.9 required=10.0 tests=DNS_FROM_SECURITYSAGE,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gcaddu-derby-user@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Oct 2008 09:04:28 +0000 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1Kmm1W-0005Nz-Mz for derby-user@db.apache.org; Mon, 06 Oct 2008 09:05:02 +0000 Received: from host86-142-119-2.range86-142.btcentralplus.com ([86.142.119.2]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Oct 2008 09:05:02 +0000 Received: from tdudgeon by host86-142-119-2.range86-142.btcentralplus.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Oct 2008 09:05:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: derby-user@db.apache.org From: Tim Dudgeon Subject: Re: Perfroamnce of IN ( ... list ... ) statements Date: Mon, 06 Oct 2008 09:58:26 +0100 Lines: 55 Message-ID: References: <4d2670740810051311x4a4762che62f7c456cd326c2@mail.gmail.com> <20081005223644.7D2D75FB78@dbrack01.segel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: host86-142-119-2.range86-142.btcentralplus.com User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) In-Reply-To: <20081005223644.7D2D75FB78@dbrack01.segel.com> Sender: news X-Virus-Checked: Checked by ClamAV on apache.org derby@segel.com wrote: > There was an issue with earlier versions of Derby, that was supposed to > have been fixed. > > > > Even so, the performance of the IN clause where you have a large list is > going to be an issue in most databases. I'm running against 3 different databases. With Oracle and MySQL IN clause performance is satisfactory. With Derby it is not and its much faster to retrieve each row individually, which seems to indicate that something is amiss. Tim > > > > > > ------------------------------------------------------------------------ > > *From:* Peter Ondru�ka > [mailto:peter.ondruska@gmail.com] > *Sent:* Sunday, October 05, 2008 3:12 PM > *To:* Derby Discussion > *Subject:* Re: Perfroamnce of IN ( ... list ... ) statements > > > > What Derby version is it? > > How does it perform if you re-create index on foo_id column? > > > > p. > > On Sun, Oct 5, 2008 at 10:07 PM, Tim Dudgeon > > wrote: > > If I run a statement like this is Derby: > SELECT COL1, COL2 FROM FOO WHERE FOO_ID IN ( 1, 31, ..... 4567) > it seems unexpectedly slow. Its actually faster to retrieve each row > individually using a for loop that it is to use the IN ( .. list ... ) > clause. This seems strange. > > Thanks > > Tim > > >