Comment 9 for bug 1236979

Revision history for this message
Mike Rylander (mrylander) wrote :

I hesitate to push too much into the outer query, because one of the neat features depesz is leveraging is the fast-startup behaviour of cursors in PG when it believes that the time-to-first-row will be very significantly less than the cost of generating the full result set and you tell it that you won't try to scroll backwards with NO SCROLL. The more constraining information we put in the outer query (and limit+offset in particular can defeat this feature) the more likely PG will decide that it's better to just generate the full result set

That said, I'm not against trying out any and all formulations of the stored proc. Liam, are you in a position to point these ideas at a realistic data set? If so, some quick testing should be very instructive as to the benefits of any of these ideas.

And, thanks for digging into this. The more folks that understand these deeper bits of EG, the better!