Enable analyze for p_ci_builds_metadata
What does this MR do and why?
See #423959 (comment 1588358939)
This is related to #423135 (closed). We have built the feature to run regular analyze on partitioned tables so that Postgresql can use the table information to execute a better query plan. And now we want to register Ci::BuildMetadata
and schedule to run the analyze weekly.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
-
Open up Rails console and development logs:
tail -f log/development.log rails c
-
Enable feature flag
Feature.enable(:database_analyze_on_partitioned_tables)
-
Run sync_partitions
::Gitlab::Database::Partitioning.sync_partitions
-
Check if you can see the following output from Rails console or development logs
ANALYZE VERBOSE "p_ci_builds_metadata"
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #423135 (closed)
Edited by Tianwen Chen