I am creating a PHP app that will receive a lot of traffic. I've always learned that I have a number of SQL queries Should be limited (now about 15 per visitor) I can limit this to about half, filter and sort the data using PHP, but will it be faster? Alternatively, I can use "join" in the query to reduce the number of questions, but is it much faster than executing many queries? Thanks!
If you have 15 questions per visitor, then maybe you have done something wrong, unless That your app is not too big
Using PHP to sort and filter data instead of MySQL Sorting and filtering in PHP will not speed up your application, To ensure this is made slow, MySQL is very fast optimized to be given the right indexes, so you should use it when you can. Learn about database indexing and it will make your life easier and demonstrate the growth of your application. Here's a link: Many queries versus vs ask you to use the fast to execute several queries faster The answer is yes, it will always be faster to get into the right index. Whatever comes back to the first topic, indexing. However, keep in mind that as soon as the pair is added you are as efficient as you do it, if done right then it will be extremely efficient, and if it is wrong, then to correct it The basic information must be known. You can find here for an introduction to join here:
No comments:
Post a Comment