Skip to content

perf: Use UNION to get public user event types#17052

Merged
zomars merged 2 commits intomainfrom
perf/get-event-types-public-separate-queries
Oct 10, 2024
Merged

perf: Use UNION to get public user event types#17052
zomars merged 2 commits intomainfrom
perf/get-event-types-public-separate-queries

Conversation

@keithwillcode
Copy link
Copy Markdown
Contributor

What does this PR do?

Running this as a UNION reduction from 90ms+ down to 0.1ms.

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A - I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Ensure all automated tests pass and that loading a user's event types page works as expected with all the same sorting applied correctly

@keithwillcode keithwillcode self-assigned this Oct 10, 2024
@graphite-app graphite-app Bot requested a review from a team October 10, 2024 18:51
@keithwillcode keithwillcode added this to the v4.6 milestone Oct 10, 2024
@keithwillcode keithwillcode added core area: core, team members only foundation labels Oct 10, 2024
},
});
const eventTypes = await prisma.$queryRaw<RawEventType[]>`
SELECT data."id", data."title", data."description", data."length", data."schedulingType"::text,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point, we can start using prisma's filesystem imports for these raw queries. Later PR

@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Oct 10, 2024

Graphite Automations

"Add foundation team as reviewer" took an action on this PR • (10/10/24)

1 reviewer was added to this PR based on Keith Williams's automation.

Comment thread packages/lib/event-types/getEventTypesPublic.ts
@vercel
Copy link
Copy Markdown

vercel Bot commented Oct 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Oct 10, 2024 6:58pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Oct 10, 2024 6:58pm

@dosubot dosubot Bot added event-types area: event types, event-types performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive labels Oct 10, 2024
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Oct 10, 2024

E2E results are ready!

@zomars zomars merged commit 132746a into main Oct 10, 2024
@zomars zomars deleted the perf/get-event-types-public-separate-queries branch October 10, 2024 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only event-types area: event types, event-types foundation performance area: performance, page load, slow, slow endpoints, loading screen, unresponsive ready-for-e2e

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants