웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
[속도UP팁] 최근게시물 위젯 속도개선
2013.12.09 18:36
./widgets/newest_document/queries/getNewestDocuments.xml 파일수정
<query id="getNewestDocuments" action="select"> <tables> <table name="documents" /> </tables> <columns> <column name="documents.*" /> </columns> <conditions> <condition operation="in" column="documents.module_srl" var="module_srl" filter="number" pipe="and" /> </conditions> <navigation> <index var="sort_index" default="documents.list_order" order="order_type" /> <list_count var="list_count" default="20" /> </navigation> </query>
위 코드로 교체합니다.
위젯으로 꾸며놓은 메인페이지가 캐시가 리로드되는 시간마다 자꾸 느려지더라고요.
찾아보니까 최근게시물 뽑아오는 쿼리가 10~20초씩 걸렸습니다.
xe_documents 레코드수 약 7만개에 innoDB 엔진 사용중이구요.
자세히는 모르지만 기존 쿼리가 xe_modules 테이블이랑 xe_documents에서 JOIN해서 가져오는것 같은데
제 사이트기준으로 너무 쓸데없는 쿼리같아서 저런식으로 간소화해봤습니다.
아무런 문제없고 확실히 빨라졌습니다. ^^
p.s
근데 혹시 JOIN해서 가져오는이유 아시는분 좀 알려주세요
궁금하네요
초보자라..ㅠㅠ