额外“计数”查询
我注意到 Cakephp 的日志中有很多额外的计数查询。它们看起来确实没有必要,而且会减慢速度。 有人知道它们的用途和/或如何将其删除吗?
[194] => Array
(
[query] => SELECT COUNT(*) AS `count` FROM `gpx_points` AS `Point` WHERE `Point`.`id` = 81857
[affected] => 1
[numRows] => 1
[took] => 1
)
[195] => Array
(
[query] => SELECT COUNT(*) AS `count` FROM `gpx_points` AS `Point` WHERE `Point`.`id` = 81857
[affected] => 1
[numRows] => 1
[took] => 1
)
[196] => Array
(
[query] => UPDATE `gpx_points` SET `id` = 81857, `file_id` = 6, `zoom13` = '1' WHERE `gpx_points`.`id` = 81857
[affected] => 1
[numRows] => 1
[took] => 1
)
[197] => Array
(
[query] => SELECT COUNT(*) AS `count` FROM `gpx_points` AS `Point` WHERE `Point`.`id` = 71020
[affected] => 1
[numRows] => 1
[took] => 1
)
[198] => Array
(
[query] => SELECT COUNT(*) AS `count` FROM `gpx_points` AS `Point` WHERE `Point`.`id` = 71020
[affected] => 1
[numRows] => 1
[took] => 0
)
[199] => Array
(
[query] => UPDATE `gpx_points` SET `id` = 71020, `file_id` = 5, `zoom13` = '1' WHERE `gpx_points`.`id` = 71020
[affected] => 1
[numRows] => 1
[took] => 1
)
I've noticed a lot of extra count queries in my logs in Cakephp. They seem really unnecessary and slowing things down.
Does anybody know what they are for and/or how they can be removed?
[194] => Array
(
[query] => SELECT COUNT(*) AS `count` FROM `gpx_points` AS `Point` WHERE `Point`.`id` = 81857
[affected] => 1
[numRows] => 1
[took] => 1
)
[195] => Array
(
[query] => SELECT COUNT(*) AS `count` FROM `gpx_points` AS `Point` WHERE `Point`.`id` = 81857
[affected] => 1
[numRows] => 1
[took] => 1
)
[196] => Array
(
[query] => UPDATE `gpx_points` SET `id` = 81857, `file_id` = 6, `zoom13` = '1' WHERE `gpx_points`.`id` = 81857
[affected] => 1
[numRows] => 1
[took] => 1
)
[197] => Array
(
[query] => SELECT COUNT(*) AS `count` FROM `gpx_points` AS `Point` WHERE `Point`.`id` = 71020
[affected] => 1
[numRows] => 1
[took] => 1
)
[198] => Array
(
[query] => SELECT COUNT(*) AS `count` FROM `gpx_points` AS `Point` WHERE `Point`.`id` = 71020
[affected] => 1
[numRows] => 1
[took] => 0
)
[199] => Array
(
[query] => UPDATE `gpx_points` SET `id` = 71020, `file_id` = 5, `zoom13` = '1' WHERE `gpx_points`.`id` = 71020
[affected] => 1
[numRows] => 1
[took] => 1
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以临时将调试挂钩放入 Cake 内部,以查看从何处调用查询。
在顶部添加:
You can temporarily put a debug hook into the Cake internals to see where the query is being called from.
At the top add: