[EMAIL PROTECTED] wrote:
> I have the following problem when requesting on a table with
> right index
> associated:
>
> if I request with an equal condition using UPPER on the
> constant (not the
> column name), the request is much more slow than the same
> with constant
> 'upperized'
>
>
>
> let's explain:
>
> Create table Tab1 (id integer , col1 varchar(10) )
>
> Create index Idx1 on Tab1 ( col1 asc )
>
> explain select col1 from Tab1 where col1 = upper('aaa') -->
> gives index scan
>
> explain select col1 from Tab1 where col1 = 'AAA' --> gives
> equal condition
> for index
>
> the workaround I made is to give upperized constant, but I have been
> surprised of such a behaviour.
I'm surprised too but I can't reproduce the problem with your example.
In version 7.3 as well as in version 7.4 both statements are executed
via index equal strategy (ok in 7.4 I have to use hints to force index
access because the tablescan on an empty table is as fast as an index
equal access).
Is this the real example or do you only use it for the explaination?
Which SAP DB version do you use?
Kind regards,
Holger
SAP Labs Berlin
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general