I've run once a test on my laptop because was curious as well. From my results (on laptop - 16GB RAM, 4 cores) the upper limit was 12k. Above it planning time was unbearable high - much higher than execution time. It's been tested on 9.5 -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html