Problem: Index size estimated by our framework seems to be doubled in compared to that by DB2.
Scenarios: Run DB2Advisor with disklimit = 2560MB on 40 queries TPCDS, 10GB database. The total size of recommended indexes by DB2Advisor (computed by calling getBytes() in our framework) is around 5200MB.
Work-around: I temporarily add a factor of 0.5 when estimating index size by changing the following line in DB2Optimizer.readAdviseIndexTable() method:
Tasks: I guess we need to check: (1) Whether pageSize is estimated correctly, (2) Are there any distribution assumptions that lead to using the factor 0.5, or (3) Use other sophisticated ways to estimate index size as recommend by http://ibm.co/xsH4QC.
Work-around: I temporarily add a factor of 0.5 when estimating index size by changing the following line in DB2Optimizer.readAdviseIndexTable() method:
index.setBytes((long) rs.getInt("nleaf") * (long) pageSize / 2);