hi all,
One of my customer having warehouse database running on DB2. Recently
when they execute the following query at db2 command line
the exepected result take ages before return result
select count(*) from dss.fncsvcar where ar_id no in (select ar_id from
dss.ar)
Both tables ar_id is not a key field. However, indexes are created
the following order
fncsvcar
--------
create index dss.fncsvcaridx on dss.fncsvcar(ar_id asc);
ar
---
create unique index dss.aridx on dss.ar(ar_id asc);
The fncsvcar table has 3 million records and ar table has 7 million
records. Is there any other way to improve this query?
Thanks
Uthuras