Improve direct sql queries to the archive
Original directory_ls
query is cleaned up to avoid retrieving
unnecesary information. Specific query is added for the case where
no file filtering by size is done.
Migrated from D6886 (view on Phabricator)