First page Back Continue Last page Overview Text


Like some other ruby database libraries, Sequel includes support for solving the so-called N+1 problem, where you can send a query to preload associations for all returned objects instead of sending a separate query for each returned object to get the associations for that object.

Sequel's default way to do this is with the eager method, which takes the associations you want to preload.

This will run three queries, one for the employees, one for the positions of those employees, and one for the teams of those employees.