Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the number of rows in mysql table matter?

Tags:

mysql

I'm coming up with a web app which will want me to store more than 8 million rows. Will it be fine to handle those many number of rows with MySQL without having any performance degradation? Assume my RAM to be 4 GB and Infinity GB Harddisk space. Also, the main fields have been indexed.

like image 525
1s2a3n4j5e6e7v Avatar asked Dec 04 '25 19:12

1s2a3n4j5e6e7v


2 Answers

I have a table which is very often read (written once every day at 4:00 AM), and it recently reached 8 million rows after a huge import.

The query also joins this table to another ~400k rows table.

There was no performance degradation after the import, compared to before it, so I believe you should be just fine, with a good server. (We have a dual-quad core, 8GB RAM)

like image 94
ceteras Avatar answered Dec 06 '25 07:12

ceteras


You will have to try to find out for sure, but I think 8 million rows shouldn't be much of a challenge for a modern, well-equipped server, at least not for reading operations in a well-indexed table.

Operations like ALTER TABLE and others that can't make use of the indexes are bound to take longer than in an empty table - how much longer, you'll have to find out.

The question you should always ask yourself is whether you really need all those 8 million rows on a daily basis. If you're generating logs, it makes sense to frequently archive older entries and to remove them from the live database.

You are mentioning Stack Overflow as a comparison - look at their server setup. It's larger than you mention of course, but not that much - and they have to manage tens of thousands of requests every minute.

like image 22
Pekka Avatar answered Dec 06 '25 07:12

Pekka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!