![]() | |
#11
| ||||
| ||||
|
|
Michel, I've seen LIKE and UPPER to be very slow on UTF8 databases. |

|
You still do a LIKE in the second query, but I'd still be interested in the results of CPU usage of select count(*) from ASSET_SW_ID where upper(SW_NAME) like '%ACROBAT%' |
|
versus select count(*) from ASSET_SW_ID where SW_NAME like '%ACROBAT%' |
|
Plus, take the execution plans of those two and look at the cardinality... DB2 makes assumptions on the filter factor of functions that are the same for all functions, and if that applies here then the filter factor is 0.04 for the predicate "upper() like '%... %'" (operator 5 on the first explain plan). |
...
#12
| |||
| |||
|
|
As far as I understand, you need the UPPER()? Have you thought about a generated column? ALTER TABLE ASSET.TBL_ASSET_SW_ID ADD COLUMN SW_NAME_UPPER_GEN VARCHAR(100) GENERATED ALWAYS AS UPPER(SW_NAME) (use whatever appropriate instead of VARCHAR(100)) You shouldn't even have to change the query, because DB2 will automatically chose the generated column. Be careful though that IDENTITY and GENERATED columns are a pain when using db2move, if you don't know how to deal with them.- Hide quoted text - - Show quoted text - |
.
#13
| |||
| |||
|
|
Also, creating this new column would make me change several parts of my application to read it. This is, of course, time and developemnt resouce consuming . |
![]() |
| Thread Tools | |
| Display Modes | |
| |