Advertisement
Guest User

Untitled

a guest
Jul 30th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. CREATE TABLE `test` (
  2. `status` tinyint(4) NOT NULL,
  3. `type` varchar(32) CHARACTER SET ascii NOT NULL COMMENT 'The ID of the target entity.',
  4. `created` int(11) NOT NULL,
  5. `title` varchar(255) CHARACTER SET utf8mb4 NOT NULL,
  6. KEY `status` (`status`,`type`,`created`,`title`)
  7. ) ENGINE=InnoDB DEFAULT CHARSET=utf8
  8.  
  9. EXPLAIN
  10. SELECT *
  11. FROM test
  12. WHERE status = 1 AND type = 'discussion'
  13. ORDER BY created DESC, title ASC
  14. LIMIT 10 OFFSET 0G
  15.  
  16. select_type: SIMPLE
  17. table: test
  18. partitions: NULL
  19. type: ref
  20. possible_keys: status
  21. key: status
  22. key_len: 35
  23. ref: const,const
  24. rows: 1716
  25. filtered: 100.00
  26. Extra: Using where; Using index; Using filesort
  27. 1 row in set, 1 warning (0.00 sec)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement