Hello Readbelow,
I figured out my problem. Basically, it was woocommerce wishlist. Somehow it was creating wishlists for bots and the table grew to over 1million records in the course of a few months. It really bogged the server down whenever trying to do a complex function.
I cleaned the table and required login for wishlists. Seems to be working so far…
Have you tried deleting wp all import?