vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   adding index to posts table for ip search (https://vborg.vbsupport.ru/showthread.php?t=312307)

dethfire 06-20-2014 05:36 PM

adding index to posts table for ip search
 
IP search crushes my database. I heard adding an index to the posts table does the trick. How do I do that? thanks!

kh99 06-20-2014 07:16 PM

I'm not a mysql expert, but I think you'd want to add an index to the post table on column ipaddress. If you have phpMyAdmin, you can click on the database then the post table, then "structure". Find the "+index" link and click it, then where it says "Create an index on 1 columns", press go. Then enter a name (like ipaddress), select INDEX from the dropdown, and ipaddress from the other dropdown.

If you want to do it via a query, I think it would be
Code:

CREATE INDEX ipaddress ON post (ipaddress)
Note, you really shouldn't modify the database directly if you're not sure what you're doing, and you should have a backup in case something goes wrong.

I also should mention that I'm not sure what effect adding that index will have, because of course any index takes up storage space and has to be maintained which means that every time anyone posts it has to update that index. I suppose posting happens much less often than displaying posts, so maybe it's not an issue.


All times are GMT. The time now is 10:22 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.03429 seconds
  • Memory Usage 1,705KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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