Another minor modification: indexes with only updates and no hits now have a negative ratio (instead of 0). The ratio calculation for those indexes is updates * -1.
For those of you who already want the modification, change the "ratio" calculation to
, case
when a.user_seeks + a.user_scans + a.user_lookups = 0
then - a.user_updates
else cast(a.user_seeks + a.user_scans + a.user_lookups AS REAL) / cast(case a.user_updates when 0 then 1 else a.user_updates end as REAL)
end "ratio"
Waiting for approval!
Wilfred
The best things in life are the simple things