forked from yugabyte/yugabyte-db
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[yugabyte#15660] YSQL: ANALYZE catalog tables as part of initdb
Summary: With this diff, we analyze catalog tables as part of initdb. ANALYZE is run only once for the template1 database. Collected stats are copied from template1 to template0, postgres, and yugabyte databases because they use template1 as their template database. Since PG system cache is not invalidated (stale cache) after direct UPDATE on catalog tables if the cache uses OID as part of its hash value calculation, now ANALYZE reads tuples directly from pg_class table instead of RELOID system cache during initdb as a workaround for this stale cache issue. A YSQL upgrade script is not provided for this initdb change because we don't know the state (number of tables, etc.) of existing clusters. Thus, TestYsqlUpgrade is changed accordingly to skip checking the state of `pg_statistic`. In addition, a few regression tests are updated because of the initial catalog statistic change. Jira: DB-5026 Test Plan: After `./yb_build.sh reinitdb`, manually verified catalog stats in `pg_class` and `pg_statistic` is collected. ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressYbStat#testYbStat' ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressYbBitmapScans#testPgRegressYbBitmapScans' ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressPushdownKey#testPgRegressPushdownKey' ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressPgStat#testPgStat' ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressMisc#testPgRegressMiscSerial3' ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressJson#testPgRegressJson' ./yb_build.sh --cxx-test pgwrapper_pg_catalog_version-test --gtest_filter PgCatalogVersionTest.FixCatalogVersionTable ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressTablegroup#testPgRegressTablegroup' ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressIndex#testPgRegressIndex' ./yb_build.sh --java-test 'org.yb.pgsql.TestYsqlDump' ./yb_build.sh --java-test 'org.yb.pgsql.TestYsqlUpgrade#migratingIsEquivalentToReinitdb' ./yb_build.sh --java-test 'org.yb.pgsql.TestYsqlUpgrade#upgradeIsIdempotentSingleConn' ./yb_build.sh --java-test 'org.yb.pgsql.TestYsqlUpgrade#upgradeIsIdempotent' Reviewers: mihnea, kfranz, telgersma, amartsinchyk Reviewed By: kfranz, amartsinchyk Subscribers: jason, yql Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D34576
- Loading branch information
Showing
22 changed files
with
98 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.