Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NO-TICKET]: Create an alternate AR plus related data query that is much faster than one sequelize generates #337

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dcloud
Copy link
Collaborator

@dcloud dcloud commented Jun 23, 2021

Description of change

Demoing how a handwritten SQL query could perform better when requesting an activity report plus lots of other data.

My ideal solution would involve *.sql files but I didn't see a quick way to make build/serve copy non-js files to server.

TODO

  • Add objectives as a prop of goals, even though we have objectivesWithGoals and objectivesWithoutGoals
  • Provide a way to compare queries on a complex AR

How to test

Issue(s)

Checklists

Every PR

  • Meets issue criteria
  • JIRA ticket status updated
  • Code is meaningfully tested
  • Meets accessibility standards (WCAG 2.1 Levels A, AA)
  • API Documentation updated
  • Boundary diagram updated
  • Logical Data Model updated
  • Architectural Decision Records written for major infrastructure decisions

Production Deploy

  • Staging smoke test completed

After merge/deploy

  • Update JIRA ticket status

@dcloud dcloud changed the title Create an alternate AR plus related data query that is much faster than one sequelize generates [NO-TICKET]: Create an alternate AR plus related data query that is much faster than one sequelize generates Jun 23, 2021
@dcloud
Copy link
Collaborator Author

dcloud commented Jun 25, 2021

I was looking for ways to profile the changes I am POC'ing here, and came across clinicjs via an IBM Developer tutorial on debugging and profiling NodeJS apps.

I tried this out informally on the old AR endpoint and the alternative one I've put in this branch/PR. I think this warrants further investigation, both into this POC and into the tool, clinicjs (Github Repo)

Old API endpoint

clinic doctor --on-port 'autocannon localhost:$PORT/api/activity-reports/4' -- node ./build/server/index.js

old-ar-endpoint-clinicjs

New/proposed API endpoint

clinic doctor --on-port 'autocannon localhost:$PORT/api/activity-reports/alt/4' -- node ./build/server/index.js

new-ar-endpoint-clinicjs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant