Parallel Queries so Multiple CPUs utilized

I have some report generation that will peg my CPU on the DB at 100% for several hours. However, it is only ever hitting 1 CPU when I have 32 available. How do I get the queries to optimally break out to utilize all of my CPU cores which would significantly reduce my querying time? I am running MySQL 8. Thanks!

That’s up to you to manage, depending upon exactly what you’re doing and how well they’re parallelizable and how you’re running the existing processes.

We’d need to see the specifics of what you’re doing to be able to offer specific recommendations.

Thanks for the reply. Are there any good documents you can share about parallelizing my django code? (specifically queries)

There’s no generalized solution or approach - you can only address this in the context of your specific requirements.

I’m making the guess that if you’ve got a process issuing queries that runs for “several hours”, then you’re not doing this in the context of a single web request. In that case, the simplest approach is to break this larger set of queries into a number of smaller components or steps then use something like Celery to perform them.