Fixes cardinality estimation problems around LIMIT
Merge pull request #3599 from systay/limit-cardinality

Fixes cardinality estimation problems around LIMIT