blog icon indicating copy to clipboard operation
blog copied to clipboard

是否有方法將 Postgresql DB 複製統計資訊並匯入其他 Postgresql DB 裡?

Open isdaniel opened this issue 3 years ago • 1 comments
trafficstars

我知道我們可以透過 pg_stats 取得資料表的統計資訊,但我想要問我是否有辦法將 Postgresql DB 複製統計資訊並匯入其他 Postgresql DB 裡?

因為執行計畫會如何執行透過統計資訊,我想要把 Prod 統計資訊匯出去,在測試環境跑看看執行計畫 不想要整個 DB Backup 或是新增一大批資料

我想要做到輕量就可以模擬 prod 會跑執行計畫

SELECT * 
FROM pg_stats

sql server 有類似的作法可以匯出統計資訊並匯入其他sql server DB sql-server-copy-statistics-from-one-server-to-another-server

如果有人有任何作法或方式 分享非常感謝

isdaniel avatar Jan 11 '22 07:01 isdaniel

您好!您的来信以收到,谢谢您的来信,我这会儿暂时无法收看您的邮件,我会以最快的速度拜读您的来信。

wanggnot avatar Jan 11 '22 07:01 wanggnot

https://github.com/ossc-db/pg_dbms_stats

digoal avatar Dec 30 '23 06:12 digoal