SQL select: fixed optimizer to avoid calling index.getSize() but rather index.getKeySize()