MYsql Indexes, Whats the best thing to do.
Im trying to ensure my DB’s querys run as fast as possible.
However ive come across an issue where one table takes a LONG time to run a delete.
SO:
Whats the best thing to do.
Where should index’s be put?
for example,
I have a table with 500,000 IP address’s in it, However when i delete from this table i "delete from ips where ID = "123";
does this mean that i should index ID as this is what my querys are using as the WHERE.
As i understand it, It would be silly indexing any other column as they are never used against a query and would mean that any querys run on the table will slow down as it has to INDEX the other columns needlessly.
Any thoughts?
I suppose what im trying to get to is:
Do i only need to INDEX columns I use in WHERE clauses?
Google is being fairly helpful but just wondered what you guys thought?
View full post on Tycoon Talk
best, Indexes, mySQL, Thing, what's