테스트 사이트 - 개발 중인 베타 버전입니다

게시판에 검색어 링크를 쓰면 부하가 걸린다고 하는데 채택완료

처리딘 9년 전 조회 3,100

디비 프로세스를 보면 이런식으로 http://221.143.46.55/phpmyadmin/url.php?url=https://dev.mysql.com/doc/refman/5.5/en/select.html" style="text-decoration: none; color: rgb(35, 90, 129); cursor: pointer; outline: none; border-bottom: 1px dotted rgb(0, 0, 0);">select pp_word, http://221.143.46.55/phpmyadmin/url.php?url=https://dev.mysql.com/doc/refman/5.5/en/group-by-functions.html#function_count" style="text-decoration: none; color: rgb(35, 90, 129); cursor: pointer; outline: none; border-bottom: 1px dotted rgb(0, 0, 0);">count(*) as cnt from g5_popular wherepp_date between '2016-08-08' http://221.143.46.55/phpmyadmin/url.php?url=https://dev.mysql.com/doc/refman/5.5/en/logical-operators.html#operator_and" style="text-decoration: none; color: rgb(35, 90, 129); cursor: pointer; outline: none; border-bottom: 1px dotted rgb(0, 0, 0);">and '2016-08-09'

 

Copying to tmp table 상태가 됩니다. 


게시판 검색어 링크를 썼을떼 인기 검색어 부하가 안걸리게 할려면 어떻게 수정해야 하나여?

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트
복스리
9년 전

항목을 select 하는것은 좋은데 count가 있습니다.

 

count에다가 * (all) 대신 컬럼명을 쓰시고.~

 

pp_date로 검색 조건을 하시니  이 항목에 index를 걸어주시면 속도가 개선됩니다.~

 

 

 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

처리딘
9년 전
음 그럼 *를 pp_id로 바꾸고
ALTER TABLE `g5_popular` ADD INDEX( `pp_date`);
이렇게 해주면 될까여?
그리고 search로 검색했을떼만 인기 검색어로 올라가고 게시판에 링크로 했을뗀 인기 검색어로 안올라가게 할려면 어떻게 해야 하나여?

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인