db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mamta A. Satoor (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-4346) LIKE with parameter recomputes greaterEqualString and lessThanString way too often
Date Sun, 30 Sep 2012 01:14:07 GMT

     [ 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:
>            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

View raw message