vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Mass delete of welcome PM from all users (https://vborg.vbsupport.ru/showthread.php?t=235541)

annatar 02-10-2010 08:14 PM

Mass delete of welcome PM from all users
 
Hello all.

I've a situation where there are close to 20k users who have their original welcome PM message left in their inbox and no other PM. I suspect that this is causing the maintenance script which scans the PM table to take longer than it should and as a result it is sometimes slowing down the forum.

I want to perform a mass purge of all of those messages from the database. I wrote two simple SQL statements which I used on a test copy of the forum database and didn't notice any errors. Those statements are:

delete from `forumPrefix_pmtext` where message like 'Thank you for registering%'
delete from `forumPrefix_pm` WHERE pmtextid NOT IN (select `pmtextid` from `forumPrefix_pmtext`)

When running those on the test database it seems to have deleted everything I wanted and the test forum seems to behave without issue.

Does anyone know of any reason why performing those statements would be bad? I didn't see any explicit database associations which would be broken by performing the operations directly with SQL.

I know vBulletin has the option to list all users with only 1 PM via the admincp but honestly it isn't realistic to use those drop down boxes to delete PMs for 20k users.

Marco van Herwaarden 02-15-2010 10:07 AM

You would only need to delete them from the 'pm' table. The pmtext table is cleaned automatically.


All times are GMT. The time now is 09:26 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.01295 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)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