public inbox for [email protected]
help / color / mirror / Atom feedCan we use Statistics Import and Export feature to perforamance testing?
7+ messages / 3 participants
[nested] [flat]
* Can we use Statistics Import and Export feature to perforamance testing?
@ 2025-04-08 00:20 Ryohei Takahashi (Fujitsu) <[email protected]>
0 siblings, 1 reply; 7+ messages in thread
From: Ryohei Takahashi (Fujitsu) @ 2025-04-08 00:20 UTC (permalink / raw)
To: pgsql-hackers
Hi,
I have a question about Statistics Import and Export.
* Background
I'm working for PGEcons[1], which is the PostgreSQL consortium in Japan.
Several companies participating in PGEcons have the following request for PostgreSQL.
They have two environments, production environment and staging environment.
Production environment has real customer's data and staging environment has dummy testing data.
When adding some application, they want to run the performance test on staging environment and
then apply to the production environment.
In the performance test, they want to use the same statistics as the production environment
to reduce the trouble in production environment.
* 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).
[1] PGECons is a non profit organization comprised of companies
in Japan to promote PostgreSQL (https://www.pgecons.org).
Regards,
Ryohei Takahashi
^ permalink raw reply [nested|flat] 7+ messages in thread
* RE: Can we use Statistics Import and Export feature to perforamance testing?
@ 2025-04-08 12:14 Ryohei Takahashi (Fujitsu) <[email protected]>
parent: Ryohei Takahashi (Fujitsu) <[email protected]>
0 siblings, 1 reply; 7+ messages in thread
From: Ryohei Takahashi (Fujitsu) @ 2025-04-08 12:14 UTC (permalink / raw)
To: 'David Rowley' <[email protected]>; +Cc: pgsql-hackers
Hi,
Thank you for your reply.
I understand that the access plans are not guaranteed to be the same.
Can we add these notes to the pg_dump page in the PostgreSQL Documentation
in order to prevent users from asking the same question?
Regards,
Ryohei Takahashi
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Can we use Statistics Import and Export feature to perforamance testing?
@ 2025-10-23 10:27 Yugo Nagata <[email protected]>
parent: Ryohei Takahashi (Fujitsu) <[email protected]>
0 siblings, 1 reply; 7+ messages in thread
From: Yugo Nagata @ 2025-10-23 10:27 UTC (permalink / raw)
To: Ryohei Takahashi (Fujitsu) <[email protected]>; +Cc: 'David Rowley' <[email protected]>; pgsql-hackers; Corey Huinker <[email protected]>
Hi,
On Tue, 8 Apr 2025 12:14:08 +0000
"Ryohei Takahashi (Fujitsu)" <[email protected]> wrote:
> Thank you for your reply.
> I understand that the access plans are not guaranteed to be the same.
>
> Can we add these notes to the pg_dump page in the PostgreSQL Documentation
> in order to prevent users from asking the same question?
I agree that it would be helpful to add this description, since the wording
“statistics manipulation functions” might give the impression that they can
influence generated plans.
I’ve attached a patch that adds a new paragraph to the warning section of the
documentation on statistics manipulation functions:
Manually restored statistics do not guarantee that the same query plans
will be generated as in the source environment, since factors such as
relation sizes, index OIDs, and configuration parameters may affect
planner behavior.
What do you think?
Regards,
Yugo Nagata
--
Yugo Nagata <[email protected]>
Attachments:
[text/x-diff] doc_add_warning_on_stats_manipulation_funcs.patch (738B, 2-doc_add_warning_on_stats_manipulation_funcs.patch)
download | inline diff:
diff --git a/doc/src/sgml/func/func-admin.sgml b/doc/src/sgml/func/func-admin.sgml
index 1b465bc8ba7..bbdd20571d4 100644
--- a/doc/src/sgml/func/func-admin.sgml
+++ b/doc/src/sgml/func/func-admin.sgml
@@ -1959,6 +1959,12 @@ postgres=# SELECT '0/0'::pg_lsn + pd.segment_number * ps.setting::int + :offset
<command>VACUUM</command> or <command>ANALYZE</command>) and should be
considered temporary.
</para>
+ <para>
+ Manually restored statistics do not guarantee that the same query plans
+ will be generated as in the source environment, since factors such as
+ relation sizes, index OIDs, and configuration parameters may affect
+ planner behavior.
+ </para>
</warning>
</para>
^ permalink raw reply [nested|flat] 7+ messages in thread
* RE: Can we use Statistics Import and Export feature to perforamance testing?
@ 2025-10-24 00:00 Ryohei Takahashi (Fujitsu) <[email protected]>
parent: Yugo Nagata <[email protected]>
0 siblings, 1 reply; 7+ messages in thread
From: Ryohei Takahashi (Fujitsu) @ 2025-10-24 00:00 UTC (permalink / raw)
To: 'Yugo Nagata' <[email protected]>; +Cc: 'David Rowley' <[email protected]>; pgsql-hackers; Corey Huinker <[email protected]>
Hi Nagata san,
Thank you.
Your patch is good for me.
I think this kind of documentation can prevent users confusing.
Regards,
Ryohei Takahashi
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Can we use Statistics Import and Export feature to perforamance testing?
@ 2025-10-24 03:16 Yugo Nagata <[email protected]>
parent: Ryohei Takahashi (Fujitsu) <[email protected]>
0 siblings, 1 reply; 7+ messages in thread
From: Yugo Nagata @ 2025-10-24 03:16 UTC (permalink / raw)
To: Ryohei Takahashi (Fujitsu) <[email protected]>; +Cc: 'David Rowley' <[email protected]>; pgsql-hackers; Corey Huinker <[email protected]>
On Fri, 24 Oct 2025 00:00:42 +0000
"Ryohei Takahashi (Fujitsu)" <[email protected]> wrote:
> Hi Nagata san,
>
>
> Thank you.
> Your patch is good for me.
>
> I think this kind of documentation can prevent users confusing.
Thank you for your review.
I have registered this patch in the commitfest app.
https://commitfest.postgresql.org/patch/6155/
Regards,
Yugo Nagata
--
Yugo Nagata <[email protected]>
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Can we use Statistics Import and Export feature to perforamance testing?
@ 2026-05-27 05:54 vellaipandiyan sm <[email protected]>
parent: Yugo Nagata <[email protected]>
0 siblings, 1 reply; 7+ messages in thread
From: vellaipandiyan sm @ 2026-05-27 05:54 UTC (permalink / raw)
To: [email protected]; +Cc: Yugo Nagata <[email protected]>
I prepared a small documentation follow-up patch adding a cross-reference to the planner statistics documentation section from the statistics manipulation warning.
The patch builds cleanly with:
`make -C doc/src/sgml html`
I will send the patch to the mailing list thread as well.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Can we use Statistics Import and Export feature to perforamance testing?
@ 2026-06-05 08:21 Yugo Nagata <[email protected]>
parent: vellaipandiyan sm <[email protected]>
0 siblings, 0 replies; 7+ messages in thread
From: Yugo Nagata @ 2026-06-05 08:21 UTC (permalink / raw)
To: vellaipandiyan sm <[email protected]>; +Cc: [email protected]
On Wed, 27 May 2026 05:54:06 +0000
vellaipandiyan sm <[email protected]> wrote:
> I prepared a small documentation follow-up patch adding a cross-reference to the planner statistics documentation section from the statistics manipulation warning.
>
> The patch builds cleanly with:
>
> `make -C doc/src/sgml html`
>
> I will send the patch to the mailing list thread as well.
I may have missed it, but I couldn't find the patch in the thread.
Could you please point me to it?
Regards,
Yugo Nagata
--
Yugo Nagata <[email protected]>
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2026-06-05 08:21 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-04-08 00:20 Can we use Statistics Import and Export feature to perforamance testing? Ryohei Takahashi (Fujitsu) <[email protected]>
2025-04-08 12:14 ` Ryohei Takahashi (Fujitsu) <[email protected]>
2025-10-23 10:27 ` Yugo Nagata <[email protected]>
2025-10-24 00:00 ` Ryohei Takahashi (Fujitsu) <[email protected]>
2025-10-24 03:16 ` Yugo Nagata <[email protected]>
2026-05-27 05:54 ` vellaipandiyan sm <[email protected]>
2026-06-05 08:21 ` Yugo Nagata <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox