Don't reset relhasindex for partitioned tables on ANALYZE
Alvaro Herrera <alvherre@alvh.no-ip.org>
Don't reset relhasindex for partitioned tables on ANALYZE Commit 0e69f705cc1a introduced code to analyze partitioned table; however, that code fails to preserve pg_class.relhasindex correctly. Fix by observing whether any indexes exist rather than accidentally falling through to assuming none do. Backpatch to 14. Author: Alexander Pyhalov <a.pyhalov@postgrespro.ru> Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org> Reviewed-by: Zhihong Yu <zyu@yugabyte.com> Discussion: https://postgr.es/m/CALNJ-vS1R3Qoe5t4tbzxrkpBtzRbPq1dDcW4RmA_a+oqweF30w@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/analyze.c | modified | +23 −9 |
| src/test/regress/expected/vacuum.out | modified | +22 −0 |
| src/test/regress/sql/vacuum.sql | modified | +16 −0 |
Discussion
- Partitioned index can be not dumped 10 messages · 2021-06-30 → 2021-07-01