dan
ad23a47acd
Enhance SQLITE_SCANSTAT_NCYCLE so that it reports on virtual tables.
...
FossilOrigin-Name: 622d8eb3724bee617b55d6fb71f1a2d683db6858065adced6bf3ce9525bcd6b5
2022-12-03 21:24:26 +00:00
drh
1d8f4e6ce8
Increase the nominal row size for IPK index lookups slightly, for better
...
balance.
FossilOrigin-Name: 1a61c500add4a2bfe80c0c691d559cfca166dc5f8262651a58da7ec16a51d430
2022-12-03 19:04:09 +00:00
dan
f6f01f15dd
Add CYCLES scanstat measurement to "USE TEMP B-TREE FOR ORDER BY" lines.
...
FossilOrigin-Name: 365011ae8b7e3fcaa2c4ea9601231a3ef2223e60d7a53ec33013109dca22ad58
2022-12-03 18:16:25 +00:00
drh
e4fa4794be
Further improvements to the estimated cost of sorting. Take into account
...
the number of columns to be sorted.
FossilOrigin-Name: f3290cf83b7c02d17d85d8942954f052b486c370cd5ec732969da9061dc1d19a
2022-12-03 17:09:15 +00:00
larrybr
30cbcc0004
Cause CLI .sha3sum to warn of text fields that do not survive CAST(CAST(t as BLOB) AS TEXT) due to invalid UTF encoding.
...
FossilOrigin-Name: 123f2a0785790addf9c60a0fd09077dda9cb84d33a2594901a2b22bb555be491
2022-12-03 16:09:32 +00:00
stephan
54ac04c831
Doc typo fix for SQLITE_MAX_ALLOCATION_SIZE in malloc.c. No code changes.
...
FossilOrigin-Name: ed1ed21221b048ac5a5275cdfc4d9b2a406acdc7d4b648c3b61bcc822d88d955
2022-12-03 13:05:33 +00:00
stephan
fed255d794
Move kvvfs xRead()/xWrite() buffer from function-local stack memory to heap memory to accommodate changes in emsdk 3.1.27.
...
FossilOrigin-Name: f1da32410ca7b808b3bef5f5a59766e7281e9e6ea343c8b979599bf1fc1060f5
2022-12-03 11:51:29 +00:00
drh
1edd0a089c
Tuning the query planner by adjusting the weights that predict the relative
...
performance of sorting and index lookup.
FossilOrigin-Name: 9f2806da4d88beceac2e81e05421f00481dd3dd100b096cd2ae6c828adb42ca7
2022-12-03 00:52:21 +00:00
dan
231ff4b027
Enhance the sqlite3_stmt_scanstatus() API and add sqlite3_stmt_scanstatus_v2(). For creation of easier to read query performance reports.
...
FossilOrigin-Name: 55800833645739efeddcacef464c623931cb6aeb43f4219b4e4faf473c25c8bb
2022-12-02 20:32:22 +00:00
drh
d2603adf46
For the sqlite3_bind and sqlite3_result interfaces for UTF16 strings, round
...
the number of bytes down to the next even number, to avoid creating a UTF16
string that is an odd number of bytes.
[forum:/forumpost/411199488d065f83|Forum post 411199488d065f83].
FossilOrigin-Name: b57e3c3db00a6bc6db20c82530479f9eba7e37b731f0da6fe81682e84c7ac916
2022-12-02 17:52:52 +00:00
drh
8b5d7fda59
Use sqlite3_result_int64() instead of sqlite3_result_int() when returning
...
potentially large values from the DBSTAT virtual table, to avoid integer
overflows in the result.
[forum:/forumpost/ada2ab044f|Forum post ada2ab044f].
FossilOrigin-Name: 5652154a8c93cf3b1ff6c2e55e94abbe995b0bb625f733461df20e006c2f13f8
2022-12-02 15:31:47 +00:00
drh
85ec20ac66
Add a testcase() macro to verify that the case of a NOT NULL error message
...
hitting the string length limit.
FossilOrigin-Name: 91f50964c10fb12d889bda7d597d8edf475d97d2d8b534b4400e0fed1d753c6a
2022-11-30 21:18:23 +00:00
drh
75fba2fd28
Fix an over-zealous assert() reported by Yong Heng.
...
FossilOrigin-Name: 6ee61f8cede4998f0c838d6506b058c6b09f34b3d7f30ed296100785c93f8d00
2022-11-30 20:22:31 +00:00
drh
2a757658a0
Attempt to rationalize the bits associated with ".wheretrace". Provide
...
a decoder key in sqliteInt.h for what each bit is intended to do.
FossilOrigin-Name: 8ec361695a107a94f2cf6a7fe509656a99d85d49bd7c74133c69903f059a2675
2022-11-30 19:11:31 +00:00
drh
a42281a312
Always use nanosleep() (instead of usleep() or sleep) if the
...
_POSIX_C_SOURCE macro says it should be available.
FossilOrigin-Name: 6620c57b9d3eae7226a412318b43393196df069b5b90aae0cf1743fdd2d102dd
2022-11-30 13:44:31 +00:00
stephan
412237fba5
Merge trunk into wasi-patches branch.
...
FossilOrigin-Name: 64cf34a85505814b4c93e82855c25559c8096bb3ce38cdc5e0fb9218c6bcce32
2022-11-30 10:05:02 +00:00
drh
7741f3457a
Change the handling of hwtime.h to make it easier to compile performance
...
measurement builds that make use of hwtime.h. This should not affect
productions builds.
FossilOrigin-Name: f64a224244743ab121371abd516fccbfc93c110e0952211764bd1b217e792c1b
2022-11-29 17:52:04 +00:00
drh
d3fc2e63aa
Check-in [8d5b76593d82b3a5] contained an error that was causing some obscure
...
error codes to be lost. Fixed here.
FossilOrigin-Name: 46cdd3637d6a206ad2bcf8653cc6f2c7a886a16cc7685c45967938609941a755
2022-11-28 21:17:30 +00:00
drh
5b046dadfc
Fix harmless compiler warnings.
...
FossilOrigin-Name: 8d5b76593d82b3a57bc904ced33c24cd49369868b5dd2fe7f2c7b114f5aee2f6
2022-11-28 20:08:15 +00:00
drh
57ba01de4a
Implementation of enhancement request [695a1a53dea6b240]: The query planner
...
has improved awareness of when indexes on expressions are covering and adjusts
their costs accordingly.
FossilOrigin-Name: e3474d79b27298e96e7686e5a6f9a8e736b8a6568a0a08fb1abe5bcca038ca63
2022-11-28 19:42:48 +00:00
dan
1b3d13e65e
Add the SQLITE_FCNTL_RESET_CACHE verb. Use it to ensure that the page cache is purged before and after a the recovery extension is run.
...
FossilOrigin-Name: 6db0bc4bc0d272b610bef2aeeae43f539ed6e7cc0a9cc767d5af85ecb0019d5f
2022-11-28 18:41:41 +00:00
drh
8ffa77f3a9
Merge trunk changes into covering-index-expr branch.
...
FossilOrigin-Name: 89d775ada39aed4dc532374ace02156d07dc06e8ae54a194608af0c5a582d20f
2022-11-28 16:11:10 +00:00
drh
84606c9737
Rework the covering index checking routine, whereIsCoveringIndex(), so that
...
it can return a "maybe" result for aggregate queries where we are not exactly
sure. The index is scored as if it is covering, but the main table is
still opened.
FossilOrigin-Name: b8eec4214363192e6f3e12b3faa5810d8269a5fdaecab3ec09b02e5002cf798a
2022-11-28 15:23:53 +00:00
larrybr
d8d68a5b8e
Sync w/trunk, zap surplus space.
...
FossilOrigin-Name: b8345630a2a322234bda49ee4b996f6ba20e2b080621e229a2ec5e820892a663
2022-11-28 14:11:48 +00:00
dan
abbfa7aa17
Ensure the RETURNING clause is honoured when a row of a temp table is updated by an ON CONFLICT clause.
...
FossilOrigin-Name: a2449bcc2c71d0f4c3289621fbf1cb97f0f407c9f7b5bf18245b7854a07c6cfa
2022-11-28 13:47:27 +00:00
larrybr
c1ca183abf
Conform CLI .trace arg handling to its help.
...
FossilOrigin-Name: 31546ea320e8daa020f8a9f491718ffc3dde0e32954018afed88e8494a6aff6c
2022-11-28 02:28:44 +00:00
drh
9d34152bcf
Better reporting of when the WHERE clause analysis thinks that an index
...
is covering.
FossilOrigin-Name: 17ebcf316b91042c823eea7bb6f1309325023cb5c70538cdb2ce932caee2ef05
2022-11-26 20:52:38 +00:00
drh
217e77d240
Show which AggInfo.aCol an Expr node represents in the tree trace debugging
...
logic. Does not affect production builds.
FossilOrigin-Name: b8076f4dc55810855f668dfd4221bdb555cc78c61df200cf0cb87eb137e22850
2022-11-26 20:48:56 +00:00
drh
8beb7f56f5
Merge trunk fixes into the covering-indexed-expr branch.
...
FossilOrigin-Name: 9ac67ff968e874cf955e46e3993e3215c766feec3d5bdd38d77884eedd86b59e
2022-11-26 20:13:54 +00:00
drh
743c9ec4a5
Fix an incorrect assertion-fault in the "TREETRACE" debugging logic on
...
select.c. The problem does not affect production builds.
FossilOrigin-Name: f11bb42292d94e7b7687bd2134f72afe1353182238cb4837fc0a6d78a021dd7e
2022-11-26 20:12:02 +00:00
drh
6e71186904
Experimental changes to help the query planner detect when an expression
...
index is coverting. Works somewhat, but there are tests that fail.
FossilOrigin-Name: 968c189bcf29a9b25305251a58d09b7d52ab9dd08f5057dc3ab1f7ad1a5316a0
2022-11-26 14:19:47 +00:00
drh
902ea83925
Relax restriction (8) on the push-down optimization so that it only applies
...
if one or more columns uses a collating sequence other than BINARY.
See [forum:/forumpost/3824ced748baa808|forum post 3824ced748baa808] and
check-in [346a3b12b861ce7b].
FossilOrigin-Name: adbca3448e2099f0d6149a073978f230ed9a92a2f384779879ef89e672231bcf
2022-11-25 17:05:55 +00:00
drh
49d400b091
Fix #ifdefs so that restrictions (8) and (9) of the push-down optimization
...
are still enforced even if compiled with SQLITE_OMIT_WINDOWFUNC. This
fixes a bug introduced by check-in [346a3b12b861ce7b].
FossilOrigin-Name: 09e1e42e0ff26f9a71cbd128169f060a66425828d637bf8f781490ca38d99103
2022-11-25 16:32:59 +00:00
drh
ae5cfda656
Immprove the query planner such that it is able to make use of indexed
...
expressions within an aggregate query with GROUP BY. This implements
enhancement request [99378177930f87bd].
FossilOrigin-Name: b9190d3da70c41717eb188474fd225ee43d0b46646e1b03de5967bd332553870
2022-11-25 16:10:48 +00:00
drh
23f61a4ba8
Add restriction (9) to the push-down optimization: If the subquery is
...
a compound then all arms of the compound must have the same affinity.
dbsqlfuzz 3a548de406a50e896c1bf7142692d35d339d697f.
FossilOrigin-Name: 1ad41840c5e0fa702ba2c0df77a3ea126bd695b910b5d1271fa3129c38c58f5f
2022-11-25 15:52:00 +00:00
drh
bedbb1bfab
Remove a redundant assert() statement.
...
FossilOrigin-Name: e3e1b453dc47884ddc9e51c4302fa2f4d40bca3d69ac7c13d8e2ae1adc81ac56
2022-11-25 13:26:51 +00:00
drh
f5d0656f16
Improve the robustness of the updateAccumulator() routine against OOM.
...
FossilOrigin-Name: d2844f577b69fdc16a0a2568c0958fc3d8aff33e9a0ef80e0f58e92f01097432
2022-11-25 13:15:48 +00:00
drh
7960da0346
Improved comments. Add assert()s to verify that the AggInfo structure
...
is unchanged after registers have been assigned.
FossilOrigin-Name: 5200b84195ee1ccaa387f7032eae3d463724c48cb53ba0251bbc79e927dd9752
2022-11-25 13:08:20 +00:00
drh
8683c09281
Correctly deal with IF-NULL-ROW operators when dealing with
...
indexed expressions in aggregates.
FossilOrigin-Name: 939cb47025354e2df047de7654c0b06f791957cfe4e904abe8892207cea90215
2022-11-24 23:35:27 +00:00
larrybr
472de149ae
Speed up base85() conversions and sync w/trunk.
...
FossilOrigin-Name: 17b823500a2ed135c1f40aa7f4d87ba5b2eab35c0abd9e0856041cf0f510cbee
2022-11-24 20:11:34 +00:00
drh
e644f7c24b
Take care not to try to add comments to a TK_AGG_COLUMN opcode that does
...
not have an associated Table object because it is a reference to an indexed
expression.
FossilOrigin-Name: 5fc23863e4a6388884ce061cd69546757b4c39d731bbb58a8121b92fd5144f7b
2022-11-24 19:02:40 +00:00
drh
594357f2e1
Change a NEVER() into an assert().
...
FossilOrigin-Name: a0fd44f4e5a0ec83465203a0009f307ca50223833575895a3ebf8a289515714f
2022-11-24 18:45:56 +00:00
drh
c25f5ea6e8
Add NEVER() and ALWAYS() macros on branches that are believed to be
...
unreachable.
FossilOrigin-Name: 3a901e88c87fc76c7fe42e47a976a5706830f0dbd6027605663e4d55f4f33590
2022-11-24 15:04:23 +00:00
drh
b669bb5e2b
New test cases. Fix the logic so that it works for GROUP BY aggregates
...
that do not require sorting.
FossilOrigin-Name: ef6ebe7922f56c1584a005deedc85ca1070b4fe5082ada8bbf8d06df54f1c9ef
2022-11-24 13:19:25 +00:00
drh
4b1555a9fc
Merge the latest trunk changes into the agg-with-indexed-expr branch to
...
simplify diffs.
FossilOrigin-Name: 38c3d3f1ed0fd2bb62aa8a7e5a27f2b247123e094e2fdb0a2475d788c3dfbc04
2022-11-24 01:41:44 +00:00
drh
9b80cb5f39
Add explanatory comment to the new optimization. And add a test case.
...
FossilOrigin-Name: e6c20f61de7d048eee65c8e74a3eb36760ab9747ebd1ab50e49642b777c10306
2022-11-24 01:40:20 +00:00
drh
2e30d95fb6
Aggregates with GROUP BY now make use of expressions on indexes. This code
...
works and gets the correct answer for the test case in the ticket. Lots more
testing and documentation is needed, however.
FossilOrigin-Name: 8dcf9f2031c16f296d187fe876d4204c71fc96fec120984ff11b6d8b03d58a5f
2022-11-23 18:51:04 +00:00
drh
590f013a87
This attempt at modifying AggInfo to make use of indexed expressions does not
...
work. It gets an incorrect answer for the test case shown in the ticket.
FossilOrigin-Name: 84c06023f4a1606664fdb9811312603b31f7c94a43d0e443ba7dde7fdba029e3
2022-11-23 17:56:00 +00:00
dan
c32e16643d
Update Makefile.in to include new target "sqlite3r.c". For generating "sqlite3r.c" and "sqlite3r.h", versions of the amalgamation that include the recover extension. To build the shell tool against these files, add -DSQLITE_HAVE_SQLITE3R.
...
FossilOrigin-Name: 5f135575b923cb59947667071c6af9ff14063c933cedf37d6c2a0a1b86c85032
2022-11-23 16:08:49 +00:00
drh
c6138e970e
Further foundation prep work prior to starting to flesh-out the
...
optimizeAggregateUseOfIndexedExpr() routine.
FossilOrigin-Name: 23145fe999ff74d787a3999baedd4ffe755c5f1f1275082ed0338ba637ecc56e
2022-11-23 14:13:39 +00:00