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

[bug fix] Drop support for JOIN queries #6

Merged
merged 1 commit into from
Feb 1, 2021

Conversation

donaldong
Copy link
Contributor

@donaldong donaldong commented Feb 1, 2021

Summary

We don't really support JOINs well. Currently, it's still possible to have stale cache results if we are selecting from joined tables that do not filter conditions.

This drops the support for JON queries and we can revisit this later.

Test Plan

  • ci

📚 Related Pull Requests 📚

  1. [bug fix] Drop support for JOIN queries #6 👉 Drop support for JOIN queries 👈 (You are here)

@donaldong donaldong changed the base branch from main to base/donaldong/drop_support_for_j0dc6a22 February 1, 2021 18:18
donaldong added a commit that referenced this pull request Feb 1, 2021
Pull Request Branch: donaldong/drop_support_for_join_queries
Pull Request Link: #6
Pull Request Stack: donaldong/beta-1
@donaldong donaldong force-pushed the donaldong/drop_support_for_join_queries branch from 732060f to 52f74c7 Compare February 1, 2021 18:18
@donaldong donaldong requested a review from katyho February 1, 2021 18:24
teacher = Teacher.create!
expect_to_use_redis do
expect_not_to_use_redis do
Copy link
Collaborator

Choose a reason for hiding this comment

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

Technically we can support this query though right? What's an example join query that wouldn't be supported well, as long as we have this change to make sure that a filtering condition exists on the table we're selecting?

Copy link
Contributor Author

@donaldong donaldong Feb 1, 2021

Choose a reason for hiding this comment

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

Great question! Currently, it's possible to select columns from a table that does not have any filtering conditions:

SELECT "teacher_id" FROM "sites" INNER JOIN "teacher_sites" ON "sites"."id" = "teacher_sites"."site_id" WHERE "sites"."id" IN (...)

this query should be invalidated when teacher_sites records have changed

Pull Request Branch: donaldong/drop_support_for_join_queries
Pull Request Link: #6
Pull Request Stack: donaldong/beta-1
@donaldong donaldong changed the base branch from base/donaldong/drop_support_for_j0dc6a22 to main February 1, 2021 22:24
@donaldong donaldong force-pushed the donaldong/drop_support_for_join_queries branch from 52f74c7 to db1e4f3 Compare February 1, 2021 22:24
@donaldong donaldong changed the title Drop support for JOIN queries [bug fix] Drop support for JOIN queries Feb 1, 2021
@donaldong donaldong merged commit c6779fe into main Feb 1, 2021
@donaldong donaldong deleted the donaldong/drop_support_for_join_queries branch February 1, 2021 22:30
@donaldong donaldong mentioned this pull request Feb 1, 2021
@katyho katyho mentioned this pull request Apr 8, 2022
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.

None yet

2 participants