Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #31  
Old 07-02-2004, 04:24 PM
Jolten Jolten is offline
 
Join Date: Mar 2004
Posts: 749
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow. Although I wasn't at all unhappy with the speed of my tiny little forum adding indexes to post.dateline, thread.lastpost, and thread.lastposter has made pages load exceptionally fast. Thanks for this Amy!
Reply With Quote
  #32  
Old 07-02-2004, 05:22 PM
soopa soopa is offline
 
Join Date: Apr 2002
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

good stuff :devious:
Reply With Quote
  #33  
Old 07-03-2004, 01:07 AM
Gamingforce's Avatar
Gamingforce Gamingforce is offline
 
Join Date: Oct 2001
Location: New York City
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just added an index to post.dateline and thread.lastpost. Speed seems a little faster and database insertions into the post/thread tables don't seem too bad. My board has 150-300 users, on average and has around 850,000 posts.

I would recommend this simple modification to anyone.
Reply With Quote
  #34  
Old 07-03-2004, 03:17 AM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In addition to regularly optimizing your index tables, indexing can be a big help on columns when quering.

More information:
http://dev.mysql.com/doc/mysql/en/MySQL_indexes.html

Another good read on general database optimization:
http://dev.mysql.com/doc/mysql/en/Op...Structure.html
Reply With Quote
  #35  
Old 07-03-2004, 03:37 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In phpmyadmin, how can you tell if something already has an index for it?
Reply With Quote
  #36  
Old 07-03-2004, 04:19 AM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In the Structure layout, roll down the the bottom - there is an Index summary table below the main layout...
Reply With Quote
  #37  
Old 07-03-2004, 04:49 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Natch
In the Structure layout, roll down the the bottom - there is an Index summary table below the main layout...
Thank you, sir. I needed to check if I had more then 1 index for a couple of these and I did. Now all is well.
Reply With Quote
  #38  
Old 07-03-2004, 01:28 PM
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Location: Sheffield, UK
Posts: 1,757
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TTG
I added the ALTER TABLE `post` ADD INDEX(`dateline`); and must admit my board seem to load a lot faster.

What are the codes to add for post.dateline, thread.lastpost as well as thread.lastposter
ALTER TABLE `thread` ADD INDEX(`lastpost`);

ALTER TABLE `thread` ADD INDEX(`lastposter`);



Strangely, my forum seems to load faster, but the Microstats don't reflect this..

Viewing a thread before:
Page generated in 0.11889291 seconds (92.06% PHP - 7.94% MySQL) with 13 queries

Viewing a thread after:
Page generated in 0.50758195 seconds (96.13% PHP - 3.87% MySQL) with 13 queries
Reply With Quote
  #39  
Old 07-18-2004, 04:25 PM
MickDoneDee MickDoneDee is offline
 
Join Date: Mar 2003
Location: Sydney
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I indexed the following as mentioned in the previous posts:

post.dateline
thread.lastpost
thread.lastposter

Adding indexes for thread.lastpost and thread.lastposter only increased the space usage by about 10,000 bytes.

I didn't notice a discernable difference in speed when loading the index page or forumdisplay page.

I turned the debug mode on in the config.php file so that the controls appeared at the bottom of the forum pages. Then I clicked (Explain) which loaded http://www.myforum.com/?explain=1

This detailed all the Queries that were run. I checked through this for the index page and forumdisplay page. I couldn't find any reference to post.dateline, thread.lastpost or thread.lastposter. So page load speed for the index page or forumdisplay page can't be influenced by those three new indexes. Question is: which pages do load faster as a result of those three indexes?

If your config.php file doesn't already contain $debug, add it to the bottom of the file as I've shown here. To prevent other users from accessing it add your IP address where I've indicated. You can get your IP address from Who's Online if you are logged on.

PHP Code:
// Prefix that all vBulletin cookies will have
// For example
$cookieprefix 'bb';

// ****** DEBUG MODE ON/OFF ******
// Turn debug on with '1' otherwise leave it blank to disable it.
$debug '1';

if (
$_SERVER['REMOTE_ADDR'] == 'your IP address')
{
$debug 1;
} else {
$debug 0;


/*======================================================================*\
|| ####################################################################
|| # Downloaded: 19:34, Mon Apr 5th 2004
|| # CVS: $RCSfile: config.php.new,v $ - $Revision: 1.19 $
|| ####################################################################
\*======================================================================*/
?> 
Another feature that is activated with debug on is the Admin Help Manager which appears in the vBulletin Options menu within the Admin CP.
Reply With Quote
  #40  
Old 07-18-2004, 05:11 PM
MickDoneDee MickDoneDee is offline
 
Join Date: Mar 2003
Location: Sydney
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

To add an index in your phpmyadmin the attached images will help to explain it.

Load the page which displays all the tables. See part of this page in PhpMyAdmin 2001.jpg

Notice that each table has a Properties column. Choose your table and click Properties in that row. See PhpMyAdmin 9001s.jpg for the Post table.

Notice that each property has an Index column. You can also see a table at the bottom which shows existing indexes. You don't want to create one if it already exists. Choose your property and click Index in that row.

See PhpMyAdmin 11001.jpg that shows a message to say the index has been added.

See PhpMyAdmin 12001.jpg that shows that the property "dateline" has been added to the list of indexes.

Hope this helps make sense of it all.
Attached Images
File Type: jpg PhpMyAdmin 2001.jpg (92.3 KB, 0 views)
File Type: jpg PhpMyAdmin 9001s.jpg (83.7 KB, 0 views)
File Type: jpg PhpMyAdmin 11001.jpg (68.6 KB, 0 views)
File Type: jpg PhpMyAdmin 12001.jpg (58.1 KB, 0 views)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:07 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.04384 seconds
  • Memory Usage 2,287KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (4)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete