I'm not sure where you've read that NLEVELS above three would be
concidered bad, but I don't think a value of four is extreme in any way.
You might want to have a look at how a B-TREE index is constructed (see
for example
http://en.wikipedia.org/wiki/B-tree), but I'll try to give
you some idea.
An index always start of with a root node, the root node can address a
certain number of child nodes, the children of the root node can in
their turn address a number of grandchild nodes for the root, etc. The
leaf nodes finally address data pages in the table (RID LIST).
The height (NLEVELS) of the tree can be said to be determined by two things:
a) The number of data pages in the table (SYSCAT.TABLES.CARD)
b) How well the index discriminates the data pages
(SYSCAT.INDEXES.FULLKEYCARD)
A huge table with an index with low FULLKEYCARD will have a small
NLEVELS value, but it will usually be a bad index. One of the reasons is
that every leaf page in the index will have a big rid list, so an update
of the index will affect a lot of entries in the rid list.
I don't think it will be a good strategy to try to minimize NLEVELS for
it's own sake. I would definitely look for other criteria when it comes
to optimizing indexes.
Looking at one of our productions databases (~250Gb) tells me that ~15%
of the indexes (~1000) have NLEVELS = 4 and ~3% have NLEVELS = 5.
/Lennart