Thanks for the tip. I came up with a new query using derived tables that now results in 17,000 posts being queried in milliseconds!JoshyPHP wrote: Wed Feb 15, 2017 12:27 pm Oh ok, I understand now, both the purpose and why the query will end up being slow if topics get a bit too big. (assuming this isn't an issue with the query plan)
If you resume work on that extension you may want to try replacing the subquery with a derived table that you would join to the posts table usingpost_id
. MySQL generally handles derived tables better.
So I posted a new ALpha 3 version.
Joshy Maybe you could look at my query, and see if it can be improved? It works now, but because I am using Group By, postgresql is failing to work with it now. Otherwise, it's good for MySQL and SQLite.