Announcement

Announcement Module
Collapse
No announcement yet.

Why would the same query use indexes sometimes and not others?

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why would the same query use indexes sometimes and not others?

    Why would the following query example use an index 99.9% of the time and not the remaining .1%? It seems like I have quite a few of these going on but this one is the largest example:


    # pct total min max avg 95% stddev median# Count 10 221029# Exec time 0 3727s 21us 1577s 17ms 1ms 4s 69us# Users 3 secretbrok... (94047), soap (3), root (2)# Hosts 2 192.168.0.... (117076), 192.168.0.... (103953)# Databases 6 broker_his... (187658), (24392), ic_users (4500)... 3 more# Time range 2010-08-31 12:56:20.599457 to 2010-08-31 14:14:31.566462# bytes 3 12.89M 59 77 61.14 59.77 0.30 59.77# Errors 1 none# Rows affe 0 7.92k 0 1.51k 0.04 0 3.96 0# Warning c 3 3.89M 0 63.00k 18.45 0 771.56 0# 0% (161) No_index_used# Query_time distribution# 1us# 10us ################################################## ############### 100us ################################### 1ms ####### 10ms ## 100ms ## 1s ## 10s+ ## Tables# SHOW TABLE STATUS FROM `broker_users` LIKE 'companytable'\G# SHOW CREATE TABLE `broker_users`.`companytable`\G# EXPLAINSELECT * FROM broker_users.companytable WHERE compid = '10059'\G



    Thanks for any and all help!
    Tim
Working...
X