Quote:
Originally Posted by mike_bike_kite
You haven't provide the indexes on the table nor the table definition so it's difficult to provide a solution. The index on the sku column probably won't help as you're using NOT IN (it's easy to find page 5 in a book but imagine trying to find all the pages that are not page 5). A few questions:- How many rows are in the products table?
- Is there an index on feedid?
- How many different values would feedid hold in the products table?
- Why do you have a a long list of sku codes as a hard coded list - shouldn't they be in a table somewhere?
- How many rows are being updated here and does the update happen often?
|
- the products table has about 300.000 rows now, but it's just a test, this value should grow to several millions.
- yes, there's an index on feedid
- feedid currently has only 2 different numeric values, it will hold max few hundreds
- I hardcoded the skus there because it was easier to read, but they are stored in a text field in another table ( a single text field containing all the skus)
- the update should happen once everyday, I don't have a realistic figure of how many skus will need to be updated every day for each feed, I suppose
most times the number will be rather low, few tens maybe.
The problem is reversed, I only have a list of those that don't need to be updated, hence the NOT IN clause.