mysql table rows limit?

mysql, php

Solution

It's very unlikely that you will approach the limitations of a MySQL table with two columns that are only integers.

If you're really concerned about query performance, you can just go ahead and throw an index on both columns. It's likely that the cost of inserting / updating your table will be negligible even with an index on the device ID. If your database gets huge, it can speed up queries such as "which users prefer this device". Your queries that ask "what devices do this user prefer" will also be fast with an index on user.

I would just say to make this table a simple two column table with a two-part composite key (indexed). This way, it will be as atomic as possible and won't require any of the tom-foolery that some may suggest to "increase performance."

Keep it atomic and normal -- your performance will be fine and you won't exceed any limitations of your DBMS

Problem

I'm new to mysql & I have coded my first php-mysql application. I have 30 devices list from which I want user to add their preferred devices into his account. So, I created mysql table "A" where some device-id's are being stored under particular userID like this ``` UserID | Device Id 1 | 33 1 | 21 1 | 52 2 | 12 2 | 45 3 | 22 3 | 08 1 | 5 more..... ``` Say, I have 5000 user-ids & 30 devices-ids. & If each user has 15 device-id's (on-average) under his account records. Then it will be 5000 X 15 = 75000 records under Table "A" So, My question, Is there any limit on how many records can we store in to mysql table ? Is my approach for storing records as mentioned above is correct ?? whether it will affect query performance if more users are added ? OR there is any better way to do that ?

Original source