노무현 전 대통령 서거 추모글 남기기

index 효과 테스트

개발자가 뭐길래 | 2007. 10. 5. 22:53 | sweetw

100만건 테스트 에서 이용한 방법


  • 해쉬값에 index를 적용한다 :alter table profile ADD INDEX profile_idx(hash);

  • <인덱싱하는 쿼리문> 
    mysql> alter table profile ADD INDEX profile_idx(hash);
    Query OK, 1000048 rows affected (48.86 sec)
    Records: 1000048  Duplicates: 0  Warnings: 0

  • index 쿼리문 시간
     이용전  select * from profile where profile_index = 1000020;  0.00sec
     이용전  select * from profile where hash = '1d5177503ffb293663888bd43eacc53d';  3.15sec
     이용후  select * from profile where hash = '1d5177503ffb293663888bd43eacc53d';  0.01 sec

이 글은 스프링노트에서 작성되었습니다.

'개발자가 뭐길래' 카테고리의 다른 글

MySQL UNIQUE  (0) 2007.10.15
553 sorry, that domain isn't in my list of allowed rcpt hosts  (2) 2007.10.11
조엘 온 소프트웨어  (1) 2007.10.02
버그 잡이  (0) 2007.09.28
여자 개발자 모임 인터뷰  (0) 2007.09.18