[
https://issues.apache.org/jira/browse/DERBY-2336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12478671
]
Daniel John Debrunner commented on DERBY-2336:
----------------------------------------------
I'm just looking at options and as you say at the moment the need is one per
database, but at some point it will be per-something else, maybe schema, maybe
column, maybe index column. I think it's worth looking at possibilities now to
see if general solution can exist.
Some of the issue is that currently a single format identifier and hence single
object specifies the data type and partially specifies the comparision logic.
For ascending/descending the format id does not specifiy the comparision logic,
I guess instead the performance hit is taken on every compare if the
comparision is descending and thus the comparison value needs to be switched.
Java took the path of separating the two, e.g. SortedMap objects use a
Comparator interface.
One option is to take that path and make sure enough meta-data exists to create
a correct Comparator like object.
This would change the logic for comparisions to be:
comparator.compare(v1, v2)
instead of today's
v1.compare(v2)
The comparator does look more expensive but the ascending/descending logic
could be in the comparator, thus removing that check for the typical ascending
case.
> Enable collation based ordering for CHAR data type.
> ---------------------------------------------------
>
> Key: DERBY-2336
> URL: https://issues.apache.org/jira/browse/DERBY-2336
> Project: Derby
> Issue Type: Sub-task
> Components: SQL
> Affects Versions: 10.3.0.0
> Reporter: Mamta A. Satoor
> Attachments: DERBY_LocalFinder_CodeCleanup_diff_V01.txt,
> DERBY_LocalFinder_CodeCleanup_stat_V01.txt
>
>
> I am breaking down the Parent task DERBY-1478 (Add built in language based
> ordering and like processing to Derby) into multiple sub tasks. One of them
> is to concentrate on enabling the collation based ordering on (hopefully the
> simplest of all the character data types) CHAR data type. This task in itself
> might need subtasks if it is later found that it can be subdivided into
> multiple smaller steps.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.