Phpmyadmin freezes on query, db too big?

前端 未结 4 1978
忘掉有多难
忘掉有多难 2021-01-15 16:58

I got two tables (one with 33k rows and another with 7k rows). I want to compare the two tables and delete the rows in which the two id\'s dont match. But when i send off th

相关标签:
4条回答
  • 2021-01-15 17:12

    Does Freeze imply it's working but never updates/ never "finishes" the task?

    If so,
    I have had a similar thing and found they've been due to having more than one index on a column, for example a column has a PRIMARY index and an index named after the column, so check your indexes

    0 讨论(0)
  • 2021-01-15 17:14

    I sometimes run large import "queries" that can take a few hours to process. (I untick "Partial import -> Allow the interruption of an import...".)

    phpMyAdmin will not respond in the browser I started the queries in, even if I try to reload the page, but if I go to a browser on another machine with (I assume) a different IP address phpMyAdmin responds fine.

    On the other browser I then issue the SQL command SHOW FULL PROCESSLIST to monitor and kill that long running query if need be.

    0 讨论(0)
  • 2021-01-15 17:23

    I would do an explain so you can see what mysql does. This would give a good indication on what how many rows are used.

    EXPLAIN SELECT * FROM likes LEFT OUTER JOIN uploads on likes.upload_id = uploads.upload_id WHERE uploads.upload_id IS NULL
    

    you could also use another browser or another session to use show processlist to see how the query is executed.

    0 讨论(0)
  • 2021-01-15 17:25

    Tables probably aren't too big but PhpMyAdmin's query timeout might be an issue if the script takes a long time to finish. Try and change the timeout or don't use PhpMyAdmin at all. See if you are able to so the query using command line on the server (or some other tool).

    See also:

    • how to import a very large query over phpmyadmin?
    • Mysql phpMyadmin Timeout Question
    0 讨论(0)
提交回复
热议问题