did a git pull request for new index on post searches by community

  • RoundSparrow @ BTOPM
    link
    fedilink
    11 year ago

    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?

    • RoundSparrow @ BTOPM
      link
      fedilink
      11 year ago

      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

    • RoundSparrow @ BTOPM
      link
      fedilink
      11 year ago

      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”,

    • RoundSparrow @ BTOPM
      link
      fedilink
      11 year ago

      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

    • RoundSparrow @ BTOPM
      link
      fedilink
      1
      edit-2
      1 year ago

      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”,