You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Teresa Kan (JIRA)" <ji...@apache.org> on 2007/08/27 16:27:34 UTC

[jira] Created: (OPENJPA-338) Remove unnecessary CAST in SQL statement for DB2

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


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.


[jira] Updated: (OPENJPA-338) Remove unnecessary CAST in SQL statement for DB2

Posted by "Michael Dick (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dick updated OPENJPA-338:
---------------------------------

    Fix Version/s: 1.0.1

> 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
>            Assignee: Teresa Kan
>             Fix For: 1.0.1, 1.1.0
>
>         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.


[jira] Updated: (OPENJPA-338) Remove unnecessary CAST in SQL statement for DB2

Posted by "Teresa Kan (JIRA)" <ji...@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.


[jira] Resolved: (OPENJPA-338) Remove unnecessary CAST in SQL statement for DB2

Posted by "Kevin Sutter (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Sutter resolved OPENJPA-338.
----------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 1.0.1)
                   1.1.0

Resolved via svn revision 570240.

> 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
>            Assignee: Teresa Kan
>             Fix For: 1.1.0
>
>         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.


[jira] Assigned: (OPENJPA-338) Remove unnecessary CAST in SQL statement for DB2

Posted by "Kevin Sutter (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-338?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Sutter reassigned OPENJPA-338:
------------------------------------

    Assignee: Teresa Kan

> 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
>            Assignee: 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.


[jira] Updated: (OPENJPA-338) Remove unnecessary CAST in SQL statement for DB2

Posted by "Teresa Kan (JIRA)" <ji...@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: OPENJPA-338.patch

Attach the patch and end result conversion for DB2 in various SQL functions.

> 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
>
>
> 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.