Postgresql – Small result query with LIMIT 1000x slower than queries with >100 rows
I am trying to debug a query that runs faster the more records it returns but performance severely degrades (>10x slower) with smaller returns (i.e. <10 rows) using small LIMIT (ie 10). Example: Fast query with 5 results out of…