CREATE TABLE aa(bun INT PRIMARY KEY, irum VARCHAR(10), juso VARCHAR(10));
INSERT INTO aa VALUES (3,'tom3','seoul3');
INSERT INTO aa VALUES (1,'tom1','seoul1');
INSERT INTO aa VALUES (2,'tom2','seoul3');
SELECT FROM aa;
SHOW INDEX FROM aa; -- index_type은 BTREE
ALTER TABLE aa ADD INDEX ind_juso (juso); -- 주소에 index 추가
SHOW INDEX FROM aa;
DESC aa;
EXPLAIN SELECT from aa;
EXPLAIN SELECT * FROM aa WHERE juso = 'seoul2';
DROP INDEX ind_juso ON aa; - 인덱스 삭제
SHOW INDEX FROM aa;
SELECT NOW(), sleep(2), NOW();
SELECT sysdate(), sleep(2), SYSDATE();