update comment_aggregates ca set child_count = c.child_count from ( select c.id, c.path, count(c2.id) as child_count from comment c join comment c2 on c2.path <@ c.path and c2.path != c.path and c.path <@ $1 group by c.id ) as c where ca.comment_id = c.id
duration: 21.028 ms
“Query Text”: “\nupdate comment_aggregates ca set child_count = c.child_count\nfrom (\n select c.id, c.path, count(c2.id) as child_count from comment c\n join comment c2 on c2.path <@ c.path and c2.path != c.path\n and c.path <@ ‘0.1600900’\n group by c.id\n) as c\nwhere ca.comment_id = c.id”,
duration: 104.552 ms
“Query Text”: “\nupdate comment_aggregates ca set child_count = c.child_count\nfrom (\n select c.id, c.path, count(c2.id) as child_count from comment c\n join comment c2 on c2.path <@ c.path and c2.path != c.path\n and c.path <@ ‘0.1624758’\n group by c.id\n) as c\nwhere ca.comment_id = c.id”
duration: 19.590 ms
“Query Text”: “\nupdate comment_aggregates ca set child_count = c.child_count\nfrom (\n select c.id, c.path, count(c2.id) as child_count from comment c\n join comment c2 on c2.path <@ c.path and c2.path != c.path\n and c.path <@ ‘0.1337228’\n group by c.id\n) as c\nwhere ca.comment_id = c.id”
duration: 23.487 ms
“Query Text”: “\nupdate comment_aggregates ca set child_count = c.child_count\nfrom (\n select c.id, c.path, count(c2.id) as child_count from comment c\n join comment c2 on c2.path <@ c.path and c2.path != c.path\n and c.path <@ ‘0.1571057’\n group by c.id\n) as c\nwhere ca.comment_id = c.id”,
update comment_aggregates ca set child_count = c.child_count from ( select c.id, c.path, count(c2.id) as child_count from comment c join comment c2 on c2.path <@ c.path and c2.path != c.path and c.path <@ $1 group by c.id ) as c where ca.comment_id = c.id
ok, can I rework this to be a simple + 1?
duration: 21.028 ms
“Query Text”: “\nupdate comment_aggregates ca set child_count = c.child_count\nfrom (\n select c.id, c.path, count(c2.id) as child_count from comment c\n join comment c2 on c2.path <@ c.path and c2.path != c.path\n and c.path <@ ‘0.1600900’\n group by c.id\n) as c\nwhere ca.comment_id = c.id”,
duration: 104.552 ms
“Query Text”: “\nupdate comment_aggregates ca set child_count = c.child_count\nfrom (\n select c.id, c.path, count(c2.id) as child_count from comment c\n join comment c2 on c2.path <@ c.path and c2.path != c.path\n and c.path <@ ‘0.1624758’\n group by c.id\n) as c\nwhere ca.comment_id = c.id”
duration: 19.590 ms
“Query Text”: “\nupdate comment_aggregates ca set child_count = c.child_count\nfrom (\n select c.id, c.path, count(c2.id) as child_count from comment c\n join comment c2 on c2.path <@ c.path and c2.path != c.path\n and c.path <@ ‘0.1337228’\n group by c.id\n) as c\nwhere ca.comment_id = c.id”
duration: 23.487 ms
“Query Text”: “\nupdate comment_aggregates ca set child_count = c.child_count\nfrom (\n select c.id, c.path, count(c2.id) as child_count from comment c\n join comment c2 on c2.path <@ c.path and c2.path != c.path\n and c.path <@ ‘0.1571057’\n group by c.id\n) as c\nwhere ca.comment_id = c.id”,