Extra Form
PHP PHP 7.0
CMS Rhymix

 

최근에 느려지는 슬로우 쿼리들이 몇개가 잇는데요

2초이상 걸린 쿼리들입니다.

 

 

 

SELECT `modules`.`site_srl` as `site_srl`, `modules`.`mid` as `mid`, `documents`.*  FROM `xe_modules` as `modules` , `xe_documents` as `documents`   WHERE ( `documents`.`module_srl` not in (0) and `documents`.`module_srl` in (22073,23752,88036,93839,488697,1324140,1322362,1314800) and `modules`.`module_srl` = `documents`.`module_srl` ) and `documents`.`list_order` <= 2100000000    ORDER BY `documents`.`list_order` asc  LIMIT 40;
 

 

 

SELECT *  FROM `xe_comments` as `comments`   WHERE ( `module_srl` in (365,984,1106,1588,1604,2183,4438,5764,5900,5926,5954,5957,16677,22073,22075,22200,23752,38081,52529,57887,76701,81608,88036,93806,93839,127541,128226,185003,210413,224936,234137,260633,271750,278313,291588,387199,488697,518565,728883,1079696,1148243,1197661,1250863,1265893,1314800,1322362,1324140,1356056,1382060,1421171,1437192,1437195,1437198,1440521,1440525,1452146,1483381,1818159,2291890,2601481,2601631,2644342,2688616,2897473,0) and `is_secret` = 'N' and `status` in (1) and ( `content` like '%肄~T鍮~E%' )) and `list_order` <= 2100000000   ORDER BY `list_order` asc  LIMIT 0, 10;
 

 

 

이런 쿼리들은 어디쪽 때문에 느려지는걸까요?

  • profile
    해당쿼리 기록이 있으면 그 파일의 위치도 알려줄텐데요 .. 그건없던가요
  • profile ?
    # Time: 190808 0:04:13
    # User@Host: ggk123_ggk123[ggk123_ggk123] @ localhost []
    # Thread_id: 105135123 Schema: ggk123_ggk123 QC_hit: No
    # Query_time: 2.872903 Lock_time: 0.000032 Rows_sent: 40 Rows_examined: 270892
    SET timestamp=1565190253;
    SELECT `modules`.`site_srl` as `site_srl`, `modules`.`mid` as `mid`, `documents`.* FROM `xe_modules` as `modules` , `xe_documents` as `documents` WHERE ( `documents`.`module_srl` not in (0) and `documents`.`module_srl` in (22073,23752,88036,93839,488697,1324140,1322362,1314800) and `modules`.`module_srl` = `documents`.`module_srl` ) and `documents`.`list_order` <= 2100000000 ORDER BY `documents`.`list_order` asc LIMIT 40;

    경로는 안보입니다ㅠㅠ
  • profile

    1번은 최신글 위젯이나 타임라인 모듈 등 여러 게시판의 글들을 모아보는 기능에서 발생하고 있는 것 같네요. 마지막에 LIMIT 40이라고 나오니, 최신글 40개를 표시하는 곳을 체크해 보시기 바랍니다.

     

    2번은 통합검색입니다. 얘는 원래 느려요. DB에 충분한 RAM을 할당해주면 조금 빨라질 수는 있지만, 그래도 툭하면 서버 터지는 주범 중 하나입니다. 통합검색 쓰지 마세요. 그냥 쓰지 마세요. 어쨌든 쓰지 마세요.

  • profile profile
    3단 강조에 감동 받았습니다 ㅎ
  • profile ?
    바로삭제햇습니다.

    감사합니다!