MySQL Forums
Forum List  »  Newbie

Help optimize query
Posted by: Allary Max
Date: March 20, 2009 11:58AM

SELECT
mob_db.kName,
mob_db.iName,
mob_db.DropCardid,
(
(SELECT count(*) FROM storage WHERE storage.nameid LIKE mob_db.DropCardid OR storage.card0 LIKE mob_db.DropCardid OR storage.card1 LIKE mob_db.DropCardid OR storage.card2 LIKE mob_db.DropCardid OR storage.card3 LIKE mob_db.DropCardid)+
(SELECT count(*) FROM inventory WHERE inventory.nameid LIKE mob_db.DropCardid OR inventory.card0 LIKE mob_db.DropCardid OR inventory.card1 LIKE mob_db.DropCardid OR inventory.card2 LIKE mob_db.DropCardid OR inventory.card3 LIKE mob_db.DropCardid)+
(SELECT count(*) FROM guild_storage WHERE guild_storage.nameid LIKE mob_db.DropCardid OR guild_storage.card0 LIKE mob_db.DropCardid OR guild_storage.card1 LIKE mob_db.DropCardid OR guild_storage.card2 LIKE mob_db.DropCardid OR guild_storage.card3 LIKE mob_db.DropCardid)+
(SELECT count(*) FROM cart_inventory WHERE cart_inventory.nameid LIKE mob_db.DropCardid OR cart_inventory.card0 LIKE mob_db.DropCardid OR cart_inventory.card1 LIKE mob_db.DropCardid OR cart_inventory.card2 LIKE mob_db.DropCardid OR cart_inventory.card3 LIKE mob_db.DropCardid)
) as card_count
FROM
mob_db
WHERE
mob_db.MEXP > 1 AND mob_db.DropCardper > 0

What i must change to get better query time?

Options: ReplyQuote


Subject
Written By
Posted
Help optimize query
March 20, 2009 11:58AM
March 21, 2009 09:24AM
March 24, 2009 07:54AM
March 24, 2009 11:42PM
March 31, 2009 03:50AM
March 31, 2009 07:51AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.