Reindex after upgrade from PostgreSQL 12.10 to PostgreSQL 15.3

Started by Hellen Jiangover 2 years ago2 messagesgeneral
Jump to latest
#1Hellen Jiang
hjiang@federatedwireless.com

Hi,
I am going to upgrade our production database( postgresql 12.10) to postgresql 15.3.
After upgrade to 15.3, Do you have to do re-index?
If I have to do re-index, can I only do re-index on some partitioned tables?
We have a lot of big tables which are partitioned by date, for example, table1 has partitioned table by month table1_2023_01, table1_2023_02 , table1_2023_03 and so on.
Will that be good if I only run reindex on some partitioned table(table1_2023_06 and table1_2023_07), for example, REINDEX (VERBOSE) TABLE table1_2023_06; REINDEX (VERBOSE) TABLE table1_2023_07;
After reindex part of tables, I will run ANALYZE with vaccumdb
vacuumdb --analyze-only --jobs=8 -d <mydatabase>

Will the performance be as good as before I upgrade?

Thanks,

#2Laurenz Albe
laurenz.albe@cybertec.at
In reply to: Hellen Jiang (#1)
Re: Reindex after upgrade from PostgreSQL 12.10 to PostgreSQL 15.3

On Thu, 2023-07-27 at 20:02 +0000, Hellen Jiang wrote:

I am going to upgrade our production database( postgresql 12.10) to postgresql 15.3.
After upgrade to 15.3,  Do you have to do re-index?

That is not necessary after a PostgreSQL upgrade.

(It may be necessary if you upgrade the operating system.)

Will the performance be as good as before I upgrade?

It should be at least as good, but sometimes it isn't.
That's why you test (and tune if necessary).

Yours,
Laurenz Albe