1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Merge the latest trunk enhancements into the begin-concurrent branch.

FossilOrigin-Name: 7407dda8b4c704cff665ba06108ea33c4099ff6446357020e5e8ecad0c86ed57
This commit is contained in:
drh
2023-07-28 18:43:28 +00:00
45 changed files with 3765 additions and 719 deletions

Binary file not shown.

View File

@@ -1,5 +1,6 @@
The files in this subdirectory are used to help measure the performance
of the SQLite JSON parser.
of the SQLite JSON functions, especially in relation to handling large
JSON inputs.
# 1.0 Prerequisites
@@ -7,6 +8,8 @@ of the SQLite JSON parser.
2. Fossil
3. tclsh
# 2.0 Setup
1. Run: "`tclsh json-generator.tcl | sqlite3 json100mb.db`" to create
@@ -14,16 +17,17 @@ of the SQLite JSON parser.
file lands in the directory from which you will run tests, not in
the test/json subdirectory of the source tree.
2. Build the baseline sqlite3.c file. ("`make sqlite3.c`")
2. Build the baseline sqlite3.c file with sqlite3.h and shell.c.
("`CFLAGS='-Os -g' make -e clean sqlite3.c`")
3. Run "`sh json-speed-check-1.sh trunk`". This creates the baseline
3. Run "`sh json-speed-check.sh trunk`". This creates the baseline
profile in "jout-trunk.txt".
# 3.0 Testing
1. Build the sqlite3.c to be tested.
1. Build the sqlite3.c (with sqlite3.h and shell.c) to be tested.
2. Run "`sh json-speed-check-1.sh x1`". The profile output will appear
2. Run "`sh json-speed-check.sh x1`". The profile output will appear
in jout-x1.txt. Substitute any label you want in place of "x1".
3. Run the script shown below in the CLI.

View File

@@ -2,3 +2,23 @@
.timer on
.param set $label 'q87'
SELECT rowid, x->>$label FROM data1 WHERE x->>$label IS NOT NULL;
CREATE TEMP TABLE t2(x JSON TEXT);
WITH RECURSIVE
c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<25000),
array1(y) AS (
SELECT json_group_array(
json_object('x',x,'y',random(),'z',hex(randomblob(50)))
)
FROM c
),
c2(n) AS (VALUES(1) UNION ALL SELECT n+1 FROM c2 WHERE n<5)
INSERT INTO t2(x)
SELECT json_object('a',n,'b',n*2,'c',y,'d',3,'e',5,'f',6) FROM array1, c2;
CREATE INDEX t2x1 ON t2(x->>'a');
CREATE INDEX t2x2 ON t2(x->>'b');
CREATE INDEX t2x3 ON t2(x->>'e');
CREATE INDEX t2x4 ON t2(x->>'f');
UPDATE t2 SET x=json_replace(x,'$.f',(x->>'f')+1);
UPDATE t2 SET x=json_set(x,'$.e',(x->>'f')-1);
UPDATE t2 SET x=json_remove(x,'$.d');