"Sebastiaan van Erk" <sebster-postgresql(at)sebster(dot)com> writes:
> This shows the ENORMOUS different time it takes for the two queries even
> though they both have the limit set.
So? They're not the same query. (In particular, the row limit in the
protocol only says how many rows to deliver in the first batch. The
presumption is that you'll eventually grab the rest, and so the query
is planned on that basis.)
regards, tom lane