为什么从左联接视图创建视图不是很快? [英] why creating view from a left join view is not fast?
问题描述
我在表上创建了视图
他们每个人都有大约46299行
我在phpMyadmin中成功创建了它们
之后,我创建了这两个视图的连接
这本身就是一个观点.
在毫秒的mysql中我得到了Query OK, 0 rows affected (0.01 sec)
但我无法达到我的phpMyAdmin
所以我决定删除该视图
在mysql中,删除耗时约20分钟
再次我尝试了我的方式,现在我无法到达phpMyadmin
我不知道它是否正在处理中?!
我应该等多少?以及为什么mysql向我显示快速查询可以,但是phpmyAdmin是否仍在处理中
I created views on the tables
each of them had about 46299 rows
I created them successfully in phpMyadmin
after that I created a join of these two views
which itself is a view.
in mysql in a millisecond I got Query OK, 0 rows affected (0.01 sec)
but I couldn't reach my phpMyAdmin
so I decided to drop the view
in mysql it took about 20 minuets for dropping
again I tried my way and now I can't reach phpMyadmin
I don't know that it is under prcessing or not?!
how much I should wait? and why mysql show me fast query ok but phpmyAdmin is still processing if It is really under process
+-----+------+-----------------+-------+---------+------+--------------+--------
------------------------------------+
| Id | User | Host | db | Command | Time | State | Info
|
+-----+------+-----------------+-------+---------+------+--------------+--------
------------------------------------+
| 7 | root | localhost:38993 | week1 | Sleep | 2188 | | NULL
|
| 20 | root | localhost:39223 | week1 | Query | 0 | NULL | SHOW PR
OCESSLIST |
| 104 | root | localhost:39526 | NULL | Query | 800 | Sending data | SELECT
1 FROM `week1`.`alarm` LIMIT 100000 |
| 105 | root | localhost:39527 | week1 | Query | 800 | Sending data | SELECT
1 FROM `week1`.`alarm` LIMIT 100000 |
+-----+------+-----------------+-------+---------+------+--------------+--------
------------------------------------+
4 rows in set (0.00 sec)
mysql>
推荐答案
You can see if something have locked the table by issuing a SHOW PROCESSLIST
command.
这篇关于为什么从左联接视图创建视图不是很快?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!