Comment 1 for bug 1201443

Revision history for this message
Daniel Nichter (daniel-nichter) wrote : Re: pt-duplicate-key-checker raises error when explain shows key_len = 0

mysql> EXPLAIN SELECT parent_id FROM `fk_chosen_index_bug_1201443`.`child` FORCE INDEX (parent_id) WHERE parent_id=1 OR parent_id<>1\G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: child
         type: range
possible_keys: parent_id
          key: parent_id
      key_len: 0
          ref: NULL
         rows: 5233
        Extra: Using where; Using index
1 row in set (0.01 sec)

mysql> EXPLAIN SELECT parent_id FROM `fk_chosen_index_bug_1201443`.`child` FORCE INDEX (parent_id) WHERE parent_id=1\G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: child
         type: ref
possible_keys: parent_id
          key: parent_id
      key_len: 4
          ref: const
         rows: 5233
        Extra: Using index
1 row in set (0.00 sec)