1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

1674 Commits

Author SHA1 Message Date
dan
ad41f5eda3 Ensure that "PRAGMA integrity_check" reports an error if the free-list count header field contains a value smaller than the actual number of pages on the database free-list.
FossilOrigin-Name: 26f64986d1ed59c554a7cb9e00e86a7f148f1fc6
2015-09-18 14:45:01 +00:00
drh
81966bea22 Merge enhancements from trunk.
FossilOrigin-Name: 66fe06832614010d3156d7b21a760af9957018cc
2015-09-15 17:31:47 +00:00
drh
66336f3755 Fix a compiler warning and providing missing VdbeCoverage() calls.
FossilOrigin-Name: 2edd2e5edd60210e18db58bce1e096dd211b6ece
2015-09-14 14:08:25 +00:00
dan
f0ee1d3c12 Experimental change to use a single-pass approach for DELETE statements on non-virtual tables that do not fire triggers or require foriegn-key processing.
FossilOrigin-Name: eaeb2b80f6f8f83679c8323a81bb39570ec946fe
2015-09-12 19:26:11 +00:00
drh
163c29c5f3 Merge enhancements from trunk.
FossilOrigin-Name: 25ee3000e94d60d8c1d7b980f416dcc33eb11105
2015-09-03 14:39:33 +00:00
drh
d37bea5bdc Use sqlite3XPrintf() instead of sqlite3StrAccumAppend() in a few places
for better performance and a smaller footprint.

FossilOrigin-Name: 82355e41084387fa11b7b531e4d660dd3b4cd984
2015-09-02 15:37:50 +00:00
drh
0403cb3012 Always provide the BTREE_BULKLOAD hint, even when SQLITE_ENABLE_CURSOR_HINTS
is not defined, as that hint gives a 4% performance increase.

FossilOrigin-Name: 83a844357e132683ab3d88eee0fe32a8beeb6662
2015-08-14 23:57:04 +00:00
drh
0df57012da Refactor the sqlite3BtreeCursorHint() interface for improved maintainability.
FossilOrigin-Name: fc3fb5cd0d2c123a069e5b18b62bb1f708c8698a
2015-08-14 15:05:55 +00:00
drh
bec2476afc Merge in all the trunk changes from the previous year. This breaks the
cursor-hint mechanism, but provides a baseline for trouble-shooting.

FossilOrigin-Name: 82a7a61bc0883b1e7432548e4890791717aa1bb3
2015-08-13 20:07:13 +00:00
mistachkin
532f179cab Fix some harmless compiler warnings.
FossilOrigin-Name: 3de030c904d125ccf41fa1929646b8a002b5341b
2015-07-14 17:18:05 +00:00
drh
e56d43010d Avoid left-shifting bits into the sign of a signed integer, as such behavior
is technically undefined.

FossilOrigin-Name: 9417b4021b779876dcb3b9be636f01f4055eb54e
2015-07-08 01:22:52 +00:00
drh
72e191ed71 Do not preserve the btreeInitPage() results in PRAGMA integrity_check if
there were cell sizing errors because PRAGMA cell_size_check was turned off
during the btreeInitPage() call.

FossilOrigin-Name: 743bf1f184be316971f2e9c651bcf573bde8654a
2015-07-04 11:14:20 +00:00
drh
d2dc87f6d5 When doing coverage analysis of a btree page for pragma integrity_check,
make the first entry (that covers the header, cell index, and gap) implied,
for a performance boost and size reduction.

FossilOrigin-Name: e53d497c2d2fbc5014b39f5624b52ce207800698
2015-07-02 19:47:08 +00:00
mistachkin
c29cbb0bec Fix harmless compiler warnings and one macro VVA_ONLY macro usage issue.
FossilOrigin-Name: bcc8a75509aafda61feb6dcc074668c79611a662
2015-07-02 16:52:01 +00:00
drh
1910def351 Fix a (harmless) shadowed local variable definition in the integrity_check
logic.

FossilOrigin-Name: 3a26a919fd5550e5a0053a48cb93a27bb95cc916
2015-07-02 16:29:56 +00:00
drh
cbc6b71f39 Smaller and faster PRAGMA integrity_check that also does a better job of
detecting errors.  Some output text describing discovered file corruption
has changed for clarity.

FossilOrigin-Name: 251a7590ff4f65f59a1c871892533e4e2c544515
2015-07-02 16:17:30 +00:00
drh
e05b3f8f0b Simplification of PRAGMA integrity_check logic. Make sure that the depth
of the right-most subtree is correct.  Size reduction and performance increase,
with no change in output.

FossilOrigin-Name: 550705fcb64e7ad637686e47cabe2621d65851bf
2015-07-01 17:53:49 +00:00
drh
94a3115daa Fix some harmless compiler warnings.
FossilOrigin-Name: 307195c8709d7fd2a642baa8011eb0c88cfdc0ac
2015-07-01 04:08:40 +00:00
drh
88266dc17a Change integrity_check to analyze the cells of a page in reverse order, as
this will tend to insert the cells into the analysis heap in increasing order
by address, which is the most efficient way to load a min-heap.

FossilOrigin-Name: 59ad912c4c1f858e04d27b1b8f25581a5f6e5daf
2015-07-01 01:31:14 +00:00
drh
329428e208 Remove the use of htonl() in the previous check-in due to linkage issues.
Add the get2byteAligned() macro and use it for access to the cell offsets
on btree pages for about a 1% performance gain.

FossilOrigin-Name: 79ff36b7170c9e7e7a9935c8b9d1665867771087
2015-06-30 13:28:18 +00:00
drh
27fb746cde Put BtCursor objects on a singly-linked list instead of a doubly-linked list.
Add the BTCF_Multiple flag.  Only invoke saveAllCursors() when using a cursor
that has BTCF_Multiple set.

FossilOrigin-Name: 429ccef2b36fc46e92914eb54afd5f800b1a40ff
2015-06-30 02:47:36 +00:00
drh
98ef0f6c48 Convert several 5-year-old and older NEVER() macros into assert().
FossilOrigin-Name: ed54c14ea8a72d69d69e0c0d7f6936f54efc04c2
2015-06-30 01:25:52 +00:00
drh
207c817365 From sqlite3BtreeInsert(), bypass the btreeMoveto() routine for table inserts
and go directly to sqlite3BtreeMovetoUnpacked().

FossilOrigin-Name: 53fe685d56368af78238c8981cc41704929f7660
2015-06-29 23:01:32 +00:00
drh
325d087aa7 Move an assert() and testcase() into their correct position within
getAndInitPage().

FossilOrigin-Name: 18115164e12509ec21f34598089a7f1310048819
2015-06-29 00:52:33 +00:00
drh
c75d886b05 Make greater use of BtCursor.curIntKey.
FossilOrigin-Name: 63998471d023dd846d5583ac856e2acc47ad41ea
2015-06-27 23:55:20 +00:00
drh
408efc0664 Add the BtCursor.curIntKey field and use it for a small size reduction and
performance boost.

FossilOrigin-Name: 4a17df139ac41e29c9a2e58afbd1238a5e94bd36
2015-06-27 22:49:10 +00:00
drh
15a0021b3e Enhancements to the previous check-in to make it a little smaller and faster.
FossilOrigin-Name: 291d9e0c328a7bd0f255b0b7e819ca2c909701a3
2015-06-27 20:55:00 +00:00
drh
28f58dd60e Performance improvements in moveToChild() by shifting some work over
to getAndInitPage().  Net improvement is about 800K cycles at cost of 30 bytes.

FossilOrigin-Name: 1956a4ce8eca650d98a7f68fd2d82eb8a3d6069f
2015-06-27 19:45:03 +00:00
drh
375beb0ec0 Manually inline the call from getAndInitPage() to btreeGetPage() for a
savings of 2.5 million cycles at a cost of less than 100 bytes.

FossilOrigin-Name: 7f65b96b4017413bd19624570efe8fb2b0f7b991
2015-06-27 15:51:06 +00:00
drh
bbf0f867d2 Add releasePageNotNull() as an alternative to releasePage() when the argument
is guaranteed to be non-NULL, and use it for a small performance gain.

FossilOrigin-Name: 9383a688701ac2c366a308efc287c9c0f8977d4e
2015-06-27 14:59:26 +00:00
drh
f44890a7c4 Add the Mempage.aDataOfst field and use it in sqlite3BtreeMovetoUnpacked()
for about a 2 million cycle gain.

FossilOrigin-Name: bee94dc3510745ba2efa044e8f3299793cfc7e34
2015-06-27 03:58:15 +00:00
mistachkin
68cdd0eda2 Fix harmless compiler warning in assert statement.
FossilOrigin-Name: 7097716caed9d4aef49c7e766e41ea74abf5967f
2015-06-26 03:12:27 +00:00
drh
2c8fb926da Simplifications and performance improvements in insertCell().
FossilOrigin-Name: 7d02e6c992ef92e1f77ebc13889e17c028454b06
2015-06-25 19:53:48 +00:00
drh
b7580e84a8 More simplifications and performance improvements to cell allocation
logic associated with allocateSpace().

FossilOrigin-Name: 78da0f69cb3289e332018864004f319f2764a5c8
2015-06-25 18:36:13 +00:00
drh
e674bf1648 Reorder the terms of a conditional for a small performance gain.
FossilOrigin-Name: d67b0ed1054cbb7ea2cdd74720d4d6e0227cec14
2015-06-25 16:01:44 +00:00
drh
ae6cd72318 Remove a NEVER() that is in fact reachable.
FossilOrigin-Name: f824e66b0dc120bed227c7446e2663fcad7cc4f6
2015-06-25 15:21:52 +00:00
drh
ded340e4fc Minor optimization to allocateSpace().
FossilOrigin-Name: d007bc339b9ea6d59a3dd2b0c5e77e9c801b16f6
2015-06-25 15:04:56 +00:00
drh
6918095d81 Enhance the Btree object to remember whether or not it is holding an
Incrblob cursor.  Use this knowledge to improve performance in the common
case where it does not.

FossilOrigin-Name: 476b11563c08c6d9c0abd69e4d865c4edcdd45f5
2015-06-25 13:03:10 +00:00
drh
526b17db13 Remove a line of code that doesn't do any useful work.
FossilOrigin-Name: 3ee888beb974e015bd11ae79381b208eaa310f6f
2015-06-25 02:26:45 +00:00
drh
c6e956f038 Fix a harmless compiler warning.
FossilOrigin-Name: 3b6fa95eebfa01703d9ef4f530674d17e965c512
2015-06-24 13:32:10 +00:00
drh
9e7804dfd4 Prevent an infinite loop while searching a corrupt freelist.
FossilOrigin-Name: 4e5424fe89eed346f6cf26a05c72694d1eb9f58f
2015-06-24 12:24:03 +00:00
drh
672073a41b Strengthen the new balance_nonroot() code against various corrupt database
problems.

FossilOrigin-Name: 5ba983432069714afebbb2f0ef22d41be52f7a4c
2015-06-24 12:07:40 +00:00
drh
b468ce1256 Remove an invalid NEVER() and add a test case to cover it.
FossilOrigin-Name: 14b73d201509d3c04f760a08d21f3c499f2870a8
2015-06-24 01:07:30 +00:00
drh
ea82b37302 Testability improvement.
FossilOrigin-Name: eed6a3314518cdab809264284d7680385f0d5d2a
2015-06-23 21:35:28 +00:00
drh
fe647dc9ee Multiple overflow cells are always adjacent and sequential. Exploit this
invariant for a small size reduction and performance increase and add
assert()s to prove the invariant.

FossilOrigin-Name: f77f2f48f48e374a72b6c054142f7a3ec0b1483c
2015-06-23 18:24:25 +00:00
drh
4f4bf7747a Faster loading of cell pointers into the b.apCell array in balance_nonroot.
FossilOrigin-Name: fda89b0512477f9da09fd0f4e548ed4b13efd49d
2015-06-23 17:09:53 +00:00
drh
008d64c23a Avoid unnecessary cachedCellSize() calls in the cell partition adjustment
phase of balance_nonroot().

FossilOrigin-Name: 6319ee1256b1f7c39dd39a536a39b77b3d10dcac
2015-06-23 16:00:24 +00:00
drh
f783893b8d Change pageInsertArray() and pageFreeArray() so that they use the CellArray
object and compute cell sizes as needed, resulting in smaller and faster code.

FossilOrigin-Name: f7f41818119bb7bfbd1f1297d294b32f32769cd3
2015-06-23 15:36:34 +00:00
drh
4edfdd38fb Improvements to the way balance_nonroot() constructs the b.apCell array of
pointers to cells.

FossilOrigin-Name: ee44bb25b2a88e25ba2afe37cf03ba199692a3a0
2015-06-23 14:49:42 +00:00
drh
1ffd247c0c Avoid computing cell sizes in balance_nonroot() until they are really needed.
This gives an overall 1.7% performance gain for about 1000 extra bytes of
code space.

FossilOrigin-Name: 43844537e8a372953386663f8177202901ba7566
2015-06-23 02:37:30 +00:00