RAMdisk and MySQL in Ubuntu20.04
... MySQL ... slows down dramatically as the product number exceeds 60,000.

MySQL does not run slowly.  Trust me; it really, really doesn't.
What does get slower are the queries that you run against the data structures inside MySQL.

I was considering setting up a RAMdisk and using that for the MySQL temp data.

Ah ha!
It's not the size of the database that's giving you trouble.  It's the amount of temporary space being used to process the queries.  That says to me that you have some [poorly written] queries that are in need of some tuning.
Turn on the Slow Query log, see which queries appear in there and then start tuning those.
Often, it's only a handful of poor queries that bring an entire system to its knees.
Since volume/size seems to be an issue, here's some common things to think about:

Indexes.
Do you have [the right] indexes to support your queries?

Using &quot;select *&quot;?  Don't.
Always specify the columns you want explicitly in every query.
Pulling back redundant columns only adds to the network overhead seen by the client.

Using &quot;select distinct&quot; to get rid of &quot;duplicate&quot; rows.  Again, don't.
Fix the join conditions that are introducing the &quot;duplicates&quot;.

Joining to a bracketed select statement?  (This might be fixed in newer versions).
In some older versions, joining from a table to a select statement wrapped in brackets caused MySQL to &quot;create&quot; the bracketed result set in temporary space before joining it to the other table.



... running the whole MySQL database in RAM would be fast but unfeasible, I know.

Fast?  Probably not.  You're effectively &quot;conning&quot; the operating system into thinking that a big chunk of memory is actually disk space but, unless you have a lot more memory  besides that, the O/S will probably need to page that memory in and out, to and from disk, which is slow.
Worse still, as soon as the machine was powered off, the RAMDisk and everything on it (i.e. &quot;the whole MySQL database&quot;) would evaporate, like the morning dew.
Possibly not the most resilient operating model.  :-)