Tell me more ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I started the process of inserting returned results to another table. The query groups the rows in respect of indexed IDs. This causes 149,000,000 rows to be decreased to 460,000 rows.

The query includes 3 table INNER JOINs, with each table having about 20,000,000 rows.

Further information, the process completes in about 12 seconds for a test file which has 1000 input rows, and returns 703 rows.

I started the query earlier ### we don't know when earlier is ###, but it is still running in the state: "Copying to temp table on disk" after 38000 seconds (10 and a half hours).

I think there is a problem during the insertion process. What am I probably doing wrong here? If it helps, the operating system of the computer is Windows 7, it has 3 GB RAM, an Intel Core2Duo 2.27GHz processor. ### you forgot to tell us details on the hard drive. One partition in, one out, same disk, same partitions, etc ###

Here's my query as it currently reads:

INSERT INTO kdd.contents 
            (adid, 
             descriptionwords, 
             purchasedkeywordwords, 
             titlewords) 
SELECT t.adid, 
       dt.tokensid, 
       pkt.tokensid, 
       tt.tokensid 
FROM   kdd.training t
       INNER JOIN kdd.purchasedkeywordid_tokensid pkt
               ON t.keywordid = pkt.purchasedkeywordid 
       INNER JOIN kdd.titleid_tokensid tt
               ON t.titleid = tt.titleid 
       INNER JOIN kdd.descriptionid_tokensid dt
               ON t.descriptionid = dt.descriptionid 
GROUP  BY adid; 
share|improve this question
Please include in your question the query you use alongside with the relevant parts of your schema (table and index definitions). An EXPLAIN output could help as well. – dezso Oct 9 '12 at 18:57
Are ...words and ...id really compatible? Or the id suffix has nothing to do with an ID? – dezso Oct 9 '12 at 19:16
Explain output for SELECT: imageshack.us/photo/my-images/26/capturefje.png – JoshuaJeanThree Oct 9 '12 at 19:20
@dezso, yes, it's compatible. tokensID is a char string. – JoshuaJeanThree Oct 9 '12 at 19:23
Please include your query plan in the question. In table format, if possible. And, please, address the remarks left in the text by @jcolebrand. – dezso Oct 9 '12 at 19:41
show 4 more comments

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.