Created
October 12, 2021 10:19
-
-
Save saswata-dutta/d22ddc1272cd250b2f68eb62db049bd2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table scores(id smallint primary key, score smallint not null); | |
CREATE INDEX score_idx ON scores (score); | |
WITH RECURSIVE | |
cnt(x) AS ( | |
SELECT 1 | |
UNION ALL | |
SELECT x+1 FROM cnt | |
LIMIT 10000 | |
) | |
insert into scores(id, score) select x, random() from cnt; | |
select count(*) from scores where score <= 2673474448148295663; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment