<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[TNF : Tatter Network Foundation forum - 검색관련해서 쿼리 하나 캐쉬됩니다.]]></title>
		<link>http://forum.tattersite.com/ko/viewtopic.php?id=4022</link>
		<description><![CDATA[검색관련해서 쿼리 하나 캐쉬됩니다. 의 최근 RSS 글들.]]></description>
		<lastBuildDate>Wed, 14 Nov 2007 08:00:22 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[검색관련해서 쿼리 하나 캐쉬됩니다.]]></title>
			<link>http://forum.tattersite.com/ko/viewtopic.php?pid=22095#p22095</link>
			<description><![CDATA[<p>검색이 오래걸려서 쿼리를 보고 있던중 똑같은 내용의 쿼리인데 캐쉬가 안되더군요.</p><p>이유를 보니 where 절의 질의문 순서가 바뀌고, Entries e 뒤에 스페이스가 하나 더 있더군요.</p><p>암튼 아래와 같이 바꾸니 캐쉬처리가 되더군요.&nbsp; version은 1.5.3.1입니다.</p><p>/lib/model/blog.entry.php<br /></p><div class="codebox"><pre><code>function getEntryListWithPagingBySearch($blogid, $search, $page, $count) {
    global $database, $suri, $folderURL;
    $search = escapeMysqlSearchString($search);
    $cond = strlen($search) == 0 ? &#039;AND 0&#039; : &quot;AND (e.title LIKE &#039;%$search%&#039; OR e.content LIKE &#039;%$search%&#039;)&quot;;
    $visibility = doesHaveOwnership() ? &#039;&#039; : &#039;AND e.visibility &gt; 1 AND (c.visibility &gt; 1 OR e.category = 0)&#039;;
    $sql = &quot;SELECT e.blogid, e.userid, e.id, e.title, e.comments, e.slogan, e.published 
        FROM {$database[&#039;prefix&#039;]}Entries e 
        LEFT JOIN {$database[&#039;prefix&#039;]}Categories c ON e.blogid = c.blogid AND e.category = c.id 
        WHERE e.blogid = $blogid AND e.draft = 0 $visibility AND e.category &gt;= 0 $cond 
        ORDER BY e.published DESC&quot;;
    return fetchWithPaging($sql, $page, $count, &quot;$folderURL/{$suri[&#039;value&#039;]}&quot;);
}</code></pre></div><p>모델쪽 쿼리중에 이런거 스페이스 하나때문에 캐쉬가 되나 안되나가 판가름 나네요.</p>]]></description>
			<author><![CDATA[null@example.com (엽기민원)]]></author>
			<pubDate>Wed, 14 Nov 2007 08:00:22 +0000</pubDate>
			<guid>http://forum.tattersite.com/ko/viewtopic.php?pid=22095#p22095</guid>
		</item>
	</channel>
</rss>
