PRAGMA journal_mode = OFF;
PRAGMA synchronous = OFF;
PRAGMA temp_store = MEMORY;

-- schema
CREATE TABLE t (
  id INTEGER PRIMARY KEY,
  s  TEXT
);

-- bulk insert via recursive CTE (~50k rows)
WITH RECURSIVE cnt(x) AS (
  SELECT 1
  UNION ALL
  SELECT x+1 FROM cnt LIMIT 50000
)
INSERT INTO t(s)
SELECT printf('str-%d-%d', x, x*x) FROM cnt;

-- simple read queries
SELECT COUNT(*) FROM t;
SELECT SUM(LENGTH(s)) FROM t;

-- point lookups
SELECT s FROM t WHERE id IN (1, 100, 1000, 10000, 40000);

-- update a slice
UPDATE t SET s = s || '-x' WHERE (id % 50) = 0;

-- final check
SELECT COUNT(*) FROM t WHERE s LIKE '%-x';

