There's too much code:
- You don't need COALESCE for comparison, as NULL always compares to unknown
- You don't need IS NULL in WHERE, this is automatically added by the optimizer
- Replace OREPLACE with OTRANSLATE (as CarlosAL already adviced in another thread)
- Replace LENGTH with the builtin CHAR_LENGTH
Seems some stats are missing, too, could you post the output of a HELP STATS visit;
And to see the actual resource usage you need access to the QueryLog (DBQL), in best case it's enbled on steplevel.
There's too much code:
- You don't need COALESCE for comparison, as NULL always compares to unknown
- You don't need IS NULL in WHERE, this is automatically added by the optimizer
- Replace OREPLACE with OTRANSLATE (as CarlosAL already adviced in another thread)
- Replace LENGTH with the builtin CHAR_LENGTH
Seems some stats are missing, too, could you post the output of a HELP STATS visit;
And to see the actual resource usage you need access to the QueryLog (DBQL), in best case it's enbled on steplevel.
Dieter