WordPress page_rewrite_rules many URL rewrite mysql slow

There are use cases that Wordpress core isn’t well optimized for. The end result is poor page load and sub optimal performance. One of these use cases is the too-many-URLs or menu links issue. WP is then forced to break down these requests into smaller chunks to process them. Except that smaller chunks almost always amount to significant overhead especially with a high number of URLs. Here’s the fix.