PERF: work around LIMIT breaking query plan

(CTE is a optimisation boundary, so limit no longer has any effect on plan)