FlowKit
FlowKit copied to clipboard
Use 'lag' instead of 'row_number' in ConsecutiveTripsODMatrix query
The current implementation of ConsecutiveTripsODMatrix finds consecutive event pairs by using a row_number window function to rank events and then self-joining on rank = rank-1.
Using a lag window function instead roughly halves the time taken for this query to run.
It's probably best to address this issue after any work to restructure the events tables.
#3460