db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: Language based ordering is possible in Derby
Date Thu, 03 Nov 2005 15:20:49 GMT
Edson Carlos Ericksson Richter wrote:


> Probably, the most important are that using large tables with "order by
> SOME_FUNCTION(some_col)" could not be optimized unless you could index
> as "create index IDX_SOMETHING on MY_TABLE (SOME_FUNCTION(some_col))"
> too... Could Derby create and use indexes based on functions computing?
> I think using national character datatypes will give that kind of
> optimization, don't?

Yes, that's what is missing with the work around, the indexing, and as
you say function indexes would solve that.

If the national character types are enabled as before then a regular
index on a column of that type will sort in the order of the locale of
the database (set by the territory property on creation).

Functional indexes would allow case insensitive ordering as well through
upper/lower. Those functions are already localized to match the
database's locale.

create index IDX_SOMETHING on MY_TABLE (UPPER(name))

select * from my_table order by upper(name)

Dan.


Mime
View raw message