In any event, I am now of the opinion that this patch needs to be reverted outright and returned to the authors for redesign. There are too many things wrong with it and too little reason to think that we have to have it in 9.5.
Agreed; I'd already got to this thought while reading the thread.
I'll get on with that.
The patch is not of great importance to us? Since we are past 9.6 deadline it seems just worth reverting and leaving for next release to come back with a more isolated optimization. I don't want to add the last CF workload with this.
Reverted patch in HEAD and 9.5
Later, I will add the tests we discovered here to index scans, so that further optimization work is more easily possible.
Thanks Tom, Petr for analysis; thanks Jeff for bisecting.
--
Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services