Danbooru

Failbooru with favourites

Posted under General

葉月 said:
I'm seeing a very specific failbooru with this search. It doesn't happen on page one, although it seems to be slow enough to fall just under the timeout limit, which page 2 then crosses. Albert, any idea what's wrong?

Does it happen on page 3 and other pages as well?

This is the query it generates:

SELECT p.* FROM posts p JOIN favorites f ON f.post_id = p.id WHERE true AND p.status <> 'deleted' AND f.user_id = 615 AND p.rating = 'e' ORDER BY f.id DESC offset 20 limit 20;

Playing around with the limit, if you set the limit really high (like 1000) there are no issues. Setting the limit to 1, the database seems to consistently conk out on page 30.

Some explain analyze results: http://pastie.org/1181281

Sorry for the necro but I have been having this issue as well for several days, anything I search under my favorites can go up to half the pages and then I cannot go further. It's starting to bug me because I can search my normal favorites with no tags fine.

1