Comment 1 for bug 1127802

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Note that this turns out to be a difficult thing to implement without getting rid of the LIMIT function on the query that selects the forum entries for the page. You'd need to group together adjacent deleted records by the same author, something which is probably only possible with a window function: http://www.postgresql.org/docs/9.1/static/tutorial-window.html

So, one might implement this as a postgres-only bit of functionality.

Alternately, just drop the LIMIT function from the query that gets the forum records, and in PHP process through them all to find the 10 unique non-deleted records for the page. If you use adodb recordsets for this instead of dumping the recordset into an array, you won't have to worry about running out of memory. There just might be some processing time involved, if you're dealing with a giant thread.