Functions messing up with the optimizer calc
Do functions like trim,upper,lower,etc.. on sqls instructions mess up with
the optimizer cost calculations or best path definition?
I'm having a serious performance problem in my production environment, and
I think the problem is:
in a sql like that:
select text1 from table1
where trim(text1='T111')
I got a sequential scan on the table.
but if I change the command to this:
select text1 from table1
where text1[1,4]='T111'
I got an index path scan.
The table I'm querying have more than a thousand rows and a bunch of
columns. This query is driving my server nuts!! Sometimes I get uptime
values over than 9.0 !! Often these values are about 0.9.
Is there any workaround (via parameters on env vars) that I can do?
PS: INFORMIX 7.31UD1 - Linux - Redhat 8.0
OPTCOMPIND=2 (onconfig)
Thanks in advance,
Julio Cesar
sending to informix-list
|