Very slow with >4500 records

As @bnomei wrote in his article on caching, using PHP8, Nginx, and enough RAM can already make a big difference.