vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Thread view optimizations (https://vborg.vbsupport.ru/showthread.php?t=55715)

pwr_sneak 08-03-2003 04:44 PM

Quote:

Today at 07:18 PM fury said this in Post #19
Why not just change this line...

Code:

$postids.= "post.threadid='$threadid'";
to this:

Code:

$postids.= "post.threadid='$threadid' AND post.visible='1'";
It might slow it down a tiny bit more but it works with moderated forums...

for moderated forums you'll need the other query ($postscount = $DB_site->query_first("SELECT COUNT(*)...) too, to get the right pagecount and page navigation.
this hack speeds thread-display because it will not have to crawl the whole post-table to check the "visible" column, it just uses the indexed "thread" column which is alot faster. this is not "a tiny bit" this is MUCH faster on big forums whith huge threads.
I've installed it on my 2 million post forum and it runs like a charm now.

fury 08-03-2003 06:29 PM

Unfortunately I don't have a forum with 2 million posts to check it on. http://smilies.xibase.com/shrug.gif Why not index the visible column then? Since you have a multi-GB post table, what's an extra few dozen megs gonna hurt?

As for the post count, $thread['replycount'] is not incremented for posts that are placed in the moderation queue. it is only updated when they are taken out of the queue. That's the whole point of the reply count field, if there were more replies showing in the count on forumdisplay than were visible in the thread, people would start to wonder.

cirisme 08-03-2003 08:21 PM

I like this hack and it definately improved the speed, but we have a moderated users hack and this causes those posts to show up anyway, so I had to uninstall it.

Definately a great concept though :)

romeshomey 08-03-2003 09:14 PM

Nice.. Thanks

Alien 08-04-2003 03:24 PM

fury's suggestion for reducing yet another query, has this been independently confirmed as well before I play with it. :D

Oblivion Knight 08-04-2003 05:47 PM

Quote:

Today at 05:24 PM Alien said this in Post #25
fury's suggestion for reducing yet another query, has this been independently confirmed as well before I play with it. :D
I haven't tried it yet.. Waiting for confirmation, the same as you ;)

Alien 08-04-2003 11:54 PM

Can this optimization work with this hack below?

https://vborg.vbsupport.ru/showthrea...threadid=36416

These lines (that you ask me to replace) are different in my showthread.php:

PHP Code:

$postscount=$DB_site->query_first("SELECT COUNT(*) AS posts FROM post WHERE post.threadid='$threadid' AND post.visible=1$attachment_clause"); 

&

PHP Code:

$getpostids=$DB_site->query("
    SELECT post.postid FROM post
    WHERE post.threadid='
$threadid' AND post.visible=1$attachment_clause
    ORDER BY dateline 
$postorder LIMIT ".($limitlower-1).",$perpage
"
); 

How would I make this compatible? :D

sabret00the 08-10-2003 02:31 PM

great hack, noticed it straight away

Alien 08-10-2003 04:12 PM

Any solution on my question above anyone? :)

David Bott 08-13-2003 04:17 PM

Mow installed on AVS Forum (http://www.avsforum.com) and it does help with this large active site.

Anything to make the DB server happier. :)


All times are GMT. The time now is 01:46 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01036 seconds
  • Memory Usage 1,740KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete