Advertisement
Guest User

Untitled

a guest
May 25th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. CREATE TABLE t1 (
  2. f2 INT,
  3. pk2 INT,
  4. f1 VARCHAR(3),
  5. pk1 VARCHAR(1000),
  6. PRIMARY KEY (pk1,pk2),
  7. KEY k1(pk1,f2)
  8. ) ENGINE=InnoDB CHARSET utf8;
  9.  
  10. INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def');
  11. explain format= json
  12. select * from t1 force index(k1) where f2 <= 5 and pk2 <=5 and pk1 = 'abc' and f1 <= '3';
  13. drop table t1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement