On 2019-Feb-17, Michael Banck wrote:
> + /*
> + * As progress status information may be requested, we need to scan the
> + * directory tree(s) twice, once to get the idea how much data we need to
> + * scan and finally to do the real legwork.
> + */
> + total_size = scan_directory(DataDir, "global", true);
> + total_size += scan_directory(DataDir, "base", true);
> + total_size += scan_directory(DataDir, "pg_tblspc", true);
Surely we know at that point whether this first scan is needed, and we
can skip it if not?
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services