vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Combining Threads, Posts, Members queries on forumhome into one? (https://vborg.vbsupport.ru/showthread.php?t=44869)

N9ne 10-22-2002 06:50 PM

Combining Threads, Posts, Members queries on forumhome into one?
 
This should reduce queries, maybe make forumhome faster, less server load...etc.?

How can I do this then...:D

NTLDR 10-22-2002 06:55 PM

If you mean the post/thread counts then I'm not sure if you can do the counts from 2 different tables in one query.

N9ne 10-22-2002 06:57 PM

I mean at the top, Members: 5000, Threads: 6000, Posts: 525252

That part ???

NTLDR 10-22-2002 07:02 PM

I doubt that it can be done and if it can I expect its less load on the server to do it the way it is now.

N9ne 10-22-2002 07:14 PM

ok thanks :)

N9ne 10-22-2002 07:14 PM

Do you have any other techniques of reducing queries on forumhome, forumdisplay, showthread?

Logician 10-23-2002 08:40 AM

If you are patient enough to go through the entire vb structure and hack some parts accordingly, here is a thought:

Instead of querying the database online when that info is needed, save this info in a seperate record alltogether and query that field only when needed. Let me clarify:

Your main page querys your db for member count, post count and thread count each for one, 3 in total. If you update a table field with this info everytime membercount/postcount/thread count changes, you can just query that field and get all 3 info at once with a single query. But of course you need to hack vb so that everytime this numbers changes, your record is updated.

This method applies to all queries in you main page. If you go to extremes, you can make it so that your forum home query is 1 in total, getting the entire page as a HTML code with one signle query, provided that you can manage to update that code everytime an incident that changes your main page happens. Well this is of course way too radical, but I just wanted to demonstrate the idea..

You can check the buddy and ignore columns in user table for a "live demonstration". It's only one field so the data is get with 1 query, but they save more than 1 records in it.

N9ne 10-23-2002 02:02 PM

Would functions.php be the file to edit to do the above you said, ie. combining those three queries?

Xenon 10-23-2002 03:01 PM

no, that's what he meant, you have to change more than just one file...

you have to change register.php for the meber stuff
and editpost.php/postings.php/newreply.php/newthread.php for post / thread stuff ;)

everytime you add/delete a post you have to change the posts-value in the db....

N9ne 10-23-2002 03:11 PM

I see, with my tiny knowledge of PHP, I'll stick with my queries for now ;) thanks for the insight though!


All times are GMT. The time now is 10:22 PM.

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.01573 seconds
  • Memory Usage 1,721KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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