Skip to content

Conversation

@AdityaKirad
Copy link
Contributor

The current session query joins with the User table to get the userId,
which is unnecessary since we can directly select userId from the Session table.
Since we have onDelete: Cascade constraint, the database already guarantees
referential integrity, making the join redundant.

  • Removes unnecessary table join
  • Improves query performance
  • Relies on database constraints for data integrity

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

Thanks!

@kentcdodds kentcdodds merged commit 680b4fa into epicweb-dev:main Feb 8, 2025
mohammedzamakhan referenced this pull request in mohammedzamakhan/epic-startup Aug 4, 2025
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.

2 participants