There are a few misconceptions in this thread, so let me try and clear
them all up.
- Rails does not perform a query when it instantiates a record,
technically. It calls it the first time that MyModel.columns is
accessed. The query fetches the table meta data from the database
once, and is used for every model instance. So the first time you
instantiate a record, the query will be called, but that's it.
- You'll see these queries repeated a lot in development mode,
however. Rails unloads your application classes so that the next
request can load the updated versions.
- schema.rb is not used in a live app. It's only used to rebuild a
database schema from scrach using "rake db:schema:load."
- By default, the schema.rb file will be automatically regenerated
after each migration. You can do this manually with "rake