improve multi-dimensional queries