MySQL Forums
Forum List  »  Optimizer & Parser

MySQL cash optimization
Posted by: Sasha Katsman
Date: November 27, 2014 06:33AM

Hello,

I am trying to find solution for my problem, and on this point don’t have any clue.
I was hoping someone on here could help me out.

I am running a script with group of quarries on very big tables. It takes so long to the server to calculate it.
The interesting thing that on the first time when the script done it can take 10min and if I run the same script second time server can do it for 1min. I guess that mysql make some cashing that help him to finish it much faster.
Is there any way to prevent from the mysql making this cashing? If yes, is there any way that the script will finish faster for the first run?



INSERT IGNORE INTO item_cat (ID_CAT, ID_ITEM, `VIEW`, PRICE)
SELECT '.$id_cat.', ID_ITEM, 0, 0
FROM item_cat_full where ID_CAT = '.$id_catEngen:

DELETE ic.* FROM item_cat ic
INNER JOIN item_cat ic2 ON ic.ID_ITEM=ic2.ID_ITEM
INNER JOIN cat_reject cr ON ic.id_cat = cr.id_ferit
WHERE ic.ID_CAT= '.$id_cat.' AND ic2.ID_CAT = cr.id_market

DELETE ic.* FROM item_cat ic
INNER JOIN item_cat ic2 ON ic.ID_ITEM=ic2.ID_ITEM
WHERE ic.ID_CAT='.$id_cat.' AND ic2.ID_CAT IN ('.$ids_cat_market.')

INSERT IGNORE INTO item_cat (ID_CAT,ID_ITEM,PRICE,VIEW)
SELECT '.$id_cat.' AS ID_CAT,ic.ID_ITEM,i.PRICE,i.VIEW
FROM item_cat ic INNER JOIN items i ON i.ID_ITEM=ic.ID_ITEM WHERE ID_CAT IN ('.$ids_cat_market.')



Is there any way to do some changes for make it faster?

Any help would be greatly appreciated!

Thanks
Sasha

Options: ReplyQuote


Subject
Views
Written By
Posted
MySQL cash optimization
2563
November 27, 2014 06:33AM
1531
November 27, 2014 04:34PM
1217
December 09, 2014 04:33AM
1081
December 09, 2014 12:28PM


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.