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 "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2010/04/06 11:05:33 UTC

[jira] Created: (DERBY-4608) Unnecessary conversion of binary values to strings in SQLBinary.compare()

Unnecessary conversion of binary values to strings in SQLBinary.compare()
-------------------------------------------------------------------------

                 Key: DERBY-4608
                 URL: https://issues.apache.org/jira/browse/DERBY-4608
             Project: Derby
          Issue Type: Improvement
          Components: SQL
    Affects Versions: 10.5.3.0
            Reporter: Knut Anders Hatlen
            Assignee: Knut Anders Hatlen


SQLBinary.compare(int,DataValueDescriptor,boolean,boolean) converts the values to strings in order to check whether any of them are null. The isNull() method should be used instead to prevent the unnecessary conversion to strings.

See this thread on derby-user: http://mail-archives.apache.org/mod_mbox/db-derby-user/201003.mbox/%3C001801cad09b$09aef650$1d0ce2f0$@ru%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4608) Unnecessary conversion of binary values to strings in SQLBinary.compare()

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12853985#action_12853985 ] 

Bryan Pendleton commented on DERBY-4608:
----------------------------------------

The patch looks good to me, thanks for tracking this down.

I don't particularly care for the wording of the THROWASSERT
in SQLBinary.java just prior to your change, but of course that's
entirely unrelated, just something that struck my eye while
reading your patch.

+1 to your patch, which looks thorough and complete.


> Unnecessary conversion of binary values to strings in SQLBinary.compare()
> -------------------------------------------------------------------------
>
>                 Key: DERBY-4608
>                 URL: https://issues.apache.org/jira/browse/DERBY-4608
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.5.3.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: isnull.diff
>
>
> SQLBinary.compare(int,DataValueDescriptor,boolean,boolean) converts the values to strings in order to check whether any of them are null. The isNull() method should be used instead to prevent the unnecessary conversion to strings.
> See this thread on derby-user: http://mail-archives.apache.org/mod_mbox/db-derby-user/201003.mbox/%3C001801cad09b$09aef650$1d0ce2f0$@ru%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DERBY-4608) Unnecessary conversion of binary values to strings in SQLBinary.compare()

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4608?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen resolved DERBY-4608.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.6.0.0

Thanks Bryan! All the regression tests ran cleanly, so I committed the patch with revision 931189.

The wording of the THROWASSERT struck me too as somewhat too colourful. I'll try to come up with something more neutral and change that too.

> Unnecessary conversion of binary values to strings in SQLBinary.compare()
> -------------------------------------------------------------------------
>
>                 Key: DERBY-4608
>                 URL: https://issues.apache.org/jira/browse/DERBY-4608
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.5.3.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>             Fix For: 10.6.0.0
>
>         Attachments: isnull.diff
>
>
> SQLBinary.compare(int,DataValueDescriptor,boolean,boolean) converts the values to strings in order to check whether any of them are null. The isNull() method should be used instead to prevent the unnecessary conversion to strings.
> See this thread on derby-user: http://mail-archives.apache.org/mod_mbox/db-derby-user/201003.mbox/%3C001801cad09b$09aef650$1d0ce2f0$@ru%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-4608) Unnecessary conversion of binary values to strings in SQLBinary.compare()

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4608?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4608:
--------------------------------------

    Attachment: isnull.diff

The attached patch makes SQLBinary.compare() use isNull() instead of getString(). It also changes the HeapScan performance test so that it can run tests with binary strings instead of character strings, and adds a test case that uses predicates. When running the test case with predicates on binary data, the fix in SQLBinary reduces the time per iteration from 30 seconds to 5-6 seconds on my laptop.

Running the full regression test suite now.

> Unnecessary conversion of binary values to strings in SQLBinary.compare()
> -------------------------------------------------------------------------
>
>                 Key: DERBY-4608
>                 URL: https://issues.apache.org/jira/browse/DERBY-4608
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.5.3.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: isnull.diff
>
>
> SQLBinary.compare(int,DataValueDescriptor,boolean,boolean) converts the values to strings in order to check whether any of them are null. The isNull() method should be used instead to prevent the unnecessary conversion to strings.
> See this thread on derby-user: http://mail-archives.apache.org/mod_mbox/db-derby-user/201003.mbox/%3C001801cad09b$09aef650$1d0ce2f0$@ru%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.