zoukankan      html  css  js  c++  java
  • Mysql之禁止使用索引

    禁止使用索引:ignore index---------------------强制使用索引: force index

    mysql> explain select * from userinfo where username='test1'G
    *************************** 1. row ***************************
               id: 1
      select_type: SIMPLE
            table: userinfo
             type: ref
    possible_keys: username
              key: username
          key_len: 768
              ref: const
             rows: 1
            Extra: Using where
    1 row in set (0.00 sec)
    
    
    
    mysql> explain select * from userinfo ignore index(username) where username='tes
    t1'G
    *************************** 1. row ***************************
               id: 1
      select_type: SIMPLE
            table: userinfo
             type: ALL
    possible_keys: NULL
              key: NULL
          key_len: NULL
              ref: NULL
             rows: 4
            Extra: Using where
    1 row in set (0.00 sec)
  • 相关阅读:
    一次摸鱼
    scenes
    mysql日志
    十万个为什么
    ss
    mysql之explain
    mysql之索引
    mysql1
    分页
    ajax分页
  • 原文地址:https://www.cnblogs.com/wangchy0927/p/3302529.html
Copyright © 2011-2022 走看看