I have 5 columns in a table in database and two are unique (one is integer and another is a string).
integer are like
1,5,6,7,9,0 and
string are like http://exmaple.com/Book-on-the-self-no-2.
Now which column should be used for searching rows??? how will it impact the performance?
database is sql or mysql?
Thank..
Generally speaking, the less comparisons and manipulation of data (like reading from disk) MySQL has to make, the faster it’ll go.
Which means that searching on integers (a couple of bytes) will generally be faster than searching on (possibly long) strings.
In your case, as a sidenote : don’t forget adding an index on the field your searching on — depending on the kind of query you’re doing, it’ll speed up things a lot.