5 ms·
I think the only time it makes sense to use a linear search is if you think the number of items on your list is low enough that it doesn't even matter what data
by gweinberg 8y ago
I think the only time it makes sense to use a linear search is if you think the number of items on your list is low enough that it doesn't even matter what data structure you are using. But I would probably use a set rather than a list anyway if only because that more accurately reflects the nature of the data.
- lloeki 8y agoIIRC MySQL just skips using indices and does a linear search when a table size is small enough.
- machinecoffee 8y agoProbably a lot of DB Servers do that - which is why the plan for a query can change as the amount of data per table increases.