Question
September 28, 2007 at 05:10 AM
jacques.hellio

Optimise the update of a table from another one

by jacques.hellio . Updated 19 years, 1 month ago

Hi,

I have 2 tables,

Product: Product_code, value1, value2 ( 300 000 records )
Orders: Product_code, value1, value2 ( 1 000 000 records )

I’d like to update Orders from Product.

I’am using the folowing statement:

update
set
orders.value1 = product.value1,
orders.value2 = product.value2
from orders, product
where
orders.product_code = product.product_code

It takes minutes and minutes to update. I created then indexes on both table on Product. But still it takes a lot of time ( more than 15mn).

Any idea how to speed this up?

Thanks, J.

This discussion is locked

All Comments