You probably know that Rails automatically matches fields in the database according to the properties of your models by convention, so you donβt need to explicitly define "id", "name", etc. in implementations of the ActiveRecord class.
In order for your ActiveRecord models to generate the properties you need, Rails must interrogate your database schema. Mysql supports the above commands for checking the schema.
ActiveRecord makes the assumption that your scheme will not change throughout the life cycle of the running application, so there is no need to ask these questions in subsequent requests.
source share