I have a table which contains many items.  Each item consists of an
scriptID, several attributes, and an optional field - a "parent" (called
"dupeitem" in the database) item.  Most all of these fields are strings -
even the IDs which consist of a combination of letters and numbers.  Items
which have a parent item listed do not have attributes themselves, but
instead "inherit" these properties from their parent. These child items are
initially added with NULL attributes.  The parent item is listed in the
"dupeitem" field - which specifies the scriptID of its parent.
I populate the database by reading in the items from various files.  Upon
completion, I then attempt to fill in the missing attributes.  To accomplish
this I am currently usign the following query:
 
UPDATE items, items AS items2
    SET items.catID = items2.catID, items.name = items2.name, items.id =
items2.id, items.description = items2.description
    WHERE items.added = 1 AND items.dupeitem = items2.scriptID
 
This query on the items table (which contains over 50,000 items) takes an
INCREDIBLY long time to execute.
Actually... now that I think about it - I haven't actually seen it finish
yet - I've always run out of time (10-15min) to wait for it and have
aborted.
 
Any ideas/suggestions on what I could do to cut this time down?  Or another
alternative for filling in this information?
 
Adam Clauss
[EMAIL PROTECTED]
 

Reply via email to