FlowKit icon indicating copy to clipboard operation
FlowKit copied to clipboard

Use 'lag' instead of 'row_number' in ConsecutiveTripsODMatrix query

Open jc-harrison opened this issue 4 years ago • 2 comments

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.

jc-harrison avatar Sep 23 '21 09:09 jc-harrison

It's probably best to address this issue after any work to restructure the events tables.

jc-harrison avatar Sep 23 '21 09:09 jc-harrison

#3460

greenape avatar Sep 23 '21 09:09 greenape