cq27
asked on
How to reduce update time?
Hi there,
I have two major tables:
Product Stock Levels = 2.3m rows
Product = 4.2m rows
It takes about 2hr 15 mins to run this Stored Procedure below and complete. I need some assistance to how I can improve this update to be shortened? I understand that JOINS can be written as OUTER AND INNER JOIN OR LEFT JOIN. Can anyone help to clarify?
Thank you.
UPDATE Product SET
StockLevel = 1,
DisabledFlag = 0,
PriceAmt = CAST(igmsi.PublisherPrice AS MONEY)/100,
DiscountPercent=CASE WHEN PriceAmt>14.90 THEN 20 ELSE 15 END
From Stock_update.dbo.Product_S tock_Updat e igmsi
JOIN Product ON igmsi.ISBN=Product.ISBN
Where Product.Producttype='Books '
I have two major tables:
Product Stock Levels = 2.3m rows
Product = 4.2m rows
It takes about 2hr 15 mins to run this Stored Procedure below and complete. I need some assistance to how I can improve this update to be shortened? I understand that JOINS can be written as OUTER AND INNER JOIN OR LEFT JOIN. Can anyone help to clarify?
Thank you.
UPDATE Product SET
StockLevel = 1,
DisabledFlag = 0,
PriceAmt = CAST(igmsi.PublisherPrice AS MONEY)/100,
DiscountPercent=CASE WHEN PriceAmt>14.90 THEN 20 ELSE 15 END
From Stock_update.dbo.Product_S
JOIN Product ON igmsi.ISBN=Product.ISBN
Where Product.Producttype='Books
ASKER
Hi there,
Will indexing be useful if the Product Stock file keeps changing? I receive a new product file in ASCII txt format daily and I generally will truncate the Product Stock table before inserting the new full data.
I also need some help on how indexing works. Thank you.
Will indexing be useful if the Product Stock file keeps changing? I receive a new product file in ASCII txt format daily and I generally will truncate the Product Stock table before inserting the new full data.
I also need some help on how indexing works. Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the advice and direction. I will have to work out the indexing and try it for myself.
Product ON igmsi.ISBN, Product.ISBN , Product.Producttype