On Wed, May 30, 2018 at 02:02:31PM -0500, Justin Pryzby wrote: > For diagnostic purposes, I was able to to vastly improve the query runtime with > a CTE (WITH): I realized this was broken as soon as I sent it (for the essential reason of discarding rows before having sorted them). Sorry for the noise. Justin