Rails has an issue with big schemas where it becomes slower over time as the app grows, to fix this issue the schema_cache file was introduced and is enabled by default, it get updated with every migration.
We can create and update the file manually using rake db:schema:cache:dump.
Finally my questions:
- What query does it actually run inside the db?
- Does it lock the db while performing the query?
- Finally is it safe to be ran in production?
Thank you