3 ms·
Agreed, I do all my dev with query trace in order to make sure I'm not looping back into individual queries. to those that don't know, Rails doesn't load the c
by mikeryan 17y ago
Agreed, I do all my dev with query trace in order to make sure I'm not looping back into individual queries.
to those that don't know, Rails doesn't load the children of AR objects by default, so if you do something like
Select * from books
and then iterate through the books and get books.author_name where the author data is a relational table, you're going to get a separate query for each row.
- ericb 17y agoUsually the point where you could get into trouble would look more like: book.author.name in the given example.