dan [Mon, 7 Aug 2023 17:09:25 +0000 (17:09 +0000)]
Enhance sqlite3_vtab_nochange() so that it works with "UPDATE ... FROM ..." statements. Use this to allow some updates on fts5 contentless-delete tables.
dan [Mon, 7 Aug 2023 16:15:56 +0000 (16:15 +0000)]
Changes so that sqlite3_vtab_nochange() works with "UPDATE ... FROM...". Use this to allow UPDATE on a contentless fts5 table if new values are supplied for all indexed columns.
stephan [Mon, 7 Aug 2023 09:44:00 +0000 (09:44 +0000)]
Rename fts5_api pContext parameters to pUserData, per /chat discussion. This is a cosmetic change made to reduce confusion between those parameters and the two other context-type parameters in that API.
stephan [Fri, 4 Aug 2023 16:01:55 +0000 (16:01 +0000)]
In the opfs-sahpool VFS's importDb() and exportFile() methods, throw if the actually-wrote/read amounts differ from the expected-to-write/read amounts, per feedback in [forum:a4122e986f|forum post a4122e986f].
drh [Fri, 4 Aug 2023 13:19:11 +0000 (13:19 +0000)]
Fix a bug in the jsonLookup() routine used to search JSON. Bug was
introduced by the recent (unreleased) JSON caching enhancements
check-in [a4c1af616e672a0d] merged into trunk at [df099ad713011b67].
stephan [Fri, 4 Aug 2023 08:45:25 +0000 (08:45 +0000)]
Resolve the timing/ordering issue of a JS-to-WASM-converted xDestroy() function being uninstalled from WASM right before the underlying native call tries to call it. This has been a long-unnoticed bug which appears only when removing such functions or replacing them.
drh [Thu, 3 Aug 2023 13:07:58 +0000 (13:07 +0000)]
Fix a test case whose value changes under the no_optimization permutation
due to the recent change to add the ability for SQLITE_TESTCTRL_OPTIMIZATION
to disable one-pass.
drh [Thu, 3 Aug 2023 12:41:30 +0000 (12:41 +0000)]
Unix builds now assume the presence of nanosleep() in the standard library.
The -DHAVE_NANOSLEEP=0 compile-time option can be used to build on systems
(if any still exist) where this is not the case.
drh [Wed, 2 Aug 2023 13:29:01 +0000 (13:29 +0000)]
Remove a condition from query flattening that is now taken care of by
the caller. Factor out the reverse_unordered_selects processing from the
main loop of sqlite3WhereBegin() for performance.
drh [Wed, 2 Aug 2023 12:39:56 +0000 (12:39 +0000)]
Simplify the select.c logic that enforces the optimization fence around
a MATERIALIZED common table expression. Do not allow the
reverse_unordered_selects setting to affect a fenced CTE that itself has
an ORDER BY clause.
drh [Wed, 2 Aug 2023 11:06:27 +0000 (11:06 +0000)]
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.
drh [Wed, 2 Aug 2023 00:09:15 +0000 (00:09 +0000)]
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.
drh [Tue, 1 Aug 2023 00:34:03 +0000 (00:34 +0000)]
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].
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.
Enhancements to the JSON performance testing scripts and instructions to
cover the recent optimizations involving updates to large JSON strings
that indexed.
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.
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.
stephan [Wed, 26 Jul 2023 11:41:41 +0000 (11:41 +0000)]
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.
stephan [Wed, 26 Jul 2023 11:11:39 +0000 (11:11 +0000)]
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.
Add the concept of an RCStr string - a "Reference Counted String". Use
these to keep track of big JSON strings that might need to be used in
multiple places at the same time with different lifetimes. Add two
different JSON string values to each parse - one with and one without
changes. The net result is a large reduction in the number of parses
that occur when doing an UPDATE of a indexed JSON field using
json_replace() or similar.
Add the JsonParse.zAlt field to old revised JSON text after a change.
Demonstrate that this elminates the need for reparsing after a change
by using it in the json_remove() function. This is an incremental check-in
containing lots of cruft.
dan [Mon, 24 Jul 2023 19:13:06 +0000 (19:13 +0000)]
Add the fts5 'delete-automerge' integer option. A level is eligible for auto-merging if it has a greater than or equal percentage of its entries deleted by tombstones than the 'delete-automerge' option. Default value is 10.
stephan [Sun, 23 Jul 2023 22:14:41 +0000 (22:14 +0000)]
When writing the filename header in a opfs-sahpool file, ensure that all remaining bytes in that part of the header are zeroed out to avoid the downstream problems reported in [forum:d50ec48a293988a5|forum post d50ec48a293988a5].