Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 91351 invoked from network); 5 Oct 2008 20:12:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Oct 2008 20:12:02 -0000 Received: (qmail 82088 invoked by uid 500); 5 Oct 2008 20:12:00 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 82056 invoked by uid 500); 5 Oct 2008 20:11:59 -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 82045 invoked by uid 99); 5 Oct 2008 20:11:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Oct 2008 13:11:59 -0700 X-ASF-Spam-Status: No, hits=2.1 required=10.0 tests=DNS_FROM_SECURITYSAGE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of peter.ondruska@gmail.com designates 209.85.146.176 as permitted sender) Received: from [209.85.146.176] (HELO wa-out-1112.google.com) (209.85.146.176) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 Oct 2008 20:10:57 +0000 Received: by wa-out-1112.google.com with SMTP id j37so1241614waf.23 for ; Sun, 05 Oct 2008 13:11:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=lso2cyifOHdlgTzZH1x6bcIDclA2wM3rL84rHzSx64M=; b=nnE9b3dVqBj4Hlw+oewF43iSewWH64TzjSR/X4e1/46onvKW9QSn7Mw+Is7XKfqKJ5 ClMepDYpH9j8/DrIIVyuvFpk8Am8i91gfnllHo+n3nRn9YKLwfA4b8FD7yNpTLoYVw4i 9vJlnuw/mLma9qP1YfGgzoOgBfJRJ9SFVFlgQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=cCGlAv/Y8tV6A1rU+sfcE8D24foxnaYJxkznlvYPS/4DhIzeu0E9WYhIlccNzVOBRe y6a/y2D0zCPsONfpWIAiu8isddqCNQpb3EExwEFsJW2HnXCg2oKWCmtWr2TrQs438S3Q /npgVNmFn9hGD5WA9S2Kw8youOkgHT8X9rg8Y= Received: by 10.115.90.1 with SMTP id s1mr4511455wal.51.1223237493092; Sun, 05 Oct 2008 13:11:33 -0700 (PDT) Received: by 10.115.106.9 with HTTP; Sun, 5 Oct 2008 13:11:33 -0700 (PDT) Message-ID: <4d2670740810051311x4a4762che62f7c456cd326c2@mail.gmail.com> Date: Sun, 5 Oct 2008 22:11:33 +0200 From: "=?WINDOWS-1252?Q?Peter_Ondru=9Aka?=" To: "Derby Discussion" Subject: Re: Perfroamnce of IN ( ... list ... ) statements In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_26506_22575521.1223237493086" References: X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_26506_22575521.1223237493086 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 < tdudgeon@informaticsmatters.com> 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 > > ------=_Part_26506_22575521.1223237493086 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
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 <tdudgeon@informaticsmatters.com> 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


------=_Part_26506_22575521.1223237493086--