MySql copy profiling data to table
I want to copy profiling data to a table I create in MySql. I want the table to contain the exact data that I get from the command SHOW PROFILES;
For example, if I have this:
mysql> show profiles;
+----------+------------+--------------------------------+
| Query_ID | Duration | Query |
+----------+------------+--------------------------------+
| 16 | 0.00059700 | select * from imprumuturi |
| 17 | 0.00042050 | select * from imprumuturi |
| 18 | 0.00042000 | select * from imprumuturi |
| 19 | 0.00042950 | select * from imprumuturi |
| 20 | 0.00048050 | select * from imprumuturi |
+----------+------------+--------------------------------+
5 rows in set (0.00 sec)
I will create a table that has 3 columns (queryid,duration and query), and I need a command that will copy those 5 rows from "SHOW PROFILES;" to my table.
insert into table (show profiles);
does not work
I need it to be done in M开发者_高级运维ySql alone, no other tools/patches.
INSERT INTO t (SELECT some columns FROM INFORMATION_SCHEMA.PROFILING)
insert into t (select * from information_schema.profiling)
精彩评论