-
-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
require "sqlite3"
DBFILE = "test.db"
db = DB.open("sqlite3://./#{DBFILE}")
while true
begin
db.scalar("select padding from foo where id=#{Random.rand(100000000)}") # size matters!
rescue DB::NoResultsError
end
endgrows beyond 32GB of RAM on my machine in a couple of minutes.
For the setup you need:
https://www.sqlite.org/src/file/ext/misc/series.c
https://www.sqlite.org/loadext.html: gcc -g -fPIC -shared series.c -o series.so
save the lines below in setup.sql, then
cat setup.sql | sqlite3 test.db
.load ./series
.header on
.timer on
drop table if exists foo;
create table foo (id int, padding text);
insert into foo (id, padding) select value, random() from generate_series(1, 100000000) order by random();
create index foo_id_ix on foo (id);I use crystal 1.1.1 on Ubuntu 18.04
Metadata
Metadata
Assignees
Labels
No labels