Re: Reproducing query plans in empty database: can I just copy stats and settings? - Mailing list pgsql-general

From Tom Lane
Subject Re: Reproducing query plans in empty database: can I just copy stats and settings?
Date
Msg-id 21596.1564438086@sss.pgh.pa.us
Whole thread Raw
In response to Re: Reproducing query plans in empty database: can I just copy statsand settings?  (Guyren Howe <guyren@gmail.com>)
Responses Re: Reproducing query plans in empty database: can I just copy statsand settings?  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Guyren Howe <guyren@gmail.com> writes:
> On Jul 29, 2019, at 12:25 , Adrian Klaver <adrian.klaver@aklaver.com> wrote:
>> If you can't see/use the data in the production database in your test database I'm not sure how copying the
statistics/costsettings is going to help. 

> Isn’t that the entirety of what the query plan is based on?

No; physical sizes of the tables and indexes also matter.  (The planner
scales some cost values by those numbers to account for the likelihood
that tables have grown since they were last analyzed.)  You could deal
with that by bloating them with dummy data, of course.

I think though that Adrian's point is a bit different: if you're not
allowed to see the original data, you should not be allowed to see
the statistics either.  The histogram values and most-common-values
lists represent a pretty sizable information leak for such cases.

            regards, tom lane



pgsql-general by date:

Previous
From: Guyren Howe
Date:
Subject: Re: Reproducing query plans in empty database: can I just copy statsand settings?
Next
From: Adrian Klaver
Date:
Subject: Re: Reproducing query plans in empty database: can I just copy statsand settings?