What kind of SSD to speed up querying a lot of data? For research purposes I am using a big MariaDB database (~500 GB) with 20 Tables (engine: myISAM) and around 9 Billion rows. Due to missing free storage on my Laptop (16 GB RAM), I put the data on an external hard drive. This was sufficient for simple queries. But for more complex tasks the queries take several days. Most of the tasks will be SELECT queries (with multiple joins).

This is why I want to invest into a new internal hard drive (1-2 TB), which will be used in a server setup (128 GB RAM). Due to performance reasons, I think a SSD would be the right choice. The mainboard has both free PCIe x8 and SATA 6.0GB/s slots.

Is there a difference between PCIe SSDs and M.2 SSDs?

What kind of SSD would be the best value for money according to my requirements? I do not want to spend more than 300 $?
You can't fix a performance problem by throwing hardware at it.

Even if you can find a fast enough SSD to handle the several-day query today, what will happen tomorrow when the data is bigger and/or you need another JOIN.

In many cases, a "several-day query" can be turned into a "several-hour" query by reformulating the query and/or adding a 'composite' index.  Or even "re-thinking" the problem.

Let's discuss the query and see if it can be sped up for $0.00.