I read somewhere that there is a guiding principle to limit the number of rows in tables to below 1 million. I was wondering if this was true. For a project I have I will roughly have tables with 10,000 rows, 40,000 rows, 160,000 rows, and 100,000 rows respectively. What performance could I expect on a 4 core, 8 GB machine for this? (I know some people achieved 20k requests per second)
Share
The one million number is bogus. I’ve run MySQL instances with tables that have 20 million rows and over a dozen columns. Queries weren’t fast, but the application was offline data processing and performance was more than adequate.
You should benchmark queries on your own system to determine its performance. I can’t tell you anything about a system with “4 cores, 8 gb” beyond the fact that 8 GB is a good starting point for a big database server (you should be able to keep your indexes in memory, and smaller tables may also fit in memory). Four cores could be plenty of CPU, but it might not be. It depend entirely on what sort of cores they are.
You also shouldn’t ignore disk performance, particularly if your tables won’t fit in RAM. I think the machine I had 20m rows on had a RAID 1+0 array of 15k RPM disks.
But don’t take my comments to mean that you need more RAM, more CPUs or faster disks. Run some benchmarks on your own system. Make sure your system has an appropriate schema for your queries. Make sure you have as few subqueries and views (results aren’t indexed) as possible. Make sure your tables are properly indexed. Then look at your performance and hardware.