Danbooru2021
Danbooru2021 copied to clipboard
FilterView performance is slow
The query when using FilterView is not performant. Mainly because the use of like statements requires scanning the tags table (no useful index possible).
E.g. the following query:
select image_id from images where is_deleted=0 and is_banned=0 and image_id in
(select image_id from imageTags where tag_id in (select tag_id from tags where name = '%girl%')) order by image_id
takes over 22 seconds to execute (returning 6,260,963 rows).