Skip to content

Instantly share code, notes, and snippets.

@spaze
Last active July 21, 2017 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spaze/cda2c53c5b00b2cc946fa8cbc026d6e8 to your computer and use it in GitHub Desktop.
Save spaze/cda2c53c5b00b2cc946fa8cbc026d6e8 to your computer and use it in GitHub Desktop.
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE foo ref code code 34 const 1 100.00 Using index
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
1 SIMPLE foo index code code 34 12 10.00 "Using where; Using index"
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `foo`;
CREATE TABLE `foo` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(32) NOT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `code` (`code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `foo` (`id`, `code`) VALUES
(12, '123'),
(11, '546g876870'),
(6, '7877897wrw'),
(3, '78r97qr'),
(7, '7e8w99w'),
(1, '857545'),
(10, 'b54cv6vc68b7'),
(9, 'v5d5fd5gd'),
(8, 'vv55v55v'),
(4, 'w987w987'),
(2, 'we52wer5'),
(5, 'wrwr78w77');
-- 2017-07-21 11:52:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment