Hi,
I have a table contains 80.000 rows approx and I set (id) field to be primary key and index by using phpmyadmin.
my question is that right ? or it must be primary key or index not both
| SitePoint Sponsor |
Hi,
I have a table contains 80.000 rows approx and I set (id) field to be primary key and index by using phpmyadmin.
my question is that right ? or it must be primary key or index not both
Yes, you did the right thing. IIRC a Primary Key is just a special form of a UNIQUE INDEX in MySQL
I'd rather be poor than run a proxy site.


if you made it both the primary key and in index, then the index is redundant
a primary key is an index, so the extra index is not needed
thank you
but, when i did this (both). The search in the table would be slowly or would not affect at search speed ?


redundant indexes do not affect search speed, they just makes inserts, updates, and deletes slower
r937, thank you
Bookmarks