View Single Post
  #6  
Old 10-05-2019, 01:10 AM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

If you prefer INNER JOINs...

Code:
SELECT `a`.`zone` FROM `spawn2` `a`
INNER JOIN `spawnentry` `b` ON `b`.`spawngroupID` = `a`.`spawngroupID`
INNER JOIN `npc_types` `c` ON `c`.`id` = `b`.`npcID`
INNER JOIN `loottable_entries` `d` ON `d`.`loottable_id` = `c`.`loottable_id`
INNER JOIN `lootdrop_entries` `e` ON `e`.`lootdrop_id` = `d`.`lootdrop_id`
INNER JOIN `items` `f` ON `f`.`id` = `e`.`item_id`
AND `f`.`id` = '10400' # `f`.`id` IN (...)
GROUP BY `a`.`zone`
ORDER BY `a`.`zone`;
Code:
SELECT `a`.`name` FROM `npc_types` `a`
INNER JOIN `loottable_entries` `b` ON `b`.`loottable_id` = `a`.`loottable_id`
INNER JOIN `lootdrop_entries` `c` ON `c`.`lootdrop_id` = `b`.`lootdrop_id`
INNER JOIN `items` `d` ON `d`.`id` = `c`.`item_id`
AND `d`.`id` = '10400' # `d`.`id` IN (...)
INNER JOIN `spawnentry` `e` ON `e`.`npcID` = `a`.`id`
INNER JOIN `spawn2` `f` ON `f`.`spawngroupID` = `e`.`spawngroupID`
AND `f`.`zone` = 'mesa'
GROUP BY `a`.`name`
ORDER BY `a`.`name`;

I saw no difference in query time myself...


Note: Global items have changed in the way they are handled and no longer appear in loot tables. (Any remnants will eventually be taken out.)
__________________
Uleat of Bertoxxulous

Compilin' Dirty

Last edited by Uleat; 10-05-2019 at 01:28 AM..
Reply With Quote