rewrite simple index intersect/union