[BETA] Viewforum No Query Join

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
Dog Cow
Registered User
Posts: 2507
Joined: Fri Jan 28, 2005 12:14 am
Contact:

[BETA] Viewforum No Query Join

Post by Dog Cow »

Viewforum No Query Join (Beta) MOD by Dog Cow

== INTRO & DESCRIPTION ==

This modification will alter your viewforum.php page so that it only queries from the topics_table. This may speed up forums with large numbers of topics.


== INSTALLATION, COMPATIBILITY, & SUPPORT ==

Viewforum No Query Join has been tested on phpBB version 2.0.22. If you find Viewforum No Query Join useful on your forum, please consider visiting my web site at http://www.macgui.com
(You can get tech-support there, too!)

Note that this is Beta software. It hasn't been approved by anyone. I just happen to use it on my site and thought others would benefit from it. I doubt it has any bugs, but you never know.

Download here: http://dserver.macgui.com/Viewforum_no_ ... n_beta.zip
User avatar
Dog Cow
Registered User
Posts: 2507
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Additional Notes

Post by Dog Cow »

Code: Select all

##############################################################
## MOD Title: Viewforum No Query Join
## MOD Author: Dog Cow < [email protected] > (David) http://www.macgui.com
## MOD Description: This modification will alter your viewforum.php
## page so that it only queries from the topics_table. This may speed 
## up forums with large numbers of topics.
## MOD Version: BETA
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: viewforum.php,
##	posting.php,
##	includes/functions_post.php
##
## Included Files: topic_update.php
The edits are pretty quick and easy to do.

Just adding a few colums to your topics table:

Code: Select all

ALTER TABLE  `phpbb_topics` ADD  `topic_first_poster_name` VARCHAR( 25 ) NOT NULL AFTER  `topic_first_post_id` ;

ALTER TABLE  `phpbb_topics` ADD  `topic_last_poster_id` MEDIUMINT( 8 ) NOT NULL DEFAULT  '0' AFTER  `topic_last_post_id` ,
ADD  `topic_last_poster_name` VARCHAR( 25 ) NOT NULL AFTER  `topic_last_poster_id` ,
ADD  `topic_last_post_time` INT( 11 ) NOT NULL DEFAULT  '0' AFTER  `topic_last_poster_name` ;
And then changing viewforum and the posting process.

When the last post in a topic is deleted, another query runs to get the new last post data. This will show the last poster and last post time correctly.

When the first post in a topic is deleted, another query runs to get the new first post data. This will show the change in "topic ownership" correctly.

Mods that create topics OR split topic
Sorry! If you have installed modifications that create new topics on their own, they may not work and you may have to alter them.

The ModCP Split topic function may not properly fill in the proper topics table fields that this mod has added! Again, I haven't looked into this yet, but the solution may be to add a call to update_post_stats() after the newly split topic has been created. This has been fixed! See next post for the patch!
Last edited by Dog Cow on Thu Aug 16, 2007 4:00 pm, edited 2 times in total.
User avatar
Dog Cow
Registered User
Posts: 2507
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Patch for ModCP Topic Split

Post by Dog Cow »

Just made this about 30 minutes ago. This will fix it so that new topics created by the split function have the correct data for topic author and last poster.

Code: Select all

##
## Viewforum No Query Mod Patch by Dog Cow
## fixes ModCP split topic
##
#  
#-----[ OPEN ]------------------------------------------
#
functions_admin.php
#
#-----[ FIND ]------------------------------------------
#
				if ($row['total_posts'])
				{
					// Correct the details of this topic
					$sql = 'UPDATE ' . TOPICS_TABLE . ' 
						SET topic_replies = ' . ($row['total_posts'] - 1) . ', topic_first_post_id = ' . $row['first_post'] . ', topic_last_post_id = ' . $row['last_post'] . "
						WHERE topic_id = $id";

					if (!$db->sql_query($sql))
					{
						message_die(GENERAL_ERROR, 'Could not update topic', '', __LINE__, __FILE__, $sql);
					}
#
#-----[ AFTER,ADD ]-------------------------------------
#

// Viewforum No Query Mod Patch

					$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time 
	FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
	WHERE t.topic_id = $id
		AND t.topic_poster = u.user_id
		AND p.post_id = t.topic_first_post_id
		AND p2.post_id = t.topic_last_post_id
		AND u2.user_id = p2.poster_id";

	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
	}
			if ( $topicrow = $db->sql_fetchrow($result) )
			{


			$topic_id = $topicrow['topic_id'];
			$topic_title =  $topicrow['topic_title'];


			$topic_first_poster_name= ( $topicrow['user_id'] != ANONYMOUS ) ? $topicrow['username'] : ( ( $topicrow['post_username'] != '' ) ? $topicrow['post_username'] : $lang['Guest'] );
			$topic_last_poster_id = $topicrow[$i]['id2'];

			$last_poster_name = ( $topicrow['id2'] == ANONYMOUS ) ? ( ($topicrow['post_username2'] != '' ) ? $topicrow['post_username2'] . ' ' : $lang['Guest'] . ' ' ) : $topicrow['user2'];

			$last_post_time = $topicrow['post_time'];


			$sql = "UPDATE " . TOPICS_TABLE . "
			SET topic_first_poster_name = '$topic_first_poster_name', topic_last_poster_id = '$topic_last_poster_id', topic_last_poster_name = '$last_poster_name', topic_last_post_time = '$last_post_time'
			WHERE topic_id = $id";



			if ( !($result = $db->sql_query($sql)) )
			{
  	 			message_die(GENERAL_ERROR, 'Could not UPDATE topic information', '', __LINE__, __FILE__, $sql);
			}
}
// End Mod Patch
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
#
# EoM
Hannibal_King
Registered User
Posts: 436
Joined: Mon Apr 03, 2006 6:24 am
Location: SLOVAKIA
Contact:

Re: [BETA] Viewforum No Query Join

Post by Hannibal_King »

Hello, very interesting.. want to test it but i am using one merge hack so i dont know if it will be ok to install your hack.. can you look on it please? i will past here the install:

Code: Select all

############################################################## 
## MOD Title: ModCP Merge Hack
## MOD Author: Sko22 < [email protected] > (N/A) http://www.quellicheilpc.it/
## MOD Description: This mod adds topics merge function in moderator control panel.
## MOD Version: 1.0.2 
##
## Installation Level: Easy 
## Installation Time: 5 Minutes 
## Files To Edit: 
##			modcp.php
##			viewtopic.php
##			includes/functions_admin.php
##			language/lang_english/lang_main.php
##			templates/subSilver/subSilver.cfg
##			templates/subSilver/modcp_body.tpl
## Included Files: 
##			templates/subSilver/modcp_merge.tpl
##			templates/subSilver/images/topic_merge.gif
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
##############################################################
## Author Notes: 
## I have tested this MOD whit phpBB 2.0.10 and MySQL Database 3.23.56
## This MOD is an updating to the ModCP Merge Hack realized by sickb0y < http://www.p2pitalia.com >
##
## Future versions can be found at http://www.quellicheilpc.it
## I've set up a support forum for my mods at http://www.quellicheilpc.it/forum
##
## This MOD is released under the GPL License. 
## Intellectual Property is retained by the MOD Author(s) listed above 
## Copyright:      ©2004 ModCP Merge Hack 1.0.2 - Sko22 & sickb0y
############################################################## 
## MOD History: 
##
##   2004-10-16 - Version 1.0.2
##	- Update for phpBB 2.0.10 from Sko22 < http://www.quellicheilpc.it >
##	- Added Merge button in viewtopic.php
##   2003-03-23 - Version 1.0.1
##	- ModCP Merge Hack realized by sickb0y < http://www.p2pitalia.com >
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

#
#-----[ COPY ]------------------------------------------
#

copy templates/subSilver/modcp_merge.tpl to templates/subSilver/modcp_merge.tpl
copy templates/subSilver/images/topic_merge.gif to templates/subSilver/images/topic_merge.gif

# 
#-----[ OPEN ]------------------------------------------ 
#

modcp.php

# 
#-----[ FIND ]------------------------------------------ 
# 

$unlock = ( isset($HTTP_POST_VARS['unlock']) ) ? TRUE : FALSE;

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

$merge = ( isset($HTTP_POST_VARS['merge']) ) ? TRUE : FALSE;

# 
#-----[ FIND ]------------------------------------------ 
# 

	else if ( $unlock )
	{
		$mode = 'unlock';
	}

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

	else if ( $merge )
	{
		$mode = 'merge';
	}

# 
#-----[ FIND ]------------------------------------------ 
# 

		message_die(GENERAL_MESSAGE, $lang['Topics_Unlocked'] . '<br /><br />' . $message);

		break;

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

	case 'merge':
		$page_title = $lang['Mod_CP'];
		include($phpbb_root_path . 'includes/page_header.'.$phpEx);

		if ( $confirm )
		{
			if ( empty($HTTP_POST_VARS['topic_id_list']) && empty($topic_id) )
			{
				message_die(GENERAL_MESSAGE, $lang['None_selected']);
			}

			$new_topic_id = $HTTP_POST_VARS['new_topic'];
                        $topic_id_list = isset($HTTP_POST_VARS['topic_id_list']) ? $HTTP_POST_VARS['topic_id_list'] : array($topic_id);

			for ($i=0; $i < count($topic_id_list); $i++)
			{
				$old_topic_id = $topic_id_list[$i];

				if ( $new_topic_id != $old_topic_id )
				{
					$sql = "UPDATE " . POSTS_TABLE . "
					SET topic_id = $new_topic_id 
					WHERE topic_id = $topic_id_list[$i]";

					if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
					{
						message_die(GENERAL_ERROR, 'Could not update posts', '', __LINE__, __FILE__, $sql);
					}

					$sql = "DELETE FROM " . TOPICS_TABLE . "
					WHERE topic_id = $topic_id_list[$i]";

					if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
					{
						message_die(GENERAL_ERROR, 'Could not update posts', '', __LINE__, __FILE__, $sql);
					}

					$sql = "DELETE FROM  " . TOPICS_WATCH_TABLE . "
					WHERE topic_id = $topic_id_list[$i]";

					if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
					{
						message_die(GENERAL_ERROR, 'Could not update posts', '', __LINE__, __FILE__, $sql);
					}

					// Sync the forum indexes
					sync('forum', $forum_id);
					sync('topic', $new_topic_id);

					$message = $lang['Topics_Moved'] . '<br /><br />';
				}
				else
				{
					$message = $lang['No_Topics_Moved'] . '<br /><br />';
				}

			}

			if ( !empty($topic_id) )
			{
				$redirect_page = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$new_topic_id&sid=" . $userdata['session_id'];
				$message .= sprintf($lang['Click_return_topic'], '<a href="' . $redirect_page . '">', '</a>');
			}
			else
			{
				$redirect_page = "modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id'];
				$message .= sprintf($lang['Click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>');
			}

			$message = $message . '<br \><br \>' . sprintf($lang['Click_return_forum'], '<a href="' . "viewforum.$phpEx?" . POST_FORUM_URL . "=$old_forum_id&sid=" . $userdata['session_id'] . '">', '</a>');

			$template->assign_vars(array(
				'META' => '<meta http-equiv="refresh" content="3;url=' . $redirect_page . '">')
			);

			message_die(GENERAL_MESSAGE, $message);
		}
		else
		{
			if ( empty($HTTP_POST_VARS['topic_id_list']) && empty($topic_id) )
			{
				message_die(GENERAL_MESSAGE, $lang['None_selected']);
			}

			$hidden_fields = '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" /><input type="hidden" name="mode" value="' . $mode . '" /><input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '" />';

			if ( isset($HTTP_POST_VARS['topic_id_list']) )
			{
				$topics = $HTTP_POST_VARS['topic_id_list'];

				for($i = 0; $i < count($topics); $i++)
				{
					$hidden_fields .= '<input type="hidden" name="topic_id_list[]" value="' . intval($topics[$i]) . '" />';
				}
			}
			else
			{
				$hidden_fields .= '<input type="hidden" name="' . POST_TOPIC_URL . '" value="' . $topic_id . '" />';
			}

			//
			// Set template files
			//
			$template->set_filenames(array(
				'mergetopic' => 'modcp_merge.tpl')
			);

			$template->assign_vars(array(
				'MESSAGE_TITLE' => $lang['Confirm'],
				'MESSAGE_TEXT' => $lang['Confirm_move_topic'],

				'L_MERGE_TOPIC' => $lang['Merge_topic'],
												
				'L_YES' => $lang['Yes'],
				'L_NO' => $lang['No'],

				'S_TOPIC_SELECT' => make_topic_select('new_topic', $forum_id),
				'S_MODCP_ACTION' => append_sid("modcp.$phpEx"),
				'S_HIDDEN_FIELDS' => $hidden_fields)
			);

		$template->pparse('mergetopic');

		include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
		}

		break;

# 
#-----[ FIND ]------------------------------------------ 
# 

			'L_UNLOCK' => $lang['Unlock'],

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

			'L_MERGE' => $lang['Merge'],

# 
#-----[ OPEN ]------------------------------------------ 
#

viewtopic.php

# 
#-----[ FIND ]------------------------------------------ 
# 

	$topic_mod .= "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&mode=split&sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_split'] . '" alt="' . $lang['Split_topic'] . '" title="' . $lang['Split_topic'] . '" border="0" /></a>&nbsp;';

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

	$topic_mod .= "<a href=\"modcp.$phpEx?" . POST_TOPIC_URL . "=$topic_id&mode=merge&sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_merge'] . '" alt="' . $lang['Merge_topic'] . '" title="' . $lang['Merge_topic'] . '" border="0" /></a>&nbsp;';

# 
#-----[ OPEN ]------------------------------------------ 
#

includes/functions_admin.php

# 
#-----[ FIND ]------------------------------------------ 
# 

?>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#

function make_topic_select($box_name, $forum_id)
{
	global $db, $userdata;

	$is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata);

	$sql = "SELECT topic_id, topic_title 
		FROM " . TOPICS_TABLE . " 
		WHERE forum_id = $forum_id 
		ORDER BY topic_title";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Couldn not obtain topics information', '', __LINE__, __FILE__, $sql);
	}

	$topic_list = '';
	while( $row = $db->sql_fetchrow($result) )
	{
		$topic_list .= '<option value="' . $row['topic_id'] . '">' . $row['topic_title'] . '</option>';
	}

	$topic_list = ( $topic_list == '' ) ? '<option value="-1">-- ! No Topics ! --</option>' : '<select name="' . $box_name . '">' . $topic_list . '</select>';

	return $topic_list;
}

# 
#-----[ OPEN ]------------------------------------------ 
#

language/lang_english/lang_main.php

# 
#-----[ FIND ]------------------------------------------ 
# 

$lang['Unlock'] = 'Unlock';

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

$lang['Merge'] = "Merge";
$lang['Merge_topic'] = "Merge to topic";

# 
#-----[ OPEN ]------------------------------------------ 
#

templates/subSilver/subSilver.cfg

# 
#-----[ FIND ]------------------------------------------ 
# 

$images['topic_mod_split'] = "$current_template_images/topic_split.gif";

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

$images['topic_mod_merge'] = "$current_template_images/topic_merge.gif";

# 
#-----[ OPEN ]------------------------------------------ 
#

templates/subSilver/modcp_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 

		&nbsp; 
		<input type="submit" name="unlock" class="liteoption" value="{L_UNLOCK}" />

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

		&nbsp; 
		<input type="submit" name="merge" class="liteoption" value="{L_MERGE}" />

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 
Hannibal_King
Registered User
Posts: 436
Joined: Mon Apr 03, 2006 6:24 am
Location: SLOVAKIA
Contact:

Re: [BETA] Viewforum No Query Join

Post by Hannibal_King »

and also second question.. it should work, even if i have installed extreme styles mod and sql cache mod, huh?

will try it now.. if there would be any problem with the merge hack i have, i will tell you
Hannibal_King
Registered User
Posts: 436
Joined: Mon Apr 03, 2006 6:24 am
Location: SLOVAKIA
Contact:

Re: [BETA] Viewforum No Query Join

Post by Hannibal_King »

oh thats a pity :( now i was trying to install it, but i discovered that there is a huge code replacing in viewforum.php and this mod is not compatible with the user level mod.. :(

here, in my viewforum.php it looks like this:

Code: Select all

//
// All announcement data, this keeps announcements
// on each viewforum page ...
//
$sql = "SELECT t.*, u.username, u.user_id, u.user_level, u2.username as user2, u2.user_id as id2, u2.user_level as user_level2, p.post_time, p.post_username
	FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . USERS_TABLE . " u2
	WHERE t.forum_id = $forum_id 
		AND t.topic_poster = u.user_id
		AND p.post_id = t.topic_last_post_id
		AND p.poster_id = u2.user_id
		AND t.topic_type = " . POST_ANNOUNCE . " 
	ORDER BY t.topic_last_post_id DESC ";
if ( !($result = $db->sql_query($sql, false, 'posts_')) )
{
   message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}

$topic_rowset = array();
$total_announcements = 0;
while( $row = $db->sql_fetchrow($result) )
{
	$topic_rowset[] = $row;
	$total_announcements++;
}

$db->sql_freeresult($result);

//
// Grab all the basic data (all topics except announcements)
// for this forum
//
$sql = "SELECT t.*, u.username, u.user_id, u.user_level, u2.username as user2, u2.user_id as id2, u2.user_level as user_level2, p.post_username, p2.post_username AS post_username2, p2.post_time 
	FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
	WHERE t.forum_id = $forum_id
		AND t.topic_poster = u.user_id
		AND p.post_id = t.topic_first_post_id
		AND p2.post_id = t.topic_last_post_id
		AND u2.user_id = p2.poster_id 
		AND t.topic_type <> " . POST_ANNOUNCE . " 
		AND t.topic_title LIKE '$start_letter%'
		$limit_topics_time
	ORDER BY t.topic_type DESC, t.topic_last_post_id DESC 
	LIMIT $start, ".$board_config['topics_per_page'];
if ( !($result = $db->sql_query($sql, false, 'posts_')) )
{
   message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}
can you help me how to change it to work with user level mod please? :)
//i have also sort topics alphabetically mod installed, but that doesnt matter, this is easy to change..

I am very interested in this mod, really 8-)
User avatar
Dog Cow
Registered User
Posts: 2507
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Re: reply to your questions

Post by Dog Cow »

Hello, I don't think you'll have any problems with your topic merge hack.

For your users level hack, I don't really know much about that. Can you tell me what it does?
Hannibal_King
Registered User
Posts: 436
Joined: Mon Apr 03, 2006 6:24 am
Location: SLOVAKIA
Contact:

Re: [BETA] Viewforum No Query Join

Post by Hannibal_King »

well actually, it is a simple mod that adds completly new levels to your forum that are created right by the mod, not in DB.. like VIP, MAIN MOD, BOT etc..
you can find more about it also with download link right here:
http://www.myphpbb.zaup.org/viewtopic.php?p=878#878

//if there is a way how to modifiy your hack to work with this, it would be perfect :D
User avatar
Dog Cow
Registered User
Posts: 2507
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Re: [BETA] Viewforum No Query Join

Post by Dog Cow »

I don't think I can help you. The point of my mod is that it doesn't do a join of the posts and usrs table. Your mod needs the users table, so that pretty much cancels out the effects of my mod.

The way I see it, it's one or the other: either faster viewforum, or your mod. Ask yourself: do I really need this mod on viewforum?
Hannibal_King
Registered User
Posts: 436
Joined: Mon Apr 03, 2006 6:24 am
Location: SLOVAKIA
Contact:

Re: [BETA] Viewforum No Query Join

Post by Hannibal_King »

wow, thats hard, i am considering now.. :D you see, it would be strange to have colors for new loevels on all forum pages except viewforum :P
User avatar
Dog Cow
Registered User
Posts: 2507
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Re: [BETA] Viewforum No Query Join

Post by Dog Cow »

maybe. But how much do you know about MySQl/PHP? You could modify my MOD so it stores the user level colors in the topics table too.
Hannibal_King
Registered User
Posts: 436
Joined: Mon Apr 03, 2006 6:24 am
Location: SLOVAKIA
Contact:

Re: [BETA] Viewforum No Query Join

Post by Hannibal_King »

Dog Cow wrote:maybe. But how much do you know about MySQl/PHP? You could modify my MOD so it stores the user level colors in the topics table too.
maybe the username color, but i dont know how to modify it to add user levels and also user colors..
User avatar
JLA
Registered User
Posts: 606
Joined: Tue Nov 16, 2004 5:23 pm
Location: USA
Name: JLA FORUMS
Contact:

Re: [BETA] Viewforum No Query Join

Post by JLA »

Could you elaborate more on how this will improve the speed and what sort of improvements you have observed.

Thanks in advance
User avatar
Dog Cow
Registered User
Posts: 2507
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Re: [BETA] Viewforum No Query Join

Post by Dog Cow »

JLA wrote:Could you elaborate more on how this will improve the speed and what sort of improvements you have observed.

Thanks in advance
Me? This makes it so that phpBB doesn't have to query the users and posts table to get a list of topics. This makes it faster by only querying the topics table. It's the same method that phpBB3 employs.
User avatar
JLA
Registered User
Posts: 606
Joined: Tue Nov 16, 2004 5:23 pm
Location: USA
Name: JLA FORUMS
Contact:

Re: [BETA] Viewforum No Query Join

Post by JLA »

So lets see if we have an understanding of this.

This mod will add new data for EACH TOPIC which is the last poster and 1st poster. Then when going to view forum, it will just pull this static data instead of having to query the other tables for the info (which is faster)

Similar method we used on the photo galleries to speed them up if that is what is going on. I do see how this can result in speed improvement.

Big question here - with a forum containing over 11.7 million posts - can this topic update script be a problem? How long should it take to run and what is built in incase it is interrupted?

Thanks
Post Reply

Return to “[2.0.x] MODs in Development”