<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[TNF : Tatter Network Foundation forum - 검색관련해서 쿼리 하나 캐쉬됩니다.]]></title>
	<link rel="self" href="http://forum.tattersite.com/ko/extern.php?action=feed&amp;tid=4022&amp;type=atom"/>
	<updated>2007-11-14T08:00:22Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.tattersite.com/ko/viewtopic.php?id=4022</id>
		<entry>
			<title type="html"><![CDATA[검색관련해서 쿼리 하나 캐쉬됩니다.]]></title>
			<link rel="alternate" href="http://forum.tattersite.com/ko/viewtopic.php?pid=22095#p22095"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[엽기민원]]></name>
				<uri>http://forum.tattersite.com/ko/profile.php?id=1538</uri>
			</author>
			<updated>2007-11-14T08:00:22Z</updated>
			<id>http://forum.tattersite.com/ko/viewtopic.php?pid=22095#p22095</id>
		</entry>
</feed>
