akashbb Posted October 13, 2008 Share Posted October 13, 2008 I've making an ecommerce site which has about 100,000 different items, each one with it's own, unique 7 digit code, and they aren't in order. If i were to map an inputted code to the 100000 codes in the database in order to find out more information on product, would there be significant lag in finding the information? If so, how much? Thanks for your replies... Quote Link to comment Share on other sites More sharing options...
aebstract Posted October 13, 2008 Share Posted October 13, 2008 What do you mean by map an inputted code? Depending on exactly what you're trying to do there may be little to none or a decent bit. Can you explain a little bit more in depth of what you're gonna do? Quote Link to comment Share on other sites More sharing options...
akashbb Posted October 13, 2008 Author Share Posted October 13, 2008 Sure. basically this one collector has had about 100,000 items with him that he's collected over the past 50 years or something. Anyway, he had given each item a code, a 7 digit code. So every single one of these items has a unique 7 digit code. Now let's say he inputs 1984736. I've got to search the database and find the product with this particular code. Is there a way to speed up the searching process? What would be the time lag if I were to implement it using a simple linear search? Quote Link to comment Share on other sites More sharing options...
Stooney Posted October 13, 2008 Share Posted October 13, 2008 A simple query for that particular product id would be your best bet. MySQL is designed for stuff like this. Quote Link to comment Share on other sites More sharing options...
redarrow Posted October 13, 2008 Share Posted October 13, 2008 deadecated database that it sorry.......... with all them records a deadcated mysql database would help nicly............ make sure you also use mysql functions as possable defently use the LIKE function....... if you are using a databse with php includded then your defently see better results with a mysql deadecated databse....... Quote Link to comment Share on other sites More sharing options...
akashbb Posted October 13, 2008 Author Share Posted October 13, 2008 yea, but wouldn't using a query take a really long time? Because 100K items seems to be quite a bit.. how much time would it take to locate a particular item, worst case? Quote Link to comment Share on other sites More sharing options...
Stooney Posted October 13, 2008 Share Posted October 13, 2008 It would find it faster than you think. Try it. Make a quick script to loop 100,000 times just filling a table with entries. Then benchmark it with microtime(). Quote Link to comment Share on other sites More sharing options...
akashbb Posted October 13, 2008 Author Share Posted October 13, 2008 wow, looks good. Guess I don't have to worry too much about the time it would take then? Quote Link to comment Share on other sites More sharing options...
Stooney Posted October 13, 2008 Share Posted October 13, 2008 Not at all. Also, in my above post I meant use microtime() to benchmark the query trying to retrieve the single result, not filling the table. Just thought I'd make that clear. Quote Link to comment Share on other sites More sharing options...
Liquid Fire Posted October 13, 2008 Share Posted October 13, 2008 yea, databases are design to query table to 100,000's of record fairly quickly especially it you are using a number index. You always want to make sure you index fields that might be in the On or Where clauses. Quote Link to comment Share on other sites More sharing options...
CroNiX Posted October 13, 2008 Share Posted October 13, 2008 How long does it take you to get a result from google? They probably have the largest database in existence. A split second... Quote Link to comment Share on other sites More sharing options...
Stooney Posted October 13, 2008 Share Posted October 13, 2008 How long does it take you to get a result from google? They probably have the largest database in existence. A split second... They also use complex algorithms as opposed to simple sql queries. Quote Link to comment Share on other sites More sharing options...
akashbb Posted October 13, 2008 Author Share Posted October 13, 2008 Alright! Thanks a lot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.