-
- Downloads
Avoid plucking Todo ids and use sub-queries instead
TodoService should not call `.select(&:id)` on todos, because this is bad performance. So instead use sub-queries, which will result in a single SQL query to the database. https://docs.gitlab.com/ee/development/sql.html#plucking-ids
Showing
- app/controllers/dashboard/todos_controller.rb 2 additions, 2 deletionsapp/controllers/dashboard/todos_controller.rb
- app/services/issuable_base_service.rb 1 addition, 1 deletionapp/services/issuable_base_service.rb
- app/services/todo_service.rb 10 additions, 6 deletionsapp/services/todo_service.rb
- changelogs/unreleased/tc-no-todo-service-select.yml 4 additions, 0 deletionschangelogs/unreleased/tc-no-todo-service-select.yml
- lib/api/todos.rb 3 additions, 3 deletionslib/api/todos.rb
- lib/api/v3/todos.rb 3 additions, 3 deletionslib/api/v3/todos.rb
- spec/services/todo_service_spec.rb 28 additions, 5 deletionsspec/services/todo_service_spec.rb
Please register or sign in to comment