Add state to create query plan