Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report columns used by INSERT queries, but not referenced by SELECTs #125

Open
macbre opened this issue Feb 19, 2018 · 0 comments
Open

Report columns used by INSERT queries, but not referenced by SELECTs #125

macbre opened this issue Feb 19, 2018 · 0 comments
Labels

Comments

@macbre
Copy link
Owner

macbre commented Feb 19, 2018

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

@macbre macbre added the linters label Feb 19, 2018
@macbre macbre added this to the v1.1 milestone Feb 19, 2018
@macbre macbre changed the title Report column used by insert queries but not referenced by selects Report column used by insert queries, but not referenced by selects Feb 19, 2018
@macbre macbre changed the title Report column used by insert queries, but not referenced by selects Report columns used by INSERT queries, but not referenced by SELECTs Feb 19, 2018
@macbre macbre modified the milestones: v1.1, v1.2 Feb 19, 2018
@macbre macbre removed this from the v1.2 milestone Mar 16, 2018
@macbre macbre added this to the v1.3 milestone Mar 25, 2018
@macbre macbre removed this from the v1.3 milestone Aug 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant