Delete Query on a large database

I have a qustion about a delete query on a large database. Is there a good way to do this? Is it deleting directly every record that matches without loading it in memory first?

Yes. it will lookup the internal document id’s and deletes them. this commit improved it by not loading the id’s into memory but using stored fields instead: