Full table scan instead of filter

Code reviewMedium18 min

Your task

Review this Python data-access function that returns recent active orders for one customer. The orders table has tens of millions of rows.