Сейчас 29.11.2024, 00:01



  • Страница 1 из 1
  • 1
Оптимизация - Чистка базы данных
AndrqhaДата: Вторник, 09.08.2011, 17:59 | Сообщение # 1
Генерал-майор
Группа: Модераторы
Сообщений: 288
Награды: 2
Репутация: 1
Статус:
Если у Вас имя базы другое, то надо будет [color=red]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 из 1
  • 1
Поиск:

Unread posts Есть новые сообщения    No unread posts Нету новых сообщений    No unread posts [ Locked ] Закрытый форум