Skip to content

Conversation

@aagrawalrtsl
Copy link
Contributor

…nd_registrations

Story card: sc-17573

Because

We need to move a our mat views to partitioned table

This addresses

Creating a partitioned table reporting_facility_monthly_follow_ups_and_registrations under simple_reporting schema
Both mat view and partitioned table version will exist for a small time for monitoring in prod

Test instructions

Suite test

@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2026

This PR is stale. Please review/update it or close it.

@aagrawalrtsl aagrawalrtsl requested a review from a team January 5, 2026 05:51
Copy link
Contributor

@igbanam igbanam left a comment

Choose a reason for hiding this comment

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

LGTM otherwise

end
reporting_table = args[:table_name]
Reports::Month.order(:month_date).select(:month_date).each_with_index do |reporting_month, index|
RefreshReportingPartitionedTableJob.set(wait_until: Time.now + (index * 45).minutes).perform_async(reporting_month.month_date.to_s, reporting_table)
Copy link
Contributor

Choose a reason for hiding this comment

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

How do we know 45 minutes works for a table? or How do we know if it's too much?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Honestly, 45 mins is a little too much for a partition refresh currently.
This just schedules every partition refresh at a marginal interval to prevent every refresh happening at once and not block any other jobs that would be come as part of regular functionality.
Original thought behind this is to use this job just once for each table initially when they are moved from materialized view to a partitioned table

Copy link
Contributor

@igbanam igbanam left a comment

Choose a reason for hiding this comment

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

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants