[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

09/16/2009 at 08:21AM PDT, ID: 24736622
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.7

MySQL / PHP select data faster

Asked by us-pata in Databases Miscellaneous, PHP and Databases, PHP Scripting Language

Tags: php, mysql, sql, select

Hi.

I have a database with about 200k entries, and i try to show 20 next entries from entrynum ie. 84800.
This takes 4-8 seconds to execute, wich is way to long for å web-site.

Is there any way to execute this faster?
See the code field for the code i use.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
mysql>  SELECT *
    -> FROM `images`
    -> WHERE chan = 'b'
    -> AND `reported`
    -> IN (
    -> '0', '1'
    -> )
    -> ORDER BY `id` ASC
    -> LIMIT 84800 , 20;
+--------+------+-------------------+----------------------------------+----------+-------+--------+----------+
| id     | chan | image             | md5                              | filesize | width | height | reported |
+--------+------+-------------------+----------------------------------+----------+-------+--------+----------+
| 116191 | b    | 1239642027572.jpg | 29cf26da75477b17dde7f44122c41c3b | 234525   | 881   | 1236   |        0 |
| 116192 | b    | 1239642039503.jpg | cdc0e5f8351c7b190f27b5452da40e29 | 30215    | 600   | 540    |        0 |
| 116193 | b    | 1239642042452.jpg | 5f4123fdf1aae8a5e26876761f20c17c | 160723   | 407   | 405    |        0 |
| 116194 | b    | 1239642044911.jpg | a65944cf224022426e7c959e5017bd83 | 86380    | 313   | 500    |        0 |
| 116195 | b    | 1239642045388.jpg | a9f32fa77d059d515c53c151a535f49f | 40498    | 640   | 342    |        0 |
| 116196 | b    | 1239642045716.jpg | 600f427fa525222538889a843edb45b1 | 65437    | 480   | 640    |        0 |
| 116197 | b    | 1239642047695.jpg | be4396ca231a3cd363483e27c8911464 | 162712   | 435   | 625    |        0 |
| 116198 | b    | 1239642050263.png | 51bedfb85f01b34f8338f29492800cc4 | 49279    | 901   | 538    |        0 |
| 116199 | b    | 1239642063400.jpg | 3815c2c4929a2b5fd0ea85a0b50c2b19 | 68896    | 469   | 297    |        0 |
| 116200 | b    | 1239642065678.jpg | 1fcd8f583ea7080c18ddef9dc0e3bdc8 | 152658   | 612   | 816    |        0 |
| 116201 | b    | 1239642067773.jpg | afb15e7adbf9a8cc7af801d311fefac4 | 27547    | 450   | 287    |        0 |
| 116202 | b    | 1239642071811.jpg | 42ac9aabd18996eeeca790a1f6f3a460 | 201878   | 834   | 1200   |        0 |
| 116203 | b    | 1239642076646.jpg | 3d5741c33476be17b1856a4619d26166 | 33359    | 492   | 370    |        0 |
| 116204 | b    | 1239642083927.jpg | 05f26039eb45647842937ff2e3dd48ec | 580083   | 1920  | 2576   |        0 |
| 116205 | b    | 1239642095095.jpg | 6978f1dd9812ceb682bc3e1a93dce724 | 22370    | 600   | 449    |        0 |
| 116206 | b    | 1239642105383.jpg | 0f67bb8adb74573c26b5d88a458572f1 | 236253   | 834   | 1200   |        0 |
| 116207 | b    | 1239642109318.jpg | 0737fc2429e6819ca2844d642933b82e | 90907    | 500   | 346    |        0 |
| 116208 | b    | 1239642112126.jpg | da391b6c8b68516dea67685755ebcfe9 | 64688    | 600   | 450    |        0 |
| 116209 | b    | 1239642113695.jpg | 79f692bdf914945e31d64bd97dbc169f | 186740   | 640   | 480    |        0 |
| 116210 | b    | 1239642118165.jpg | 52f2df0e7f89ce55b35c95ee2916d59d | 878492   | 2280  | 1600   |        0 |
+--------+------+-------------------+----------------------------------+----------+-------+--------+----------+
20 rows in set (6.65 sec)
 
Keywords: MySQL / PHP select data faster
 
Loading Advertisement...
 
[+][-]09/16/09 08:41 AM, ID: 25346834

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/16/09 08:48 AM, ID: 25346933

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/16/09 09:05 AM, ID: 25347132

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/16/09 09:29 AM, ID: 25347410

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/16/09 09:44 AM, ID: 25347552

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/16/09 10:17 AM, ID: 25347837

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/16/09 10:35 AM, ID: 25348008

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/16/09 11:02 AM, ID: 25348291

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/16/09 01:53 PM, ID: 25350001

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/16/09 02:42 PM, ID: 25350508

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Databases Miscellaneous, PHP and Databases, PHP Scripting Language
Tags: php, mysql, sql, select
Sign Up Now!
Solution Provided By: wuff1uk
Participating Experts: 3
Solution Grade: A
 
 
 
Loading Advertisement...
20090824-EE-VQP-74 - Hierarchy / EE_QW_3_20080625