Commit Graph

26412 Commits

Author SHA1 Message Date
drh
5e82c06cf8 Never flatten a CTE that is labeled MATERIALIZED. This is really something
of a bug fix because the documentation says that a MATERIALIZED CTE is an
optimization barrier.

FossilOrigin-Name: b7ef9796f548ce43e06673f86bbec68157aae5e4ee8451e1d87ee5f70af1bb27
2023-08-02 11:06:27 +00:00
drh
4178849736 When a query is inside an AS MATERIALIZED CTE, do not attempt the
omit-ORDER-BY optimization.  If the developer specifies MATERIALIZED,
that means he wants the sort to actually happen.

FossilOrigin-Name: aa769ee7477171f26a091cadff98aa4f48da7752ade20b405a95c4525456f62e
2023-08-02 00:09:15 +00:00
drh
cbaef88980 Avoid ASAN warnings when converting over-sized long double values into double.
FossilOrigin-Name: e989a37ff9d5b52e0090d59be077ad2260c8df5d4c2c2d8088b1160de64dffd4
2023-08-01 19:10:30 +00:00
stephan
2877c43e6c Filter the wasmfs-specific JS module result type check out of non-wasmfs builds.
FossilOrigin-Name: ef7c121049f77200ecc4da260a90776264af0e84122d0133b4986959aedc653a
2023-08-01 16:41:12 +00:00
stephan
887f6e5082 Fix part 2 of 2 for /fiddle: a make deps problem which caused fiddle to load but fail to run when sqlite3.c was missing.
FossilOrigin-Name: 6011bc26764760af750de68f1553f45382766dd2195633ae267bdb4f9ac75d0f
2023-08-01 16:38:08 +00:00
stephan
a08d363f67 Fix part 1 of 2 for /fiddle not running: build flags which were renamed during refactoring.
FossilOrigin-Name: 214ffeeff77997c3352d30aaa6e51e2dea9706f0d08f73f4eacfad1864817fc6
2023-08-01 16:17:00 +00:00
dan
c1a07d3bab Fix an assert() in fts5_index.c that might fail when dealing with corrupt records.
FossilOrigin-Name: aa55c83f35c2ab134e0842201e46e021079283f9c65595c86664060b3aa8d715
2023-08-01 11:03:06 +00:00
drh
b9894f88b8 Remove redundant comparison operator.
FossilOrigin-Name: 018984329892c243b21adb10aa8efc7f49313ecf80477e6b61dc6365f62c489d
2023-08-01 01:07:45 +00:00
drh
d192b4441d Restore part of the UPDATE one-pass optimization that was removed by
check-in [2c56b984a0bd3be5]: only disable one-pass if the WHERE clause
contains a subquery.  Allow subqueries in the SET expressions.
Fix for performance problem reported by
[forum:/forumpost/8ab195fd44e75ed0|forum  post 8ab195fd44e75ed0].

FossilOrigin-Name: 42916af9fc0f379a608a08db894400bd735a28e26ab1ffd604d1fddfbdb3ec0c
2023-08-01 00:34:03 +00:00
drh
00d635dda4 Restrict the new column cache to table-btree, which is the common case anyhow.
That way, writes to indexes do not need to clear the column cache.

FossilOrigin-Name: 659284ab0e22a4746c1337b3489e7b166d497fb7e5301e24dc115d2b0c4e097d
2023-07-31 22:03:24 +00:00
drh
98ab970bac The original column-cache implementation from check-in [ab1edcc7fedcf279]
(merged to trunk at [771fe35074b50b8d]) is unsound.  This check-in fixes
the issue.  Had to give back a little performance, the optimization is still
a overall win.

FossilOrigin-Name: ec95e970fb737adf0fab3cb4363040b036949e5eb966fc2d030a20f95e2bde60
2023-07-31 20:02:11 +00:00
drh
1f097a2f29 Add bit to sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS) that will
disable the one-pass optimizating in DELETE and UPDATE.

FossilOrigin-Name: 22f6dd5cd32ed9e7b932fdba98aa8652fde999df79f4995d3d8ac1acf430cf53
2023-07-31 17:39:36 +00:00
drh
c8c6763782 Improved debug tracking of the Parse.nQueryLoop value.
FossilOrigin-Name: 4a8a17498ecaccca5e5aab65d4596cbca9799547f50683237d08c1fa3556f1cf
2023-07-31 17:20:12 +00:00
stephan
f0c701c410 Add tests for SAHPoolUtil.exportFile() and importDb().
FossilOrigin-Name: 4aa88b8fb1c99137ed7531e5c82a241738a2b0554f7af82c0ed0ce8d16a0879a
2023-07-30 03:54:10 +00:00
drh
b47e1c7866 Do not try to add MEM_Term to an MEM_Static string either.
FossilOrigin-Name: 8920dcef1f75f578e3f274ab2b980a83d6ea6b761d99fc48410b26886170597b
2023-07-29 22:58:47 +00:00
drh
e809d84618 Do not try to apply MEM_Term to a MEM_Ephem strings.
FossilOrigin-Name: 2a378a66783ce4d749f7e1e7d08d8404a4aa78d47aeeefd6794b6753188438f6
2023-07-29 21:22:26 +00:00
dan
808cf29b55 Fix a buffer overread in the fts5_structure virtual table (test code).
FossilOrigin-Name: b837aff79cd159061b46af59eaf96a1a1920eeece27e9e27931cf3387068d96a
2023-07-29 20:13:19 +00:00
drh
fb546c0bf4 Simplification to the sqlite3_stmt_explain() implementation.
FossilOrigin-Name: dd5eb4c7f71c658aff8c2f11ff163c5e79f0ebfd49fd13ca8e28381fe63cc82f
2023-07-29 17:05:35 +00:00
stephan
5d800cdb6e SAHPoolUtil.importDb() now accepts either a byte array or ArrayBuffer.
FossilOrigin-Name: 3848f04e542e2f0f8975e82632af598aac3b60312bd244b0472f7ddf1dda77df
2023-07-29 15:53:53 +00:00
drh
0c6b869263 Enhancements to the new sqlite3_stmt_explain() interface implementation and
documentation.

FossilOrigin-Name: dc98ac6b6de27fc096a715e650067154a545709cf1eecd6c2722ab30a91c2d1d
2023-07-29 15:31:48 +00:00
larrybr
104e225074 Fix doc error noted in [forum:/forumpost/11fc7308d5e607f2|the forum] and a misspelling.
FossilOrigin-Name: 6b79cc7dd07d41da6034386b39c0dff32f80a977db42a9602330ffd15706ab9b
2023-07-28 21:38:50 +00:00
drh
3e053c50b4 Do not allow the same JSON parse to be input to both arguments to the
json_patch() routine.

FossilOrigin-Name: 8e781c6742792b3899ca60efc49c7eaee1df9f6b03d27c254b0e148b82946e19
2023-07-28 20:59:25 +00:00
drh
58b5921ca4 Add the sqlite3_stmt_explain() API.
FossilOrigin-Name: 0443c0ef85f8f6f3efdee68bf59126c9459f08a58458756f8cbeeaf043d43a86
2023-07-28 18:37:13 +00:00
drh
58bf53d573 Minor tweaks to the JSON performance measurement documentation.
FossilOrigin-Name: 0bed957e46aa3bf6a70292ae100de0459486c1469dd03de61207a708cc59a594
2023-07-28 16:12:39 +00:00
drh
8a056d486f Enhancements to the JSON performance testing scripts and instructions to
cover the recent optimizations involving updates to large JSON strings
that indexed.

FossilOrigin-Name: f9213289d09adfb0461d9644e80c7e889f4bae51563ae2e575a2c95336052bcb
2023-07-28 14:20:31 +00:00
drh
859dd4fc2f JSON performance improvements: (1) Add a cache for large string values
on OP_Column to avoid having to extract the string multiple times.
(2) Internal JSON caching improvements.

FossilOrigin-Name: 771fe35074b50b8d4a6583e61c53871b2445f7a58c82f3fc3bf6776e562e63af
2023-07-28 13:52:08 +00:00
stephan
ab12b750de Correct a recently-introduced falsehood in ext/wasm/README.md regarding ssh port forwarding.
FossilOrigin-Name: 2a3f3a9cf28849c99d83c256f813405a2f47f84532e1192d67bb7aa655dd98a3
2023-07-28 11:52:58 +00:00
drh
b1926192fa Mark an unreachable branch as ALWAYS().
FossilOrigin-Name: 8fd06d1151c521515d9f7181575a04e451b522335135a27248052b067d4005ae
2023-07-28 11:30:07 +00:00
drh
93269a9e41 Remove some unnecessary and incorrect code that was mistakenly added in the
previous check-in.

FossilOrigin-Name: d3f458dcc379dd7648262f52579ec55ba931852065ed278367a0629228d0ed45
2023-07-28 00:54:38 +00:00
drh
caf7e26c4f Switch to using jsonParseCached() for json_patch().
FossilOrigin-Name: 2ed9c59e6a51037e63485d0a92dae25443116beddfca1ac73d2f5d5be38d4ad3
2023-07-27 23:51:36 +00:00
drh
6bc4baf313 If the input JSON to a json function that uses cache comes from an RCStr
value, then use that RCStr value in the parse rather than making a copy.

FossilOrigin-Name: 509ae9c1470dd79d320e84371e1e6662fb85fa0571df5ed8c4d946d10cdfe821
2023-07-27 20:28:29 +00:00
dan
ea6bccaa44 Fix a couple of compiler warnings in fts5_index.c.
FossilOrigin-Name: bf71faa2a1d29ea762c4d2485522d6f4f8a5a7166981a92d3ba9c96ccbbe1213
2023-07-27 20:08:44 +00:00
drh
594f5e24c4 The OP_Column opcode caches large column values coming from overflow pages.
FossilOrigin-Name: ab1edcc7fedcf27922d5db4bc1bc673b1495ca9c66eb6debdda7b7776c068888
2023-07-27 19:39:53 +00:00
dan
9cf8961557 Add the contentless_delete=1 option to fts5. For creating contentless tables that support DELETE and REPLACE statements.
FossilOrigin-Name: d66b182d2bc6ce0772e69401b7affe1adbc1b128c4631cb3c17f98dde72af00a
2023-07-27 19:13:35 +00:00
drh
95daf355a7 Merge trunk enhancements into the json-opt branch.
FossilOrigin-Name: 5739a16ad270a5aadcbb46b28c34fa6ba975422788dcbccb1a8e0d1e6ed75144
2023-07-27 18:19:46 +00:00
stephan
9fcca3d27c Dynamically determine whether the wasm.xWrap() argc check can be applied, depending on how the wasm environment exposes its exports.
FossilOrigin-Name: fd59226b34fffb1479fb2d7bd7c0aff982aa4a1a73e6c0d81de6eaf9c075998c
2023-07-27 17:50:10 +00:00
stephan
4cfd54256d Accommodate a breaking change in emcc 3.1.44.
FossilOrigin-Name: 2c5dd34199f5bcf729be814b8b46d9997821fe3a39ab12779c93df1bb2fd108d
2023-07-27 01:38:19 +00:00
drh
93853a4846 Fix a performance regression in JSON associated with generating small
snippets of JSON from a larger JSON string.

FossilOrigin-Name: 837f2907e10b026f6db1ca2d44b4bf60a6f069bf534bf369ad9b5c513cb0c6e4
2023-07-27 00:21:59 +00:00
drh
e94e132994 Reduce the number of memory allocations when parsing JSON.
FossilOrigin-Name: 9edd67162113df57dae21d4683f9495611e2cf4717c6d12f5b7b8e44156d5fe3
2023-07-26 23:22:32 +00:00
drh
f7a164f345 Minor changes to make coverage testing easier.
FossilOrigin-Name: ec8b43382e5402e15d9f2dda3cf21ac8be8c1589ddbe6c9433c33eef0036f764
2023-07-26 21:53:09 +00:00
drh
3f3dc2f5d8 Change a switch() case to default for coverage.
FossilOrigin-Name: 04f497074b9210326030f36107a43d6490a2a59c8a574e2c5429cd9bde681bf7
2023-07-26 19:22:43 +00:00
drh
beb3fb6904 Make sure jsonReplaceNode() always leaves the JsonParse in a consistent state even if an error is encountered.
FossilOrigin-Name: 01d52232dd6fbd253e77419a17df3df83d49434792d288ef96e14739a89cef3b
2023-07-26 19:11:47 +00:00
dan
5028dd89ab Add the ".scanstats vm" command to the shell tool. For profiling VM code in SQLITE_ENABLE_STMT_SCANSTATUS builds.
FossilOrigin-Name: 0cbec3990d4101142bfb831f8e6527b73baabebbd30fa7f59275b217dbce6a8d
2023-07-26 17:51:05 +00:00
dan
a1016b4275 Improve the output when ".scanstats vm" is enabled.
FossilOrigin-Name: 7df08fd35e9d4bc471aa9fbc4c81d2ebcfd2be6c4c38143342b3d9d727c9df22
2023-07-26 16:41:23 +00:00
drh
9095063e14 Improved caching and reuse of JSON parses.
FossilOrigin-Name: df099ad713011b67b09cb1e5f0fa2e6b45f9cee0ce9d3c118c5dbca3563d20a5
2023-07-26 14:18:06 +00:00
drh
7286c59896 Change the debugging "json_parse(X)" function so that it shows a more
complete description of the JsonParse object on standard output and returns
the mimified JSON.  Former behavior was to return the text of a decode
of the aNode array.

FossilOrigin-Name: 1bf85d4e388714a88f8940dcdec353c3e0267456697eff6963d34637912aecc9
2023-07-26 13:17:43 +00:00
drh
2b57197066 More comment improvements in json.c. Do not run jsonLookup() following
an OOM error.

FossilOrigin-Name: cd5fda8c2e354da7458b7c1a82ff18c5946f8dab16095bb0293bec57f6804f17
2023-07-26 11:53:14 +00:00
drh
7725370ff4 Improved comments and other cleanup for the changes on this branch.
FossilOrigin-Name: bac953a80d1a541e7a12aef00c86c002133859237143ad670b39ea19799a8900
2023-07-26 11:43:39 +00:00
stephan
8c7ee455ff Remove the batch SQL runner from the JS build's 'all' target, as it's long-since unused and adds noticable build time. Add makefile comments about JSPI.
FossilOrigin-Name: b8f708e35d4fa027d12089ac7c5589c36da5f68b98cf9792bb11276bf233a860
2023-07-26 11:41:41 +00:00
stephan
aef4fbf203 Add SAHPoolUtil.getFileNames() method, and tests for it, per [forum:a3da1e34d8|forum feedback]. Add a test to demonstrate that two SAH pools can coexist so long as they have different names.
FossilOrigin-Name: 72dc3f8c3255186ec412412b685b0b51ddcd08240f2353ac742fc7da8c23568e
2023-07-26 11:11:39 +00:00