optimize doc Items select query