Closed ANIALLATOR114 closed 2 months ago
This pull request introduces indexes on the created_at columns of the rt_stop_time and rt_trip tables to improve query performance. The changes include updating the model definitions to include the indexes and creating a new Alembic migration script to apply these changes to the database. Additionally, the repo.py file has been refactored to remove redundant code and logging, and to add a filter to limit query results to the last two hours.
Files | Changes |
---|---|
SimplyTransport/domain/realtime/stop_time/model.py SimplyTransport/domain/realtime/trip/model.py migrations/versions/c6fd373f53c5_created_at_indexes.py |
Added indexes on the created_at columns of rt_stop_time and rt_trip tables and created a corresponding Alembic migration script. |
Summary by Sourcery
Introduced indexes on the created_at columns for the rt_stop_time and rt_trip tables to improve query performance. Removed redundant logging and simplified the query logic in the get_realtime_schedules_for_trips method.