I am doing some pre-processing on my database. Basically two queries, one is
INSERT INTO tbb SELECT field1, field2, field3 FROM tba WHERE field1 <> ""
the other is
INSERT INTO tbc SELECT field1, field2, SUM(field3) FROM tbb GROUP BY field2
For small table it’s okay. For large table, it will take a long time.
I am using phpMyAdmin to run the query, but I have no idea when the query can be finished, or even whether or not can be finished. The browser just has no response.
What is the best way to run such queries that take a long time?
I’d suggest you to run your queries in console and then wrap them in a script you would run as a batch job in your preferred scripting language.