ankane/the-ultimate-guide-to-ruby-timeouts

[question][Rails+MySQL] Why does it recommend to configure max_execution_time longer for migration

cou929 opened this issue · 1 comments

https://github.com/ankane/the-ultimate-guide-to-ruby-timeouts/blob/0573b4f52cad438c1341e6d6254378ea7ea9370b/README.md#mysql

For migrations, you likely want to set a longer statement timeout. You can do this with

MySQL's max_execution_time only affects SELECT statements. And in migration, Rails looks like it only emits a small number of SELECT queries for schema_migrations or ar_internal_metadata, which are relatively smaller tables, so it seems not needed to set max_execution_time in migration for most cases.

Unlike MySQL, MariaDB's max_statement_time or Postgresql's statement_timeout seems affects any queries, not only SELECT. So it makes sense to change these timeout values in migration.

Thanks @cou929! Agree this isn't needed.