简体   繁体   中英

Does iSeries DB2 have good optimizer?

MS SQL developer wading into iSeries DB2 here.

I was asked to re-write some report SQL queries taking forever to run and they are enormous, joining dozens of tables etc.

However when I approached it by using typical MS SQL optimization steps, such as replacing NOT EXISTS with joins, I did not initially see any improvement. Should I bother or the optimizer is taking care of the obvious things like that?

DB/2 is completely different than MS SQL and I wouldn't expect many hand optimizations to make the same impact.

There are a number of factors related to DB/2 performance and optimization. I would suggest starting with the documentation about optimizing query performance using query optimization tools .

Running your query through Visual Explain , for example, should provide a clearer answer.


IBM i Access for Windows ODBC performance

Perhaps the most obvious thing to check is to make sure you have good indexes for your joins. If not then create them. Indexes have much less performance impact on DB2 for i.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM