vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Big Board Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=172)
-   -   added indexes (https://vborg.vbsupport.ru/showthread.php?t=110648)

Reeve of shinra 03-17-2006 01:29 PM

added indexes
 
Have you added any extra indexes to increase performance? I remember Erwin posted some a looong time ago that was a real help to my site. I just wish I could remember what they were.

The Prohacker 03-17-2006 03:15 PM

We have added an index to the ipaddress column on the post table to help with IP searches and of course the full text index for full text searching. We have added a few others but I cannot remember them off the top of my head.

Xenon 03-17-2006 06:48 PM

well everything is based on what indexes you really need, as extra indexes do also increase the work a db has to do when inserting/deleting

Paul M 03-17-2006 07:08 PM

Adding one to the IP address in the post table is a must on any large board - I really don't understand why it isn't default.

We have a few others due to some hacks - dateline and lastvisit on posts being two I believe.

Erwin 03-21-2006 07:45 PM

Quote:

Originally Posted by Paul M
Adding one to the IP address in the post table is a must on any large board - I really don't understand why it isn't default.

We have a few others due to some hacks - dateline and lastvisit on posts being two I believe.

IP is a must for the post table, I agree.

That IP search in admincp is a server killer - I've offloaded it to a slave search server actually.

rossco_2005 03-21-2006 08:39 PM

Only index i've added to my vb database that I remember is the IPadress one too.
But then there's also the indexes that have been added as part of other hack installs and upgrading the board. ;)

Kevlar 03-23-2006 10:03 PM

i've always wanted to add some extra indexes... but feared what would happen during forum upgrades. IP Address searching on our forum is almost a guaranteed server death... :(

007 03-24-2006 07:33 AM

What eactly do you do to add an index? I'm assuming you are just adding a field to the table and specifying "index" or is there something else that has to be done for it to be beneficial?

Kevlar, I doubt adding it would effect upgrades. I have several custom fields added to different tables in my DB and upgrading has never been a problem.

Fallback 03-24-2006 03:48 PM

Quote:

Originally Posted by Paul M
Adding one to the IP address in the post table is a must on any large board - I really don't understand why it isn't default.

How does one add an index to the IP address in the post table?

Paul M 03-24-2006 06:16 PM

ALTER TABLE post ADD INDEX ipaddress

Kevlar 04-03-2006 01:55 PM

Quote:

Originally Posted by 007
Kevlar, I doubt adding it would effect upgrades. I have several custom fields added to different tables in my DB and upgrading has never been a problem.

Then my final question is ... why didn't the vB team add an index to that column already (especially since big boards all over suffer from this problem)?

That is the only thing stopping me at this point as it only seems logical to have an index on a column that is frequently used. :confused:

Xenon 04-03-2006 03:07 PM

hmm, the question cannot be answered directly

but on the other hand, there are a lot of forums, which don't store the ips, and then and index wouldn't be of use

as i posted above, and index also has negative aspects, if it wouldn't you could always index every single field ;)

Paul M 04-03-2006 06:07 PM

Quote:

Originally Posted by Kevlar
Then my final question is ... why didn't the vB team add an index to that column already (especially since big boards all over suffer from this problem)

Perhaps no one has ever suggested it ?

Quote:

Originally Posted by Xenon
but on the other hand, there are a lot of forums, which don't store the ips, and then and index wouldn't be of use

True, but it wouldn't harm anything.

Quote:

Originally Posted by Xenon
as i posted above, and index also has negative aspects, if it wouldn't you could always index every single field ;)

While indexing every field would ot make sense, there are a number of places that really could use them. The extra speed and saved resources on a select are usually worth the small amount of extra overhead when a record is added, and the space taken up. IMO people are often too afraid to add indexes when they really shouldn't be.

The Prohacker 04-03-2006 06:24 PM

Quote:

Originally Posted by Xenon
but on the other hand, there are a lot of forums, which don't store the ips, and then and index wouldn't be of use


The default setting on vBulletin is to store IPs and not display them publicly. Most people don't change default settings so an index could help everyone.

Quote:

Originally Posted by Paul M
While indexing every field would ot make sense, there are a number of places that really could use them. The extra speed and saved resources on a select are usually worth the small amount of extra overhead when a record is added, and the space taken up. IMO people are often too afraid to add indexes when they really shouldn't be.

Couldn't put it any better!

Kevlar 04-04-2006 03:07 PM

Index added ... no ill effects found (other than me being unable to wait patiently while the alter table command ran). IP searches are much faster now... almost instantaneous.

Spleasure 05-15-2006 01:53 PM

If the vB team would add the index in an upcoming upgrade that upgrade would become problematic for large boards without the index. It has to be introduced very gently to not upset the customers.

DementedMindz 06-05-2006 04:30 AM

ok question if i was to add this add an index to the IP address in the post table and if i upgrade when 3.6 comes out will there be any changes i need to do... just making sure down the line i dont get no errors thanks...


Quote:

Originally Posted by Paul M
ALTER TABLE post ADD INDEX ipaddress


also i seen this posted before is pauls the right one or is this one the right one?
Code:

ALTER TABLE `post` ADD INDEX `ipaddress` ( `ipaddress` )

cscgal 06-07-2006 02:55 AM

Pretty sure it's the second.

Spleasure 06-07-2006 06:15 AM

They work both. Note that you have to take care of adding the prefix if you use one.

BoardTracker 06-15-2006 01:50 PM

If I may give a few highlights on indexes and databases (MySQL specifically a well since most of you use that one)

Indexes as Paul M indicated are not really harmful when not used, and are very useful when they are used (as Kevlar noticed).

However, you should be aware of the downside of an unused index.
1. Indexes take time to create. Not only during altering a table but also whenever a new record is added to the table. So bear that in mind. Although, when adding a simple index like IP row index, the effect of it on insert is usually very mild.
2. Indexes do take space. Some more, some less. If you add more and more indexes, especially if they are not used, they can eventually take more space than the data itself. In some cases this is even the desired situation.
3. Indexes can corrupt. Although tables don't get corrupted on a daily basis (thank god), it can (and sometimes does) happen. The less indexes you have, the better in that respect .

So I would say that if an index is not needed, don't add it. As for whether or not VB should add it.. if there are built-in features that do a cumbersome select on a field in what usually gets to be a big table, an index for the field is most likely needed.

Lastly.. there is not much you can do though with regards to the regular full-text search on the database level. This is because databases were not really designed for FTS (FullText search) indexing. It works, but usually for small boards. When your board gets big, FTS will probably grind your servers down.

In case you have that problem, a mod we developed for board owners can solve that problem, by using BoardTracker's search implemented into the board. You can check out boards.ie or rpg.net for examples which use it.

Bulent Tekcan 07-21-2006 11:37 AM

How long time create a index ?

BoardTracker 07-21-2006 12:30 PM

Quote:

Originally Posted by Bulent Tekcan
How long time create a index ?

It depends how big is the table and what Index type it is.
for non FTS index, it is usually not too long. Only if you have a VERY big table with tens of millions of records, it may take more than a minute. Huge tables, might take more, maybe 5 or even 10 minutes. But I mean HUGE tables.

P.S.
Did you submit your board to Boardtracker for inclusion? :)

Bulent Tekcan 07-22-2006 09:07 AM

Himmmm OK

Our post is 2.300.000 :) And finished 7 minutes my dual opteron machines ;) ,also now very fast search IP adress and without any problem.

Normaly our boards use a big-boards.com,but manytimes they are not updates our data,for example alexa rating.But I'll invest'gation your service ;)

Thanks


All times are GMT. The time now is 06:44 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.01298 seconds
  • Memory Usage 1,776KB
  • 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)bbcode_code_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (23)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete