Page 1 of 1

Search Suggestions using MySQL.

Posted: Tue May 29, 2007 9:01 pm
by mattkenefick
I'm actually making this with Flash but the communication link is through AMFPHP which is PHP based.

I run all the queries and stuff through PHP and thats all fine. The only question I have is about Caching MySQL results on the client side and performance.


I have it setup to query a database with LIMIT 10 every 1 second. I'm not sure how thats going to affect performance when, lets say, 5,000 people are using it at once. Can MySQL handle that just fine or am I going to run into some issues?

If I am, are there any suggestions you can offer to help on this one?
Would it be better to just put all the database suggestions into an array and search that? That would only bring up the issue of what happens when theres 10,000+ suggestions (Which there won't be in this case but I'd rather practice the right way then avoid learning it)

Any help? 8O

Posted: Wed May 30, 2007 8:47 pm
by califdon
You haven't given us much to go on. I have no idea what you mean by "database suggestions." Or what you mean by "LIMIT 10 every 1 second." Show us your SQL query(ies). How are you regulating the "1 second" part of it? How big are your tables? In general, your performance will be determined mostly by the server it's on, not by your queries.

Posted: Wed May 30, 2007 9:00 pm
by s.dot
5,000 queries per second will effect performance if a single query takes longer than .005 seconds. What you should try to do is set up a central script that will update it for everyone. That would be 1 query per second instead of 5000 queries per second.