SQL
x
/* ~1 second for an interval of .01%
9 seconds for .1%
5 minutes for an interval of 1%
So like 10 hours+ for the full db? :/
Gap threshold of 1e-10 gives 60 results for 1% (so 6k for full database).
*/
WITH copy AS
(
SELECT ROW_NUMBER() OVER(ORDER BY page_random) AS rownum, page_id, page_title, page_random
FROM page
WHERE page_namespace=0 AND page_is_redirect=0 AND
page_random >= 0.5 AND page_random <= 0.5001 AND -- limit to an arbitrary small subset of pages for query testing
-- exclude dab pages
NOT EXISTS (SELECT * FROM page_props WHERE page_id=pp_page AND pp_propname='disambiguation')
)
SELECT cur.page_id, cur.page_title, cur.page_random, cur.page_random - prev.page_random AS gap
FROM copy AS cur
LEFT OUTER JOIN copy AS prev ON cur.rownum = prev.rownum+1
HAVING gap < 1e-9
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.