Speed-Up queries by better look-ups / reachable trips
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 24
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
Our current queries do a lot of linear look-ups on trips.
We can speed-up our queries quite immensely by adding look-ups to the stop-tables.
These should allow finding the correct stop by it's ID within the table, instead of searching linearly over all trips.
In addition, we currently only reach stops. But we can skip over looking at entire trips by remembering which trips we already reached.
A trip cannot improve any result, if we reached it at the same (or earlier) departure (base station) on an earlier stop.
If we only reached it at the same departure, but a later stop, we can limit our search to the stations up to the stop we already reached.
This would allow us to scan each trip only once per departure.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing query logic that linearly searches trips and stop tables. Done means stop IDs use table lookups and each trip is scanned only once per departure, with later-stop limits applied as described.
Written by the indexing model from the issue text.
Assessment
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100