You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Mamta A. Satoor (JIRA)" <ji...@apache.org> on 2012/09/30 03:14:07 UTC

[jira] [Updated] (DERBY-4346) LIKE with parameter recomputes greaterEqualString and lessThanString way too often

     [ https://issues.apache.org/jira/browse/DERBY-4346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor updated DERBY-4346:
-----------------------------------

    Urgency: Normal
     Labels: derby_triage10_10  (was: )
    
> LIKE with parameter recomputes greaterEqualString and lessThanString way too often
> ----------------------------------------------------------------------------------
>
>                 Key: DERBY-4346
>                 URL: https://issues.apache.org/jira/browse/DERBY-4346
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.5.1.1
>            Reporter: Knut Anders Hatlen
>              Labels: derby_triage10_10
>
> I profiled a 7-way join (the exact query can be found here: http://src.opensolaris.org/source/xref/opengrok/trunk/src/org/opensolaris/opengrok/history/JDBCHistoryCache_queries.properties?r=809%3Abdef8b63f333#82 ) and saw that 40% of the time was spent in Like.greaterEqualStringFromParameterWithEsc() and Like.lessThanStringFromParameterWithEsc().
> These methods are used to generate "x >= greaterEqualString" and "x < lessThanString" clauses that enable a "LIKE ?" clause to make use of indexes. Since the value of the ? parameter is constant throughout a single execution of the statement, it should only be necessary to invoke these methods once per LIKE clause per execution. They are clearly called more frequently for the query in question, and reducing the number of invocations to one per execution would probably make the query execute almost twice as fast.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira