From: | Corey Huinker <corey(dot)huinker(at)gmail(dot)com> |
---|---|
To: | "Ryohei Takahashi (Fujitsu)" <r(dot)takahashi_2(at)fujitsu(dot)com> |
Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Can we use Statistics Import and Export feature to perforamance testing? |
Date: | 2025-04-12 08:43:20 |
Message-ID: | CADkLM=edE4r+YBYX9Yv00h+AjrhGKB53NC-0egyoKRu57iq+5Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
>
> * Question
>
> By using Statistics Import and Export feature, is it possible to achieve
> the above request by following procedure?
>
>
>
> (1) Export the statistics from production environment by using pg_dump
> --statistics-only.
>
> (2) On the staging environment, set the autovacuum related parameters to
> prevent autovacuum from running.
>
> (3) Import the statistics to staging environment by using the result of
> (1).
>
This was one of the initial intended uses for the statistical import
functions, specifically the pg_set_(relation|attribute)_stats variants.
Those variants have gone away, but the main functional difference was that
pg_restore_relation_stats() did inplace updates (it no longer does), and
without that difference set- variants became redundant.
So your procedure should still work so long as those statistics remain in
place, but just for explain plan generation of queries in isolation - there
is no way through statistics to make a large production query that
overflows work_mem do the same on a small test database, or other effects
that are a consequence of finding real data in the tables.
From | Date | Subject | |
---|---|---|---|
Next Message | Corey Huinker | 2025-04-12 09:03:48 | Re: someone else to do the list of acknowledgments |
Previous Message | Corey Huinker | 2025-04-12 08:29:42 | Re: Can we use Statistics Import and Export feature to perforamance testing? |