Active Record prefixes all column names with the table name when generating a query. This is necessary to disambiguate field names if a query uses a join. However, most queries only ever hit a single table and thus in most cases the table name is not needed. It would make the development log much easier to read if we could suppress table names when they’re not needed.
Current behaviour
A typical rails query wil look like this
SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 123 LIMIT 1
And if you use a descriptive table name and pick a few fields it can easily get very noisy:
SELECT `payment_settings`.`id`, `payment_settings`.`account_id`, `payment_settings`.`provider` FROM `payment_settings` WHERE `payment_settings`.`id` = 123 LIMIT 1
Desired behavior
A log like this would be much easier to read
SELECT * FROM `accounts` WHERE `id` = 123 LIMIT 1
SELECT `id`,`account_id`,`provider` FROM `payment_settings` WHERE `id` = 123 LIMIT 1
There is even a performance benefit from reducing the number of bytes sent to the log and to the database. I’m not familiar enough with the code base to understand the implications for the implementation, but to the uninitiated it would seem that Active Record should not have too much trouble deciding whether more than one table is involved when generating the query?