Are deleted entities automatically excluded from entity queries? I'm trying to figure out if deleted entities are automatically excluded from entity queries. IE, if I did:

$num = \Drupal::entityQuery('my_entity')-&gt;count()-&gt;execute();


Would the number of entities found go down if I deleted one through the ui? How could I include/exclude deleted entities in this query?
Deleted entities are not excluded because they are gone. They can't be excluded nor included as they do no longer exist in the database.

So they can also not be counted anymore.

This might change during 8.x, as there is work going on for archiving/putting them into trash instead of actually deleting. The details of that and how that affects entity queries are still being discussed.