.ai/principles/distilled/performance.md
update_all insteadActiveRecord::Associations::Preloader to share in-memory objects across associationsskip_cached: false to QueryRecorder to detect and prevent cached query regressionswithout_sticky_writes to prevent primary stickiness after trivial or insignificant writesuse_replicas_for_read_queries to force read-only queries to replicas when replication lag is tolerablefallback_to_replicas_for_ambiguous_queries for read-only transactions and other ambiguous queriesselect_all instead of execute for custom read-only SQL so queries route to read replicas and preserve the query cacheGitlab::SQL::CTE class when building CTE statements; it forces materialization via the MATERIALIZED keyword by defaultincludes)QueryRecorder tests used to prevent regressions when eager loadingFastDestroyAll module when removing many database rows and their associated dataReactiveCaching for fetching external dataAfterCommitQueue module or after_commit AR hook to keep transactions minimalGitlab::SafeRequestStore when reused multiple times within a single transaction1000+) using NumbersHelper.limited_counter_with_delimiterDir.mktmpdir) for temporary file manipulation, especially in Kubernetes deployments100MB of temporary storage without consulting a maintainerObjectStorage concernFor the full picture, see: