How to support fifteen thousand terms in WordPress?

I solved this issue after Rup in one of the comments pointed out that the parent categories dropdown was most likely the culprit. Sure enough, that was the issue. It appears WordPress was attempting to populate the dropdown with 15,000 items which were causing an excessive query to be made to retrieve those items.

The simple fix in my instance was making my custom taxonomy, non-hierarchical. My locations were not using any parent/child relationship, so the structure could be flat and just standalone location terms.

$args = [
        "label" => __( "Locations", "propertynet" ),
        "labels" => $labels,
        "public" => true,
        "publicly_queryable" => true,
        "hierarchical" => false,
        "show_ui" => true,
        "show_in_menu" => true,
        "show_in_nav_menus" => true,
        "query_var" => true,
        "rewrite" => [ 'slug' => 'location', 'with_front' => true, ],
        "show_admin_column" => false,
        "show_in_rest" => true,
        "rest_base" => "location",
        "rest_controller_class" => "WP_REST_Terms_Controller",
        "show_in_quick_edit" => false,
];

Setting the configuration property on the taxonomy arguments to false is what made WordPress be able to work with my large amount of terms: "hierarchical" => false – this poses a larger problem if you’re wanting your terms to be hierarchical, which seems would require re-implementing the parent category dropdown to support AJAX loading and work similarly to how pagination works normally on this screen.

Hopefully, this helps anyone else who encounters the same problem.