I have a table with 2.4M+ rows, and no indexes. I am 100% sure all the rows have one column (we'll call this id
) that is unique, it is of type VARCHAR(255)
.
I now have a file of approximately 10,000 id
's and need to pull the entire row for each.
Is using IN(...)
my best option? Should I add an index?
I was thinking for some thinking of something like this:
SELECT * FROM archive_table WHERE id IN('id1', 'id2', ... 'idn');
This is effectively archived data and only accessed by me every few weeks.
System: MySQL 5.0.45 Table: MyISAM