Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
164 views
in Technique[技术] by (71.8m points)

python - Is this process supposed to take this long, or did I do something wrong?

I have a MySQL database with about 400,000 records. First I ran this command:

SELECT url
     , COUNT(url) 
  FROM url_list 
 GROUP 
    BY url 
HAVING COUNT(url) > 1;

That command returned 39,121 records.

Oops.

One of the scripts I ran as I was experimenting didn't have the IGNORE set, so there are some duplicates.

To fix it, I ran this command:

DELETE t1 
  FROM url_list t1 
  JOIN contacts t2 
 WHERE t1.ID < t2.ID 
   AND t1.url = t2.url;

It's been about 15 minutes.

My computer is desktop with an i5 and 16GB RAM. HTOP says mysql is using 100% of the CPU. Is this just something where I need to wait, since I'm not really running on a powerful database server?

Also, what's the minimum hardware requirements for this to take 5 minutes or less, in your opinion. I'm just learning, but I'm having a blast with Python. I might want to upgrade someday.

question from:https://stackoverflow.com/questions/65874644/is-this-process-supposed-to-take-this-long-or-did-i-do-something-wrong

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...