Consider adding an index on (page_is_redirect, page_namespace, page_title) to the page table.
In T160916, the redirect filter on Special:AllPages and in ApiQueryAllPages was disabled in production because it is an unindexed query and, depending on parameters, can scan very many rows.
T173479 asked for the feature to be re-enabled and was closed invalid.
This 2025 community wish by @Klein also asks for such a feature. The wish asks for no limit on Special:ListRedirects, but if you look at the linked discussion, it would seem that re-enabling the ApiQueryAllPages feature would better suit this user's needs. They would like to run a bot which iterates over all redirects.
I am filing this task with the correct technical framing so that we can have a discussion about it. The question is whether the feature is sufficiently valuable to justify the index space. This question was not discussed in the historical tasks.
You can run unindexed queries on toolserver, and there are page table dumps, but it would be most convenient for users if the index were added, so that ApiQueryAllPages could be used as a generator with a redirect filter.