Re: Statistics Import and Export - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: Statistics Import and Export
Date
Msg-id CADkLM=f=M7U_S1K+QTWfU29=knBhpj1tNWJUygLAGCrQxfdpFA@mail.gmail.com
Whole thread Raw
In response to Re: Statistics Import and Export  (Andres Freund <andres@anarazel.de>)
Responses Re: Statistics Import and Export
List pgsql-hackers

The more I think about it, the less correct it seems to me to have the
statement to restore statistics tracked via ArchiveOpts->createStmt.  We use
that for DDL, but this really is data, not DDL.  Because we store it in
->createStmt it's stored in-memory for the runtime of pg_dump, which means the
peak memory usage will inherently be quite high.

I think the stats need to be handled much more like we handle the actual table
data, which are obviously *not* stored in memory for the whole run of pg_dump.

I'm at the same conclusion. This would mean keeping the one getAttributeStats query perrelation, but at least we'd be able to free up the result after we write it to disk.
 

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Statistics Import and Export
Next
From: Álvaro Herrera
Date:
Subject: Re: Simplify the logic a bit (src/bin/scripts/reindexdb.c)