Jump to content

Database Search Optimization


MrFish

Recommended Posts

If I have a code that regularly searches a database with tens of thousands of entries (lets say it's a users database) would it be quicker to search by INT or VARCHAR or does it matter?

SELECT * FROM users WHERE id=6468

or

SELECT * FROM users WHERE username='testuser'

I would imagine that the first would be much quicker.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...