Skip to content

Commit

Permalink
Use linktarget
Browse files Browse the repository at this point in the history
  • Loading branch information
Huji authored May 7, 2024
1 parent 6946ddf commit b126238
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions HujiBot/weekly-slow.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,22 +789,24 @@ def main(sqlnum, maxtime):
"sqlnum": 12,
"sql": """
SELECT
pl_title,
lt_title,
COUNT(*)
FROM pagelinks
FROM linktarget
JOIN pagelinks
ON lt_id = pl_target_id
LEFT JOIN page AS p1
ON p1.page_namespace = pl_namespace
AND p1.page_title = pl_title
ON p1.page_namespace = lt_namespace
AND p1.page_title = lt_title
JOIN logging_userindex
ON pl_namespace = log_namespace
AND pl_title = log_title
ON lt_namespace = log_namespace
AND lt_title = log_title
AND log_type = 'delete'
JOIN page AS p2
ON pl_from = p2.page_id
WHERE
p1.page_id IS NULL
AND pl_namespace = 0
GROUP BY pl_title
AND lt_namespace = 0
GROUP BY lt_title
ORDER BY 2 DESC
LIMIT 1000
""",
Expand Down Expand Up @@ -1123,20 +1125,18 @@ def main(sqlnum, maxtime):
HAVING cnt = 1
) singleauth
ON page_id = rev_page
LEFT JOIN pagelinks
ON pl_title = page_title
AND pl_namespace = 4
AND pl_from <> 1171408 /* The report itself */
LEFT JOIN linktarget
ON lt_title = page_title
AND lt_namespace = 4
LEFT JOIN pagelinks
ON pl_target_id = lt_id
AND pl_from <> 1171408 /* The report itself */
LEFT JOIN templatelinks
ON tl_target_id = lt_id
WHERE
page_namespace = 4
AND page_is_redirect = 0
AND page_title NOT LIKE "اشتباه‌یاب/موارد_درست/%"
AND pl_title IS NULL
AND lt_title IS NULL
""",
"out": "وپ:گزارش دیتابیس/صفحه‌های پروژه یتیم تک‌نویسنده",
Expand Down

0 comments on commit b126238

Please sign in to comment.