Skip to content

Refactor: Debug cypher statements

Hannes Heine requested to merge pr2469head into pr2469base

Created by: Tirokk

roschaefer Authored by roschaefer Closed


🍰 Pullrequest

This helped me to see how many different database calls we have. You can now:

# in backend/
DEBUG=human-connection:neo4j yarn run dev

and see how many database calls we make.

Indeed there is just one database call now. This pull request also removes the use of neode in our resolver helper.

I'm having a hard time to debug where exactly we loose time. This is what tracing gives me:

Request 22 ms
  reports 196 ms
    0.id 2 ms
    0.createdAt 2 ms
    0.updatedAt 2 ms
    0.closed 2 ms
    0.reviewed 6 ms
    0.resource 2 ms
    0.filed 6 ms
    1.id 2 ms
    1.createdAt 2 ms
    1.updatedAt 2 ms
    1.closed 2 ms
    1.reviewed 6 ms
    1.resource 2 ms
    1.filed 6 ms
    2.id 2 ms
    2.createdAt 2 ms
    2.updatedAt 2 ms
    2.closed 2 ms
    2.reviewed 6 ms
    2.resource 2 ms
    2.filed 6 ms
    3.id 2 ms
    3.createdAt 1 ms
    3.updatedAt 1 ms
    3.closed 1 ms
    3.reviewed 6 ms
    3.resource 1 ms
    3.filed 6 ms
    4.id 1 ms
    4.createdAt 1 ms
    4.updatedAt 1 ms
    4.closed 1 ms
    4.reviewed 6 ms
    4.resource 1 ms
    4.filed 6 ms
    5.id 1 ms
    5.createdAt 1 ms
    5.updatedAt 1 ms
    5.closed 1 ms
    5.reviewed 5 ms
    5.resource 1 ms
    5.filed 5 ms
    6.id 1 ms
    6.createdAt 1 ms
    6.updatedAt 1 ms
    6.closed 989 µs
    6.reviewed 5 ms
    6.resource 942 µs
    6.filed 5 ms
    7.id 892 µs
    7.createdAt 877 µs
    7.updatedAt 856 µs
    7.closed 842 µs
    7.reviewed 5 ms
    7.resource 813 µs
    7.filed 5 ms
    8.id 765 µs
    8.createdAt 738 µs
    8.updatedAt 726 µs
    8.closed 714 µs
    8.reviewed 5 ms
    8.resource 685 µs
    8.filed 5 ms
    9.id 639 µs
    9.createdAt 623 µs
    9.updatedAt 608 µs
    9.closed 595 µs
    9.reviewed 5 ms
    9.resource 561 µs
    9.filed 5 ms
    resource.id 6 ms
    resource.slug 5 ms
    resource.title 5 ms
    resource.disabled 5 ms
    resource.deleted 5 ms
    resource.author 5 ms
    resource.id 4 ms
    resource.slug 4 ms
    resource.name 4 ms
    resource.disabled 5 ms
    resource.deleted 5 ms
    resource.id 4 ms
    resource.slug 4 ms
    resource.name 4 ms
    resource.disabled 5 ms
    resource.deleted 5 ms
    resource.id 4 ms
    resource.slug 4 ms
    resource.title 4 ms
    resource.disabled 4 ms
    resource.deleted 4 ms
    resource.author 5 ms
    resource.id 4 ms
    resource.slug 4 ms
    resource.title 4 ms
    resource.disabled 4 ms
    resource.deleted 4 ms
    resource.author 5 ms
    resource.id 3 ms
    resource.slug 3 ms
    resource.name 3 ms
    resource.disabled 5 ms
    resource.deleted 5 ms
    resource.id 3 ms
    resource.contentExcerpt 3 ms
    resource.disabled 3 ms
    resource.deleted 3 ms
    resource.author 5 ms
    resource.post 5 ms
    resource.id 3 ms
    resource.contentExcerpt 3 ms
    resource.disabled 3 ms
    resource.deleted 3 ms
    resource.author 5 ms
    resource.post 5 ms
    resource.id 3 ms
    resource.contentExcerpt 3 ms
    resource.disabled 3 ms
    resource.deleted 3 ms
    resource.author 5 ms
    resource.post 5 ms
    resource.id 3 ms
    resource.slug 3 ms
    resource.title 3 ms
    resource.disabled 3 ms
    resource.deleted 3 ms
    resource.author 5 ms
    0.submitter 2 ms
    0.createdAt 2 ms
    0.reasonCategory 2 ms
    0.reasonDescription 2 ms
    0.createdAt 2 ms
    0.updatedAt 2 ms
    0.disable 2 ms
    0.moderator 2 ms
    0.submitter 2 ms
    0.createdAt 2 ms
    0.reasonCategory 2 ms
    0.reasonDescription 2 ms
    1.submitter 2 ms
    1.createdAt 2 ms
    1.reasonCategory 2 ms
    1.reasonDescription 2 ms
    2.submitter 1 ms
    2.createdAt 1 ms
    2.reasonCategory 1 ms
    2.reasonDescription 1 ms
    0.submitter 1 ms
    0.createdAt 1 ms
    0.reasonCategory 1 ms
    0.reasonDescription 1 ms
    1.submitter 1 ms
    1.createdAt 1 ms
    1.reasonCategory 1 ms
    1.reasonDescription 1 ms
    0.submitter 1 ms
    0.createdAt 1 ms
    0.reasonCategory 1 ms
    0.reasonDescription 1 ms
    0.submitter 1 ms
    0.createdAt 1 ms
    0.reasonCategory 1 ms
    0.reasonDescription 1 ms
    1.submitter 1 ms
    1.createdAt 1 ms
    1.reasonCategory 995 µs
    1.reasonDescription 978 µs
    0.submitter 947 µs
    0.createdAt 928 µs
    0.reasonCategory 911 µs
    0.reasonDescription 893 µs
    0.submitter 865 µs
    0.createdAt 846 µs
    0.reasonCategory 829 µs
    0.reasonDescription 811 µs
    0.submitter 779 µs
    0.createdAt 760 µs
    0.reasonCategory 742 µs
    0.reasonDescription 725 µs
    0.submitter 696 µs
    0.createdAt 676 µs
    0.reasonCategory 659 µs
    0.reasonDescription 641 µs
    0.createdAt 605 µs
    0.updatedAt 590 µs
    0.disable 571 µs
    0.moderator 553 µs
    0.submitter 518 µs
    0.createdAt 499 µs
    0.reasonCategory 481 µs
    0.reasonDescription 463 µs
    submitter.id 5 ms
    submitter.slug 5 ms
    submitter.name 5 ms
    submitter.disabled 5 ms
    submitter.deleted 5 ms
    moderator.id 5 ms
    moderator.slug 5 ms
    moderator.name 5 ms
    submitter.id 5 ms
    submitter.slug 5 ms
    submitter.name 5 ms
    submitter.disabled 5 ms
    submitter.deleted 5 ms
    submitter.id 4 ms
    submitter.slug 4 ms
    submitter.name 4 ms
    submitter.disabled 5 ms
    submitter.deleted 5 ms
    submitter.id 4 ms
    submitter.slug 4 ms
    submitter.name 4 ms
    submitter.disabled 4 ms
    submitter.deleted 4 ms
    submitter.id 4 ms
    submitter.slug 4 ms
    submitter.name 4 ms
    submitter.disabled 4 ms
    submitter.deleted 4 ms
    submitter.id 4 ms
    submitter.slug 4 ms
    submitter.name 4 ms
    submitter.disabled 4 ms
    submitter.deleted 4 ms
    submitter.id 4 ms
    submitter.slug 4 ms
    submitter.name 4 ms
    submitter.disabled 4 ms
    submitter.deleted 4 ms
    submitter.id 4 ms
    submitter.slug 4 ms
    submitter.name 4 ms
    submitter.disabled 4 ms
    submitter.deleted 4 ms
    submitter.id 4 ms
    submitter.slug 4 ms
    submitter.name 4 ms
    submitter.disabled 4 ms
    submitter.deleted 4 ms
    submitter.id 4 ms
    submitter.slug 4 ms
    submitter.name 4 ms
    submitter.disabled 4 ms
    submitter.deleted 4 ms
    submitter.id 3 ms
    submitter.slug 3 ms
    submitter.name 3 ms
    submitter.disabled 4 ms
    submitter.deleted 4 ms
    submitter.id 3 ms
    submitter.slug 3 ms
    submitter.name 3 ms
    submitter.disabled 4 ms
    submitter.deleted 4 ms
    submitter.id 3 ms
    submitter.slug 3 ms
    submitter.name 3 ms
    submitter.disabled 3 ms
    submitter.deleted 3 ms
    moderator.id 3 ms
    moderator.slug 3 ms
    moderator.name 3 ms
    submitter.id 3 ms
    submitter.slug 3 ms
    submitter.name 3 ms
    submitter.disabled 3 ms
    submitter.deleted 3 ms
    author.id 3 ms
    author.slug 3 ms
    author.name 3 ms
    author.disabled 3 ms
    author.deleted 3 ms
    author.id 2 ms
    author.slug 2 ms
    author.name 2 ms
    author.disabled 2 ms
    author.deleted 2 ms
    author.id 2 ms
    author.slug 2 ms
    author.name 2 ms
    author.disabled 2 ms
    author.deleted 2 ms
    author.id 2 ms
    author.slug 2 ms
    author.name 2 ms
    author.disabled 2 ms
    author.deleted 2 ms
    post.id 2 ms
    post.slug 2 ms
    post.title 2 ms
    post.disabled 2 ms
    post.deleted 2 ms
    author.id 1 ms
    author.slug 1 ms
    author.name 1 ms
    author.disabled 2 ms
    author.deleted 2 ms
    post.id 1 ms
    post.slug 1 ms
    post.title 1 ms
    post.disabled 1 ms
    post.deleted 1 ms
    author.id 1 ms
    author.slug 1 ms
    author.name 1 ms
    author.disabled 1 ms
    author.deleted 1 ms
    post.id 1 ms
    post.slug 1 ms
    post.title 1 ms
    post.disabled 1 ms
    post.deleted 1 ms
    author.id 985 µs
    author.slug 964 µs
    author.name 947 µs
    author.disabled 1 ms
    author.deleted 1 ms

Merge request reports