Without the limit on the subquery, postgresql greatly overestimates the
number of items in the cardinal product, which causes it to prefer
doing an ordered scan on origins rather than filtering on sorting,
which is extremely slow.
Adding this limit bounds the size of the cardinal product to the number
of matches in the origin index, which postgresql knows to be low,
so it automatically prefers the index scan.