Danbooru

Repeated statement timeout errors

Posted under Bugs & Features

Greetings everyone,

While looking for a new desktop background, I decided to search for my (slightly uncommon) aspect ratio directly, and go through the posts.

I searched for ratio:12:5. This seemed to work as intended, but upon trying to go to the second page of results I keep getting the statement timeout message (ERROR: canceling statement due to statement timeout).

Is there anything I can try in order to be able to see these posts? The first page had a lot of great artwork and I fear I am missing out on much of the same on the second (and onwards).

Thank you very much for taking the time to read.

wekateka said:

Greetings everyone,

While looking for a new desktop background, I decided to search for my (slightly uncommon) aspect ratio directly, and go through the posts.

I searched for ratio:12:5. This seemed to work as intended, but upon trying to go to the second page of results I keep getting the statement timeout message (ERROR: canceling statement due to statement timeout).

Is there anything I can try in order to be able to see these posts? The first page had a lot of great artwork and I fear I am missing out on much of the same on the second (and onwards).

Thank you very much for taking the time to read.

@wekateka
Search with ratio:12:5 order:score

hazknight said:

Ratio searches are slow, and normal users have lower timeout limits.
Try adding another tag to your search to find more specific posts.

That's an instant timeout for me.

Huh.
Normally it does work, though :/.

You can try limiting the post ID range through which you want to search, like ratio:12:5 id:1..500000. When you’re done with that, move to ratio:12:5 id:500001..1000000, etc. If you’re still getting timeout errors, try a smaller range. This technique should work with any query that times out otherwise.

If that’s too bothersome and you’re fine with userscripts, try “Danbooru 2 Tweaks” from about:userscripts (don’t confuse it with two similarly named scripts). It has a “post ID chunk mode” that makes the above technique easier by adding a second paginator. If you can see one page of results just fine, I suggest trying the open-end mode: ratio:12:5 order:id id:1.. and then step forward with the ID paginator.

I haven’t updated the script in a while, but it should still be working fine. Feel free to dm me if you try it and notice any issues.

To add on to all of the above, timeouts can also occur due to the size of the request.

Let's say that your request size is 100 posts. With your search of ratio:12:5, Danbooru was able to find and return 100 posts within six seconds which is the database timeout for Gold (Help:Users). However, on the second page, it's unable to find 100 posts within six seconds, most likely because they are further spaced apart.

However, instead of adjusting your user settings, Danbooru supplies the metatag limit that you can use to overide your settings. So to lower the limit to something like 10 posts, you would add the metatag limit:10.

1