drh
d6176c4131
Simplification to the insertCell() routine in btree.c, resulting in a
...
performance boost and a very small size decrease. It turns out that the
extra work involved in sometimes avoiding an memcpy() of the first four bytes
of a record takes more time than just unconditionally copying those
four bytes.
FossilOrigin-Name: 66de15580d3c289601e67debfe1edee286f4db5f
2014-10-11 17:22:55 +00:00
dan
33ea486603
Change the balance_nonroot() routine to reduce the amount of memcpy work that takes place. This is a work in progress.
...
FossilOrigin-Name: 29304499ea4b72dbb6701e10cc19b5d41f7e5ac9
2014-10-09 19:35:37 +00:00
dan
9501a64516
Avoid ever writing before the start of an allocated buffer in the DIRECT_OVERFLOW_READ code. Fix for [e3a290961a6].
...
FossilOrigin-Name: c3c15d20c6913811956a5041c959a56ca4eeb5eb
2014-10-01 12:01:10 +00:00
drh
7682a476f6
Ensure that the OP_Prev opcode verifies that content has not been deleted
...
out from under the cursor. Fix for ticket [209d31e3161b9e9ff].
FossilOrigin-Name: 414f0d6a647a4d040b5463c73c5e15e699d85b4c
2014-09-29 15:00:28 +00:00
drh
588400b861
Reduce the amount of memcpy() required by defragmentPage().
...
FossilOrigin-Name: 3edab9957cc7bb90b52fd40b02613c2cb03fc166
2014-09-27 05:00:25 +00:00
drh
867db83159
Fix the "PRAGMA integrity_check" command so that it avoids formatting error
...
message context messages until it actually needs to generate an error message.
This avoids much formatting, and hence greatly improves the performance of
"PRAGMA integrity_check" in the common case when there are no errors. It also
makes the code a little smaller.
FossilOrigin-Name: 83913515830aa850f9e38406f9422d7e88dcab66
2014-09-26 02:41:05 +00:00
drh
3fbb022b98
Have each open database allocate its pTmpSpace when the first write cursor
...
is opened, rather than on each insert or delete, for a small space savings
and performance boost.
FossilOrigin-Name: 99323552c001bc9173eb2a44542234c8ef7a9845
2014-09-24 19:47:27 +00:00
drh
b2325b72df
Small performance and size optimization for btreeUnlockIfUnused().
...
FossilOrigin-Name: 13c746f85d254475b10c3dd58555acd3bbead0ce
2014-09-24 18:31:07 +00:00
drh
9bfdc25062
Have the clearCell() routine return the cell size to the caller, rather
...
than have the caller make a separate call to cellSizePtr().
FossilOrigin-Name: f21d217583c205dc17f98bb4877fd4ed98cefcb1
2014-09-24 02:05:41 +00:00
drh
3f3874030c
Shorten all lines of source code in btree.c to at most 80 characters.
...
No logical changes.
FossilOrigin-Name: 5dd41cdbfebdd088ebd9a90a394ee296c207ad90
2014-09-24 01:23:00 +00:00
drh
3e28ff5cb5
Add the MemPage.noPayload boolean and use it to help
...
cellSizePtr() and btreeParseCellPtr() run faster.
FossilOrigin-Name: 8e3375313ebbf26b68561f3ed31d2a488222e5d0
2014-09-24 00:59:08 +00:00
drh
c46838309c
Remove an unused C-preprocessor macro. No functional changes to the code.
...
FossilOrigin-Name: f480582ccae0e9a917d4523191025bd16016ba64
2014-09-23 23:12:53 +00:00
drh
6200c88123
Avoid calling btreeParseCellPtr() from within fillInCell() since most of
...
what btreeParseCellPtr() computes is ignored by fillInCell(). Instead, have
fillInCell() compute the values it needs inline. Performance improvement.
FossilOrigin-Name: 4147f6671e3faa8ddffab8387a6c7d9b5b962fc8
2014-09-23 22:36:25 +00:00
drh
ab1cc58b70
Simplify the CellInfo structure for a size reduction and performance
...
improvement.
FossilOrigin-Name: bf59df66b3613c38cfb13a68091b8328ebb22c78
2014-09-23 21:25:19 +00:00
drh
a4bb5b0726
Fix to payload size overflow detection in the cellSizePtr() change of
...
the previous check-in.
FossilOrigin-Name: 7609744014c6a84a8379794a0351a2e9626ec86b
2014-09-22 20:38:10 +00:00
drh
dc41d60aaa
Size reduction and substantial performance increase for cellSizePtr().
...
FossilOrigin-Name: bc8bbf3207288d160287519c3b7123997996b440
2014-09-22 19:51:35 +00:00
drh
75179ded97
Reduce the number of arguments to RecordCompare functions from 4 to 3,
...
resulting in a small performance increase.
FossilOrigin-Name: 8239c35aedd583af79505378bb7dbb78346a3f45
2014-09-16 14:37:35 +00:00
drh
da4ca9d19c
Add new APIs that take 64-bit length parameters:
...
sqlite3_malloc64(),
sqlite3_realloc64(),
sqlite3_bind_blob64(),
sqlite3_bind_texte64(),
sqlite3_result_blob64(),
and sqlite3_result_texte64().
Internal memory allocation routines also now use 64-bit unsigned length
parameters for safety.
Also add the sqlite3_msize() interface.
Fix the sqlite3_get_table() to use sqlite3_realloc64() to avoid a
integer overflow problem.
FossilOrigin-Name: 94954850cf2e1ec0b7f590c7f46cdc54c72558ce
2014-09-09 17:27:35 +00:00
peter.d.reid
60ec914c74
Fix typos in comments. No code changes.
...
FossilOrigin-Name: e62aab5e9290503869e1f4d5e0fefd2b4dee0a69
2014-09-06 16:39:46 +00:00
drh
0f8f26716c
Add support for using separate worker threads to speed large sorts.
...
The SQLITE_MAX_WORKER_THREADS and SQLITE_DEFAULT_WORKER_THREADS compile-time
options and the SQLITE_LIMIT_WORKER_THREADS argument to
sqlite3_limit() and the "PRAGMA threads=N" pragma are added.
FossilOrigin-Name: b1c0f0bc1bd8a3477cd7a7ab510f0442ac88b517
2014-09-01 17:36:46 +00:00
drh
ee6438df0b
Micro-optimizations in sqlite3BtreeNext() and sqlite3BtreePrevious().
...
FossilOrigin-Name: 839c7996eecd5480152c514555b9aa1121a69ce0
2014-09-01 13:29:32 +00:00
drh
4d015c6902
Merge the recent performance enhancements implemented on trunk into the
...
threads branch.
FossilOrigin-Name: dfdc900f5d1a31ee5c5f35a630c4a8253e69093b
2014-08-25 13:27:02 +00:00
drh
3bdffddc41
Fix a variable-declaration after code problem in btree.c. Harmless in
...
GCC and CLANG but unacceptable for MSVC.
FossilOrigin-Name: 45abd5c0bad2847861f3b26a7040490aa9bb1332
2014-08-23 19:08:09 +00:00
drh
6848dad894
Another performance tweak: Split the sqlite3BtreeCursorHasMoved() routine
...
into two with the second routine named sqlite3BtreeCursorRestore(). The first
now only reports whether or not the cursor has moved and the second tries to
restore the cursor. This allows the sqlite3VdbeCursorMoveto() routine to be
refactored to avoid stack pointer movements, for a noticable performance gain.
FossilOrigin-Name: ce123b5c592556a8cd38b01fcc91ba76231d3098
2014-08-22 23:33:03 +00:00
drh
637f3d83b9
Factor the saveAllCursors() routine of btree.c into two separate routines,
...
for a noticable performance improvement.
FossilOrigin-Name: 3eb084390382c108e9b0ff0b29dede58ebb149bc
2014-08-22 22:26:07 +00:00
drh
7bc4c454da
A small performance improvement in freeSpace() by special-casing the
...
relatively common case of an empty freelist.
FossilOrigin-Name: 49f44d355ff70744e4951baca2481c7c2b6c02b3
2014-08-20 18:43:44 +00:00
drh
5f5c753efb
Reimplement the freeSpace() routine in btree.c so that it runs faster.
...
FossilOrigin-Name: fe4fd014b42b7b158ca968f1535b5636c67769f6
2014-08-20 17:56:27 +00:00
drh
7fb91646b5
Refactor local variable names in the freeSpace() routine of btree.c for
...
improved understandability.
FossilOrigin-Name: 7e63089a191f29aefde05e89bb612f3036cfa034
2014-08-20 14:37:09 +00:00
drh
905552628c
Change an assert() added by the previous commit into a testcase().
...
Fix a separate assert() in btree.c:freeSpace().
FossilOrigin-Name: fe51d3aa0ce7021213293a0647e31164073e78f7
2014-08-20 13:17:43 +00:00
drh
4c04f3c8bd
Further size reduction and performance improvement in btree.c:allocateSpace().
...
FossilOrigin-Name: 1cb1cd64930a6bc371143f7d2e77eb1c51498cb0
2014-08-20 11:56:14 +00:00
drh
75b31dc9ad
Minor performance improvement and size reduction for the btree-page space
...
allocator.
FossilOrigin-Name: 73637d12e31f5489efe37d8cf4ab50a1911d4c75
2014-08-20 00:54:46 +00:00
drh
8d09dfe8f3
Merge the 3.8.6 release into the threads branch.
...
FossilOrigin-Name: 05807c4122505567ec64fb2d142077f48a0a10b1
2014-08-15 15:46:21 +00:00
dan
f216e324f9
Fix an assert that can fail if the database file is corrupted.
...
FossilOrigin-Name: 3f45b8192dad7fb1f027cbaa694046e3c1b3e278
2014-08-14 19:53:37 +00:00
drh
da2e5862d1
Merge all recent changes from trunk.
...
FossilOrigin-Name: a353a8515fb2eff86042d0c33e39772f4d04e0b3
2014-08-06 02:03:35 +00:00
drh
2c5e35ffd1
Rename the internal Schema.flags field to Schema.schemaFlags.
...
FossilOrigin-Name: 5ae80b3c8f032528359c8c762505ce24da8db96f
2014-08-05 11:04:21 +00:00
drh
966d9f267f
Merge recent trunk changes into the threads branch.
...
FossilOrigin-Name: 163c247bd8280ab14fe577329c631c8bd884707f
2014-07-28 15:01:37 +00:00
drh
eac5bd7870
Try to fix harmless compiler warnings reported by Fortify.
...
FossilOrigin-Name: e0fa6fdc14ac5458f9200cbae124f8025ea534ea
2014-07-25 21:35:39 +00:00
drh
ff14013496
Merge changes from the trunk into the threads branch.
...
FossilOrigin-Name: 416cb091267de91b9cadee9f7453b8627570b7d3
2014-05-29 20:24:20 +00:00
drh
f53b4ad0f9
Remove unused code (previously #ifdef-ed out) from btree.c.
...
FossilOrigin-Name: 8bc9737112e2700f337ff377cda040c8ba9d729f
2014-05-27 15:21:42 +00:00
drh
79045882c9
Merge recent trunk changes into the threads branch.
...
FossilOrigin-Name: 8215202759dbd863edf20aa26ff21da20bc35d73
2014-05-26 20:15:21 +00:00
drh
781597feca
Fix the sqlite3_db_readonly() API so that it reports true if the database
...
is readonly because the file format write version (byte 18 of the header)
is too large.
FossilOrigin-Name: 8d8af114dac301335ec10671c1e9a5a6d8266a60
2014-05-21 08:21:07 +00:00
dan
a7bf23c6b5
Fix some broken asserts in btree.c and vdbeaux.c that may fail following an OOM error.
...
FossilOrigin-Name: e15f47064bef431c0afd8bf93eb4e160c23ad562
2014-05-02 17:12:41 +00:00
drh
e9af1894e3
Merge recent trunk changes into the threads branch.
...
FossilOrigin-Name: 8729aa3e3ed1da2e15408ef8705cbe185cd2a5ac
2014-04-18 12:38:54 +00:00
dan
38fdead890
Fix a problem with OOM handling in the sorter code.
...
FossilOrigin-Name: 59cd5229e2b5be5272cf57c7e7d09e97d16a5425
2014-04-01 10:19:02 +00:00
drh
a38c9516e8
Remove an unnecessary conditional, replacing it with an assert().
...
Improvements to comments.
FossilOrigin-Name: 834bf1c367e1ccd498c7f9f843be2d2aa11ffb3c
2014-04-01 01:24:34 +00:00
drh
4c417181c2
Fix a compiler warning when SQLITE_DIRECT_OVERFLOW_READ is defined.
...
Minor performance enhancement and size reduction.
FossilOrigin-Name: 96385dc460545807a5c8fcf6280a971700f84866
2014-03-31 23:57:41 +00:00
drh
e4529c5724
Merge in the latest changes and fixes from trunk.
...
FossilOrigin-Name: f6211540c9d66a08dc580dd733e4f4a98968ae30
2014-03-31 22:03:32 +00:00
drh
a1f7c0a21c
Enhance the sqlite3VdbeRecordCompare() routines so that if they encounter
...
database corruption, they will set the UnpackedRecord.isCorrupt field and
return 0. The sqlite3BtreeMovetoUnpacked() routine detects this and returns
SQLITE_CORRUPT, causing the corruption to be reported back to the top-level.
FossilOrigin-Name: 7fa85eaaaf6d211378620d728a759fdfe30a15b0
2014-03-28 03:12:48 +00:00
drh
86dd3716b9
Detect when a VdbeCursor is still pointing at a valid row but that row has
...
moved, and invalidated the return from prior sqlite3BtreeDataFetch() or
sqlite3BtreeKeyFetch() calls.
FossilOrigin-Name: e6798871ce94961135762669af418cd78540c121
2014-03-25 11:00:21 +00:00
dan
9bc21b535e
Only use the direct-overflow-read optimization if all data from the overflow page in question is being read.
...
FossilOrigin-Name: d8e1f75ddf10f3c0b21acd5455f90fdcea54a948
2014-03-20 18:56:35 +00:00