Aokromes

database optimization

Mar 27th, 2015
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.76 KB | None | 0 0
  1. SELECT COUNT(*) FROM characters; 47262
  2. SELECT COUNT(*) FROM characters WHERE trans_x <>0; 39
  3. need sql to move characters.trans_x, characters.trans_y, characters.trans_z, characters.trans_o, characters.transguid to characters_trans
  4.  
  5. SELECT COUNT(*) FROM characters WHERE at_login <>0; 2624
  6. need sql to move characters.at_login to characters_at_login
  7.  
  8. SELECT COUNT(*) FROM characters WHERE drunk <>0; 31
  9. need sql to move characters.drunk to characters_drunk
  10.  
  11. SELECT COUNT(*) FROM characters WHERE grantableLevels <>0; 194
  12. need sql to move characters.grantableLevels to characters_grantableLevels
  13.  
  14. SELECT COUNT(*) FROM `characters` WHERE `stable_slots` <> '0' LIMIT 0, 1000; 2995
  15.  
  16. SELECT * FROM `characters` WHERE `taxi_path` <> '' LIMIT 0, 1000; 105
  17. SELECT COUNT(*) FROM `characters` WHERE `deleteInfos_Account` <> '0' LIMIT 0, 1000; 7
  18. need sql to move deleteInfos_Account, deleteInfos_Name, deleteDate to character_deleted
  19.  
  20. <Aokromes> SELECT COUNT(*) FROM item_instance; 3642391
  21. <Aokromes> SELECT COUNT(*) FROM `item_instance` WHERE `enchantments` NOT LIKE '%1%' AND `enchantments` NOT LIKE '%2%' AND `enchantments` NOT LIKE '%3%' AND `enchantments` NOT LIKE '%4%' AND `enchantments` NOT LIKE '%5%' AND `enchantments` NOT LIKE '%6%' AND `enchantments` NOT LIKE '%7%' AND `enchantments` NOT LIKE '%8%' AND `enchantments` NOT LIKE '%9%' LIMIT 0, 1000
  22. <Aokromes> 3395101
  23. <Aokromes> 3.395.101 of 3.642.391 lacks enchantments
  24.  
  25. SELECT COUNT(*) FROM `item_instance` WHERE `enchantments` NOT LIKE '%0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0%' LIMIT 0, 1000
  26. 197196
  27.  
  28. -- diff day
  29. <Aokromes> SELECT COUNT(*) FROM `item_instance` WHERE `text` = ''; 2761449
  30. <Aokromes> SELECT COUNT(*) FROM `item_instance` WHERE `text` <> ''; 2068
  31. <Aokromes> SELECT COUNT(*) FROM `item_instance` WHERE `playedTime` > '0'; 217539
  32. <Aokromes> SELECT COUNT(*) FROM `item_instance` WHERE `durability` > '0'; 828067
  33. <Aokromes> SELECT COUNT(*) FROM `item_instance` WHERE `randomPropertyId` > '0'; 81324
  34. <Aokromes> SELECT COUNT(*) FROM `item_instance` WHERE `flags` > '0'; 989091
  35. <Aokromes> SELECT COUNT(*) FROM `item_instance` WHERE `charges` NOT LIKE '%0 0 0 0 0%' LIMIT 0, 1000; 722083
  36. <Aokromes> SELECT COUNT(*) FROM `item_instance` WHERE `charges` NOT LIKE '%0 0 0 0%' LIMIT 0, 1000; 1357
  37. <Aokromes> we are using a blob for 1357 items of 2761449
  38. <Aokromes> SELECT COUNT(*) FROM `item_instance` WHERE `duration` > '0'; 11801
  39. <Aokromes> SELECT COUNT(*) FROM `item_instance` WHERE `count` > '1' LIMIT 0, 1000; 1510186
  40. <Aokromes> SELECT COUNT(*) FROM `item_instance` WHERE `giftCreatorGuid` > '0'; 94872
  41. <Aokromes> SELECT COUNT(*) FROM `item_instance` WHERE `creatorGuid` > '0'; 376446
  42. <Aokromes> SELECT COUNT(*) FROM `item_instance` WHERE `creatorGuid` > '0' AND `count` = '1' ; 178179
  43. <Aokromes> i wonder moving all those to separte tables how much db size will be decreased
  44. <Aokromes> think that we can drop near 40 million of cells to become (300000*2 )+ (2068 * 2)+ (217539 *2) + (828067 * 2) + (81324*2) +(989091*2) + (722083*2) +(11801*2)+(1510186*2)+(94872*2)+( 376446*2) xd
  45. <Aokromes> 40 millon of cels to 5.509.963 :P
  46. <Aokromes> also, maybe we can unblob charges and enchantments and it can be even lower size
  47.  
  48. --- diff day
  49. <Nyeriah> Aokromes: SELECT COUNT(*) FROM characters WHERE at_login <>0; 55898
  50. <Aokromes> Nyeriah, of how much chars?
  51. <Nyeriah> 194177
  52. <Nyeriah> SELECT COUNT(*) FROM item_instance; 12529672
  53. <Nyeriah> SELECT COUNT(*) FROM`item_instance` WHERE `enchantments` NOT LIKE '%1%' AND`enchantments` NOT LIKE '%2%' AND `enchantments` NOT LIKE '%3%' AND`enchantments` NOT LIKE '%4%' AND `enchantments` NOT LIKE '%5%' AND`enchantments` NOT LIKE '%6%' AND `enchantments` NOT LIKE '%7%' AND`enchantments` NOT LIKE '%8%' AND `enchantments` NOT LIKE '%9%' LIMIT 0, 1000; 11485781
Advertisement
Add Comment
Please, Sign In to add comment