|
|
|
Extra: Range checked for each record (index map: 0x1)
|
|||
|---|---|---|---|
|
#18+
Yesterday i accomplished another interesting question with great help of Cygapb-007 . Thanks again. See: Previous Topic But for my final query i have an Execution Plan with : Extra: Range checked for each record (index map: 0x1) I haven't encountered before such Extra clause. Thats why the question is simply: What is it? (INTERESTED especially in this clause) Final Query: Код: sql 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. Query QEP: Код: sql 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. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. Table structures: wd_timeline Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. wd_teams Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. wd_matches Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.09.2013, 12:05:46 |
|
||
|
Extra: Range checked for each record (index map: 0x1)
|
|||
|---|---|---|---|
|
#18+
Shahriyar.R What is it? In short, that shows that there are no index that can be used directly , but there is some probability of using some of table indices at least for some records. FYI, if you open this link http://lmgtfy.com/?q=mysql Range checked for each record and follow the very first link there: http://dev.mysql.com/doc/refman/5.1/en/explain-output.html Then press Ctrl-F, "range c", Enter, you'll find this: авторRange checked for each record (index map: N) MySQL found no good index to use, but found that some of indexes might be used after column values from preceding tables are known. For each row combination in the preceding tables, MySQL checks whether it is possible to use a range or index_merge access method to retrieve rows. This is not very fast, but is faster than performing a join with no index at all. The applicability criteria are as described in Section 8.3.1.3, “Range Optimization”, and Section 8.3.1.4, “Index Merge Optimization”, with the exception that all column values for the preceding table are known and considered to be constants. Indexes are numbered beginning with 1, in the same order as shown by SHOW INDEX for the table. The index map value N is a bitmask value that indicates which indexes are candidates. For example, a value of 0x19 (binary 11001) means that indexes 1, 4, and 5 will be considered. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.09.2013, 12:20:27 |
|
||
|
Extra: Range checked for each record (index map: 0x1)
|
|||
|---|---|---|---|
|
#18+
tanglir, :D truely i have already read documentation...before your link :) I think i ask wrong question sorry... Exactly what i want: lets extract This - "DERIVED" query from full query and test it . Extracted from full query: Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. QEP of extracted query: Код: sql 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. As documentation state: it is from table t = wd_team and index map is : 0x1 = 1. it will check sequentally from SHOW INDEX: Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 1. So it considers to use PK from t/wd_teams?.(after column values from preceding tables are known) For testing purpose i tried to ignore this PK: Код: sql 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. QEP changed : Код: sql 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. Exactly it changed from Range Checked to BNL. and added some indexes: Код: sql 1. 2. QEP changed one more time it seems not bad except BNL: Код: sql 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. 2. So for this purpose which one i must choose? BNL over Range Check? is there any exact rule? Another question is how i can avoid both Range Check and BNL here? maybe some tricks. Thanks. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.09.2013, 14:42:33 |
|
||
|
Extra: Range checked for each record (index map: 0x1)
|
|||
|---|---|---|---|
|
#18+
Shahriyar.R So it considers to use PK from t/wd_teams? yes, at least if documentation is correct ) Shahriyar.R So for this purpose which one i must choose? BNL over Range Check? is there any exact rule? dont realy know, but using join buffer means no index is used at all while RC means they at least could be used... you better look at actual query time and decide for yourself Shahriyar.R Another question is how i can avoid both Range Check and BNL here? maybe some tricks. one way or another, but you must join 3 tables, and using not just equality/comparison conditions... can't think of any trick in this situation. what if you try to calculate this way nah, i was going to propose the same method that was rejected in previous topic :) ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.09.2013, 15:24:20 |
|
||
|
Extra: Range checked for each record (index map: 0x1)
|
|||
|---|---|---|---|
|
#18+
[off] MS SQL [/off] ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.09.2013, 15:24:56 |
|
||
|
Extra: Range checked for each record (index map: 0x1)
|
|||
|---|---|---|---|
|
#18+
Cygapb-007, I changed query as you wrote: Код: sql 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. QEP doesnt changed: Код: sql 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. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. I also attached visual explain plan: ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 17.09.2013, 16:07:34 |
|
||
|
|

start [/forum/topic.php?fid=47&msg=38399062&tid=1836034]: |
0ms |
get settings: |
8ms |
get forum list: |
12ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
58ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
46ms |
get tp. blocked users: |
1ms |
| others: | 205ms |
| total: | 347ms |

| 0 / 0 |
