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

[FLOW-28] Rebuilt Bucket Query Views to be faster and more accurate #131

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jerryzhou196
Copy link
Collaborator

@jerryzhou196 jerryzhou196 commented Nov 6, 2024

This PR creates a new Hasura migration that updates the review bucket views (course_easy_buckets, course_useful_buckets, prof_clear_buckets and prof_engaging_buckets) to only include reviews that have:

  1. A non-NULL liked value
  2. Either a non-NULL course_comment or prof_comment
  3. The relevant rating field being non-NULL (e.g. course_easy for course easy buckets)

It also adds the same materialized pattern and indexing implemented in #51 for the review bucket views for more optimized retrieval.

PR Summary Generated with AI Copilot:

This pull request updates the review bucket views and materialized views to include only reviews with a rating and either a professor or course rating. The most important changes include dropping and recreating views and materialized views, updating the conditions for review inclusion, and adding necessary indexes and triggers.

Changes to views and materialized views:

  • Dropped existing views and materialized views for course_easy_buckets, course_useful_buckets, prof_clear_buckets, and prof_engaging_buckets. [1] [2]
  • Recreated views and materialized views with updated conditions to include only reviews with a non-NULL liked value and either a course_comment or prof_comment.

Indexes and triggers:

  • Added indexes to the new materialized views for improved query performance.
  • Created a function and trigger to refresh the materialized views after any insert, update, or delete operation on the review table.

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