Friday 15 January 2010

mysql - which is more efficent, DELETE and INSERT or INSERT and UPDATE -


I have an EVA table structure, Visesh_, Visesh_ and Visesh_ performance does not need to fill < p> i is a SQL script that populate these Eve characteristics of products, how is stored in the works my scripts that process data from these 3 values ​​and temporary table, when all my data Is when I update the eve attributes

It is possible for any of these values ​​of the product so I have 2 apps

1) Delete for the products I listed Eve value temporary table, then INSERT those 2) INSERT has been assigned to those values ​​ UPDATE with a

I am working with more than 10,000 products, so i am thinking which is more efficient because i reduce the time limit of query Want

  list Kren_prodkt_netiti_detaim (Ikai_prkar_aidi, store_i (4, 0, PRODUCT_ID_1, ATTRIBUTE_ID_FOR_SPECIAL_FROM , SOME_DATE_VALUE), (4, 0, PRODUCT_ID_2, ATTRIBUTE_ID_FOR_SPECIAL_TO, SOME_DATE_VALUE) value, (4, 0, PRODUCT_ID_2, ATTRIBUTE_ID_FOR_SPECIAL_FROM, SOME_DATE_VALUE), - ... and so on ... and so kind-... and so on duplicate key update value = value (value)   

and the same (for the special display area may be datatype.)

I assumed Magnes here Why It was the only thing I have ever seen using Iavi.

This 2 questions will help you to update all affected products at once, thus reducing the effect on the database (reindexing). Another way to do single queries within a query within a transaction, to avoid reindex per entry.

No comments:

Post a Comment