This PR is to help out the Projects Dependencies Link daily job which has been failing to complete for a while now. The main reason this job fails is that it is impossible to query the dependencies table because of its large size and it is querying an unindexed column. The PR adds an index for created_at and scopes the values down to remove the time portion and index it as a Date so that values are grouped up a bit in the index and updates the jobs to query by Date and instead of DateTime.
This migration is something that should be run manually outside of our normal deployment since it will take some time for the database to add the indexes.
This PR is to help out the Projects Dependencies Link daily job which has been failing to complete for a while now. The main reason this job fails is that it is impossible to query the
dependencies
table because of its large size and it is querying an unindexed column. The PR adds an index forcreated_at
and scopes the values down to remove the time portion and index it as a Date so that values are grouped up a bit in the index and updates the jobs to query by Date and instead of DateTime.This migration is something that should be run manually outside of our normal deployment since it will take some time for the database to add the indexes.