Quote:
Originally Posted by dr_te_z
include columns are nice, but including each & every column? I am pretty sure that some columns are never part of a "where" or "join on" clause and that is where the include kicks-in, right?
|
As already mentioned by Knut, db2advis tends to favor "index only access" to avoid reading the table page, so that is one reason why they recommend a lot of wide indexes.
Personally, I find that db2advis does not produce optimum solutions for varied workloads. The biggest danger to watch out for is when db2advis recommends creating a lot of very similar indexes, when one compromise index would be much better in terms of overall performance and storage costs (db2advis does not like to compromise). db2advis doesn't automatically take into account things like the cost of insert, update, or delete statements to maintain the data, nor does it consider other select statements unless they are included in the same workload.
db2advis is sometimes a good tool used to suggest an index for a very complex (and poorly written) SQL statement, where it is not so obvious what index should be created to optimize it, but I don't take the recommendations as gospel. It is also useful for novices who can't intuitively understand what indexes would be required to optimize even a relative simple SQL.