Drastically speed up dynamic PW queries