Adding a filter to wp_edit_posts_query() to prevent hierarchical display of pages

I don’t think it can be done that way, in class-wp-posts-list-table.php I found this line

$this->hierarchical_display = ( $post_type_object->hierarchical && 'menu_order title' == $wp_query->query['orderby'] );

It’s not filtered and it directly depends on the unfilterable attribute “is hierarchical” and the post order set in the admin interface (edit.php).

What you can do is to try this: change the pages order in the admin page, order them by date. If it solves your problem, that is a simple solution to your problem; If it doesn’t, I’d say that the hierarchical display doesn’t have anything to do with the speed in this case.