• Страница 1 из 1
  • 1
Модератор форума: Dimitro  
Оптимизация - Чистка базы данных
GonZZo
[Zlo_MasteR]
Если у Вас имя базы другое, то надо будет ascent сменить на имя Вашей базы, где хранится таблички.
Code
#Команда на удаление аккаунтов, которые не использовались или на которых нет персонажей.    

DELETE FROM `ascent`.`accounts` where `acct` not in (select acct from `ascent`.`characters`);


Code
# Удаление персонажей у которых нет аккаунтов. Удаление всех связей с удаленными персонажами.    

DELETE FROM `ascent`.`characters` where `acct` not in (select acct from `ascent`.`accounts`);    
DELETE FROM `ascent`.`corpses` where `guid` not in (select guid from `ascent`.`characters`);    
DELETE FROM `ascent`.`guild_banklogs` where `player_guid` not in (select guid from `ascent`.`characters`);    
DELETE FROM `ascent`.`guild_data` where `playerid` not in (select guid from `ascent`.`characters`);    
DELETE FROM `ascent`.`guilds` where `leaderGuid` not in (select guid from `ascent`.`characters`);    
DELETE FROM `ascent`.`instances` where `creator_guid` not in (select guid from `ascent`.`characters`);    
DELETE FROM `ascent`.`mailbox` where `player_guid` not in (select guid from `ascent`.`characters`);    
DELETE FROM `ascent`.`mailbox` where `sender_guid` not in (select guid from `ascent`.`characters`);    
DELETE FROM `ascent`.`playercooldownitems` where `OwnerGuid` not in (select guid from `ascent`.`characters`);    
DELETE FROM `ascent`.`playercooldownsecurity` where `OwnerGuid` not in (select guid from `ascent`.`characters`);    
DELETE FROM `ascent`.`playeritems` where `ownerguid` not in (select guid from `ascent`.`characters`);    
DELETE FROM `ascent`.`playerpets` where `ownerguid` not in (select guid from `ascent`.`characters`);    
DELETE FROM `ascent`.`playerpetspells` where `ownerguid` not in (select guid from `ascent`.`characters`);    
DELETE FROM `ascent`.`playerpetspells` where `ownerguid` not in (select guid from `ascent`.`characters`);    
DELETE FROM `ascent`.`playersummonspells` where `ownerguid` not in (select guid from `ascent`.`characters`);    
DELETE FROM `ascent`.`questlog` where `player_guid` not in (select guid from `ascent`.`characters`);    
DELETE FROM `ascent`.`social` where `guid` not in (select guid from `ascent`.`characters`);    
DELETE FROM `ascent`.`tutorials` where `playerId` not in (select guid from `ascent`.`characters`);
Сообщение # 1 отредактировано Pr - Четверг, 10.11.2011, 00:26
INFERNOS
Pro[100]KilleR, всё чётко!
Присяжный - краб.
Сообщение # 2 написано 13.10.2010 в 17:39
GonZZo
[Zlo_MasteR]
cookies, что такое?)
Сообщение # 3 написано 13.10.2010 в 22:12
Dok_
†Почётный юзер†
Спасибо, хорошая информация biggrin
Сообщение # 4 написано 11.12.2010 в 21:30
  • Страница 1 из 1
  • 1
Поиск: