<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[PunBB Forums - Slow SQL requests]]></title>
	<link rel="self" href="http://punbb.informer.com/forums/feed/atom/topic/21772/"/>
	<updated>2009-06-15T13:58:23Z</updated>
	<generator>PunBB</generator>
	<id>http://punbb.informer.com/forums/topic/21772/slow-sql-requests/</id>
		<entry>
			<title type="html"><![CDATA[Re: Slow SQL requests]]></title>
			<link rel="alternate" href="http://punbb.informer.com/forums/post/128495/#p128495"/>
			<content type="html"><![CDATA[<p>First query runs after editing/deleting posts or topics in the function &quot;strip_search_index&quot; (FORUM_ROOT/include/search_idx.php).</p>]]></content>
			<author>
				<name><![CDATA[Slavok]]></name>
				<uri>http://punbb.informer.com/forums/user/13265/</uri>
			</author>
			<updated>2009-06-15T13:58:23Z</updated>
			<id>http://punbb.informer.com/forums/post/128495/#p128495</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Slow SQL requests]]></title>
			<link rel="alternate" href="http://punbb.informer.com/forums/post/128491/#p128491"/>
			<content type="html"><![CDATA[<p>Today my site was stopped because my forum was taking up too much resources. They said that this was done because of the following requests taking too much time to execute:<br /></p><div class="codebox"><pre><code>use gb_punbb_v0;
SELECT word_id FROM search_matches WHERE word_id IN(17,39,73,86,89,165,248,289,302,333,339,468,478,534,599,776,841,972,1023,1085,1207,1351,2645,3090,3618,3897,4011,4839,5817,6706,7005,7384,9326,10612,10991,11394,12079,13091,14583,14606,16344,17144,17211,17807,19184,20299,20625,24523,37023,37024,47657,51487,51681,62654,69220,69343,75527,79526,79542,82807,84153,90668,90669,90670,90671,90672,90673,90705,90717,90718,90821) GROUP BY word_id, subject_match HAVING COUNT(word_id)=1;</code></pre></div><p> this was 15 seconds,</p><div class="codebox"><pre><code>use gb_punbb_v0;
SELECT u.*, g.*, o.logged, o.csrf_token, o.prev_url, o.last_post, o.last_search FROM users AS u INNER JOIN groups AS g ON g.g_id=u.group_id LEFT JOIN online AS o ON o.ident=&#039;72.30.142.82&#039; WHERE u.id=1;</code></pre></div><p> -- 19 sec.</p><div class="codebox"><pre><code>use gb_punbb_v0;
SELECT u.email, u.title, u.url, u.location, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM posts AS p INNER JOIN users AS u ON u.id=p.poster_id INNER JOIN groups AS g ON g.g_id=u.group_id LEFT JOIN online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id=325 ORDER BY p.id LIMIT 150,25;</code></pre></div><p> -- 24 sec.</p><p>Any idea what could be the reason?</p><p>My site won&#039;t be restarted until the problem is fixed. <img src="http://punbb.informer.com/forums/img/smilies/sad.png" width="15" height="15" alt="sad" /></p><p>P.S. Cant&#039; find where the first piece is, the second is in set_default_user() function in functions.php, third in viewtopic.php.</p>]]></content>
			<author>
				<name><![CDATA[8k84]]></name>
				<uri>http://punbb.informer.com/forums/user/14280/</uri>
			</author>
			<updated>2009-06-15T12:26:24Z</updated>
			<id>http://punbb.informer.com/forums/post/128491/#p128491</id>
		</entry>
</feed>
