[openstreetmap/openstreetmap-website] Avoid using partial rendering in /map.json (PR #4141)
mmd
notifications at github.com
Sun Sep 10 19:29:18 UTC 2023
> You mention N+1 queries, and those are definitely worth solving, that might be worth doing in a separate PR
Changeset and User Loads seem to be one of the culprits, although they mostly end up being served by the cache. Preloading might be all it takes to get rid of them.
Nodes:
```
CACHE Changeset Load (0.0ms) SELECT "changesets".* FROM "changesets" WHERE "changesets"."id" = $1 LIMIT $2 [["id", 1874767], ["LIMIT", 1]]
↳ app/views/api/nodes/_node.xml.builder:7
CACHE User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
↳ app/views/api/nodes/_node.xml.builder:7
```
Ways:
```
CACHE Changeset Load (0.0ms) SELECT "changesets".* FROM "changesets" WHERE "changesets"."id" = $1 LIMIT $2 [["id", 1874767], ["LIMIT", 1]]
↳ app/views/api/ways/_way.xml.builder:7
CACHE User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
↳ app/views/api/ways/_way.xml.builder:7
Node Load (1.2ms) SELECT "current_nodes".* FROM "current_nodes" INNER JOIN "current_way_nodes" ON "current_nodes"."id" = "current_way_nodes"."node_id" WHERE "current_way_nodes"."way_id" = $1 ORDER BY "current_way_nodes"."sequence_id" ASC [["way_id", 4000394980]]
↳ app/views/api/ways/_way.xml.builder:12
```
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4141#issuecomment-1712917532
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4141/c1712917532 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230910/9567ebfc/attachment.htm>
More information about the rails-dev
mailing list