You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when using graphql connections to resolve relations and a limit is specified on the connection, n+1 queries are still employed on the relation even though the primary query successfully batches the query.
the batch is successfully done to build the initial log items with its associated files, but then n+1 queries are done to the files applying the limit specified. I'm not sure if there is any way to prevent this since it appears it is being generated from GraphQL-ruby
SELECT
`log`.`id` AS t0_r0,
FROM
`log`
LEFT OUTER JOIN
`files` ON `log`.`id` = `files`.`log_id`
WHERE
`log`.`id` IN (230811);
File Load (0.4ms) SELECT `files`.* FROM `files` WHERE `files`.`log_id` = 230811 LIMIT 2
I just wanted to let you know if you weren't already aware.
The text was updated successfully, but these errors were encountered:
geneeblack
changed the title
Note: when using connections to resolve relations
Note: when using connections with a (first:n) directive to resolve relations
Nov 16, 2017
when using graphql connections to resolve relations and a limit is specified on the connection, n+1 queries are still employed on the relation even though the primary query successfully batches the query.
given the following query:
the preloads limit the result query to 1 query
but if specifying a limit (explicitly or default using GraphQL schema setting default_max_page_size)
the batch is successfully done to build the initial log items with its associated files, but then n+1 queries are done to the files applying the limit specified. I'm not sure if there is any way to prevent this since it appears it is being generated from GraphQL-ruby
I just wanted to let you know if you weren't already aware.
The text was updated successfully, but these errors were encountered: