Report columns used by INSERT queries, but not referenced by SELECTs
macbre opened this issue · 0 comments
macbre commented
VoteHelper::isVoted 54.47% [ap] db:local | SELECT count(*) as cnt FROM `page_vote` WHERE article_id = X AND user_id = X LIMIT N
VoteHelper::getVoteCount 45.40% [ap] db:local | SELECT count(*) as cnt FROM `page_vote` LEFT JOIN `ipblocks` ON ((user_id = ipb_user)) WHERE (ifnull(ipb_expiry, N) != X) AND (ifnull(ipb_expiry, N) < N) AND article_id = X ORDER BY time desc LIMIT N
VoteHelper::addVote 0.09% [ap] db:local | INSERT INTO `page_vote` (article_id,ip,user_id,unique_id,time,vote) VALUES (X,X,X,X,X,X)
VoteHelper::getVotersList 0.02% [ap] db:local | SELECT user_id FROM `page_vote` LEFT JOIN `ipblocks` ON ((user_id = ipb_user)) WHERE (ifnull(ipb_expiry, N) != X) AND (ifnull(ipb_expiry, N) < N) AND article_id = X ORDER BY time desc LIMIT N
CREATE TABLE `page_vote` (
`article_id` int(8) unsigned NOT NULL,
`user_id` int(5) unsigned NOT NULL,
`vote` int(2) NOT NULL,
`ip` varchar(32) NOT NULL,
`time` datetime NOT NULL,
`unique_id` varchar(32) DEFAULT NULL,
KEY `user_id` (`user_id`,`article_id`),
KEY `article_id` (`article_id`),
KEY `unique_vote` (`unique_id`,`article_id`)
) ENGINE=InnoDB
See Wikia/app#14824 / https://medium.com/legacy-systems-diary/dealing-with-a-rotten-banana-7c9492c155d5