This is probably perilously close to a dev request and I apologize for that.
The situation is that I’m working on optimizing a site with 80,000+ posts (adding around 100 a day). The site owner wants to have ‘recent posts’ on the footer of every page. I’m using the default flex block, and when we run tests it overloads the SQL server.
We were able to track it down to exactly one thing from td-composer (2.6 | built on 17.06.2020 8:12)
class td_data_source, static function shortcode_to_args
If I add 'no_found_rows' => true to this:
$wp_query_args = array(
'ignore_sticky_posts' => 1,
'post_status' => 'publish'
);
then the SQL queries are much gentler and don’t crash. However this conflicts with pagination (which is likely why you don’t have it coded in there).
I believe a sustainable correction would be to check if there’s pagination enabled (since you can disable it in the blocks) and if NOT, to set that argument for WP_Query. That would enable everyone to improve speed without negatively impacting anything like pagination.