Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 12401 invoked from network); 27 Aug 2007 14:33:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Aug 2007 14:33:51 -0000 Received: (qmail 25575 invoked by uid 500); 27 Aug 2007 14:33:47 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 25543 invoked by uid 500); 27 Aug 2007 14:33:47 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 25534 invoked by uid 99); 27 Aug 2007 14:33:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Aug 2007 07:33:47 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Aug 2007 14:33:50 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9366171420D for ; Mon, 27 Aug 2007 07:33:30 -0700 (PDT) Message-ID: <10313490.1188225210592.JavaMail.jira@brutus> Date: Mon, 27 Aug 2007 07:33:30 -0700 (PDT) From: "Teresa Kan (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Updated: (OPENJPA-338) Remove unnecessary CAST in SQL statement for DB2 In-Reply-To: <8693359.1188224854730.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Teresa Kan updated OPENJPA-338: ------------------------------- Attachment: OPENJPA338-comparsion.txt Attach the comparsion file between original generated SQL statements and the converted SQL statements. > Remove unnecessary CAST in SQL statement for DB2 > ------------------------------------------------ > > Key: OPENJPA-338 > URL: https://issues.apache.org/jira/browse/OPENJPA-338 > Project: OpenJPA > Issue Type: Improvement > Components: sql > Affects Versions: 1.0.0 > Environment: Window XP, JDK 1.5 > Reporter: Teresa Kan > Fix For: 1.0.1 > > Attachments: OPENJPA-338.patch, OPENJPA338-comparsion.txt > > > There were unnecessary CAST added to the SQL statements that can be removed to improve the performance. The change will eliminate the CAST for the constants. For example, the original query is : > Executing query: select d from DogABS d where LENGTH(d.name) < 10 > The current generated SQL statement: > executing prepstmnt 1335250838 SELECT t0.id2, t0.datastoreid, t0.domestic, t0.name, t0.price, t0.total FROM DOGABS t0 WHERE (CAST(LENGTH(CAST(t0.name AS VARCHAR(1000))) AS BIGINT) < CAST(? AS BIGINT)) [params=(long) 10] > After the changes: > executing prepstmnt 1749706826 SELECT t0.id2, t0.datastoreid, t0.domestic, t0.name, t0.price, t0.total FROM DOGABS t0 WHERE (LENGTH(t0.name) < ?) [params=(long) 10] -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.