Optimize has_files to only check fields and not all entries.