Commit Graph

12692 Commits

Author SHA1 Message Date
drh 60da72741a Do not require a page-size change if the attempt to change the page size
failed due to an OOM error.

FossilOrigin-Name: 4d4fb197dc438a486cf5d967cf435f1132902c63
2014-09-06 03:38:51 +00:00
drh 44ee1dc843 Add the sqlite3_memdebug_title_count global variable, used during debugging
to count the number of invocations of test_memdebug_settitle.  By examining
this variable in the debugger after a segfault, one can then set a breakpoint
on test_memdebug_settitle that will fire just before the problem.

FossilOrigin-Name: 27e3ca3e0f1da54e3527704a8601bb9003b086bf
2014-09-06 03:16:28 +00:00
mistachkin 6b9da12856 Fix a couple of typos in comments. No changes to code.
FossilOrigin-Name: a758465e3cfa7e0cb8749d097cd6fb5f86b60955
2014-09-06 02:00:41 +00:00
drh d8b77e20fc Query planner heuristic update:
When doing a full table scan on a table that has an equality constraint on
an unindexed column, do not allow the estimated number of output rows to
be greater than half the total number of rows in the table.

FossilOrigin-Name: 73954f93c4c6f880c6e01d0d130e3fed40fd4106
2014-09-06 01:35:57 +00:00
mistachkin 30c633a097 Fix harmless compiler warning.
FossilOrigin-Name: 733119067757814609a9cea6b975818607bee4e3
2014-09-05 05:58:37 +00:00
drh f8ede57a61 Update comments in the ANALYZE command that describe how the Stat4Accum
objecct is passed around within the VDBE.  No changes to functional code.

FossilOrigin-Name: 9779c7a9eb1e2bd36e9286331a9314f064014d80
2014-09-01 23:06:44 +00:00
drh 975e076681 Avoid a confusing (though correct) argument to the sqlite3_result_blob()
function in the implementation of ANALYZE.

FossilOrigin-Name: 4cae93f8ae8fb3fe38fd5dc7d3a5ea0d11552841
2014-09-01 22:34:54 +00:00
mistachkin 832436d145 For sqlite3_win32_is_nt(), assume WinRT is NT-based and revise #ifdef ordering to prefer the ANSI version of GetVersionEx, when available.
FossilOrigin-Name: be0a037244762cc0f5ff4a6d7822902f862767bd
2014-09-01 19:29:19 +00:00
drh 54d7518746 Tweak the documentation for SQLITE_LIMIT_WORKER_THREADS. No changes to
executable code.

FossilOrigin-Name: 672e7387b1bda8d007da7de4244226577d7ab2dc
2014-09-01 18:21:27 +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 19541f3018 Attempt to make the xDelete method of the unix VFS more robust on VxWorks.
FossilOrigin-Name: b0f6b91f36b503d8ba8d5257bb194f8c1afb4833
2014-09-01 13:37:55 +00:00
drh ee6438df0b Micro-optimizations in sqlite3BtreeNext() and sqlite3BtreePrevious().
FossilOrigin-Name: 839c7996eecd5480152c514555b9aa1121a69ce0
2014-09-01 13:29:32 +00:00
mistachkin 31970cca38 Fix harmless compiler warnings for MSVC.
FossilOrigin-Name: 3ef3246120d72dffe469733bb21667a548af0a44
2014-09-01 01:16:49 +00:00
drh 44dec87538 In the command-line shell, added options --lookaside, --pagecache, and
--scratch used to configure auxiliary memories.

FossilOrigin-Name: f61db04be4d7fb21b7f721647c37c45e283ffbea
2014-08-30 15:49:25 +00:00
drh 6b2129aaaf Disable worker threads when SQLITE_THREADSAFE=0. Set the default compile-time
maximum number of worker threads to 8 and honor the
SQLITE_DEFAULT_WORKER_THREADS compile-time constant (which defaults to 0).

FossilOrigin-Name: 33fa0410499900dd8beb44b9a8ffbd9f4b68c8d8
2014-08-29 19:06:07 +00:00
drh 43cbe14378 Fix the speedtest1.c test program to set the worker thread count using
the threads pragma.

FossilOrigin-Name: 2ab4b5adc60b52bf2d2b79968d226b8dd7d2ab3b
2014-08-29 18:06:33 +00:00
drh 111544cbb4 Add SQLITE_LIMIT_WORKER_THREADS for controlling the maximum number of
worker threads.

FossilOrigin-Name: 1b598c68f32db635d1cea1373bedc434aa60cf08
2014-08-29 16:20:47 +00:00
drh 503ae86508 Merge recent performance enhancements from trunk onto the threads branch.
FossilOrigin-Name: 35c44a3c73e2e8b14ff194c41986f4bdb9dfe737
2014-08-29 14:40:07 +00:00
drh 46048d2f24 Note a fault after all, rather a testing mistake.
Move this change back to trunk.
Was: Avoid an unnecessary OP_Move operation for expression subqueries.

FossilOrigin-Name: 2a74129a21f9745f1363f844807e2d10201a3f40
2014-08-29 14:20:46 +00:00
drh 53932ce8fa Avoid an unnecessary OP_Move operation for expression subqueries.
FossilOrigin-Name: 462f42af52f146fd328ddcbbe78c8444ef7bd2c3
2014-08-29 12:29:39 +00:00
drh ae914d783a Improved WHERETRACE messages for the estimated output row reductions from
range scans.

FossilOrigin-Name: fdd478bb11eb9e244a7a1fb628ac27c53830fb24
2014-08-28 19:38:22 +00:00
drh defb8223b4 Fix a problem causing an inaccurate stat4-based estimate for the
number of rows visited by a range scan.

FossilOrigin-Name: a9daf3ac444b896013f4054051937d49a597624a
2014-08-28 17:30:28 +00:00
drh b34fc5be6d Add a testcase() macro to help verfity the row estimation logic.
FossilOrigin-Name: 6ba609522ea7325341fad93bdb5f869c6506dea4
2014-08-28 17:20:37 +00:00
dan 7fa0631ece Fix a problem causing an inaccurate stat4-based estimate for the number of rows visited by a range scan.
FossilOrigin-Name: 052d89b554a947b7e420b7feb6650f5069b7cefa
2014-08-28 16:01:31 +00:00
drh 5418b1298f Fix a formatting error ("%d" needed in place of "%g") on a WHERETRACE
macro inside of the query planner.  This fix applies to debugging logic
only.

FossilOrigin-Name: c931ca2b7763cf894ece26ca4775d638876107e9
2014-08-28 13:42:13 +00:00
drh bc59ac0e26 Refactor the sqlite3PcacheFetch() routine into three separate routines,
which are significantly faster overall and about 100 bytes smaller in
size as well.

FossilOrigin-Name: bdb6e4978d1a26d5f795262172605184264ede9c
2014-08-27 23:18:01 +00:00
mistachkin a1dc42aa91 Add a VDBE synopsis comment for clarification.
FossilOrigin-Name: 029a6dc744c24e7be482298c678af8a115d6a87b
2014-08-27 17:53:40 +00:00
dan 54ae4e3179 Add a missing ticket number to a comment in index7.test.
FossilOrigin-Name: d8b1c4336145d436241863c3525530e24a24799b
2014-08-27 17:48:15 +00:00
dan 0829169f1e When determining whether or not a partial index is usable, do not assume that the cursor number assigned to each table in the query is the same as its index in the FROM clause. Fix for ticket [98d973b8f5].
FossilOrigin-Name: fcebca166f15431764b82a8b267f11d28386e975
2014-08-27 17:37:20 +00:00
drh 9bd038f12e In the sqlite3_context object, keep a pointer to the result value rather
than storing the result value in the sqlite3_context object and using
memcpy() to move the value back into its register
after the function returns.  This runs faster and saves over 500 bytes
of code space.

FossilOrigin-Name: 6c1ee3e388eb110de815270467b1e50592c0ba6c
2014-08-27 14:14:06 +00:00
drh 6c9f8e67de Factor out the exception paths from sqlite3ValueToText() into a separate
function so that the main routine is much faster for the common case of
no required type or encoding conversions.

FossilOrigin-Name: 1624916c6e9bc5dbcfa146b316a99ac8fecb13a9
2014-08-27 03:28:50 +00:00
drh b63388b6a4 Performance enhancement in sqlite3VdbeMemNulTerminate().
FossilOrigin-Name: f94cacc393e895522b92c9717c53357afc918d60
2014-08-27 00:50:11 +00:00
drh c3031c61ef Change the page cache so that a new sqlite3_pcache object is allocated as
soon as the page cache is opened, not delayed until the first fetch request.
This give a noticable performance boost.  The interface between pager and
the page cache has changed slightly, which might break ZIPVFS.

FossilOrigin-Name: f1f94a971e031e784f8c30a6faf829df58709329
2014-08-26 15:06:49 +00:00
drh 028696c4cc Remove the SQLITE_CONFIG_WORKER_THREADS configuration parameter. The number
of worker threads in the sorter is now determined only by the
PRAGMA threads=N setting.

FossilOrigin-Name: e3305d4b4efcbe06945ce7f6ec0f2e864244aaf9
2014-08-25 23:44:44 +00:00
drh 6c4ec84256 Merge the CAST operator enhancements from trunk.
FossilOrigin-Name: 6c8f86e4e08d5d57e21496277613e0f9dcc06514
2014-08-25 22:43:17 +00:00
drh 05bbb2e824 Add an assert() and five testcase() macros to the OP_Cast opcode implementation
to help verify that it is fully tested.

FossilOrigin-Name: af364cce9da0961593ef876b646197f82df08ad5
2014-08-25 22:37:19 +00:00
drh ec3e4f753b Minor changes to the CAST logic to make it more testable.
FossilOrigin-Name: 1ad70ec550c004160d9c0c57e6c416812cdead5e
2014-08-25 21:11:01 +00:00
drh 21b0e73354 Test cases added for using unary "+" and CAST operators on the RHS of range
constraints and verifying that STAT3/4 can use those constraints.

FossilOrigin-Name: 42505e5a810832442699ca54a46637c50e7f9e71
2014-08-25 20:21:07 +00:00
drh 4169e430a2 Allow CAST expressions and unary "+" operators to be used in the DEFAULT
argument of an ALTER TABLE ADD COLUMN and to be understand on the RHS of
range constraints interpreted by STAT3/4.  This involves a rewrite of the
implementation of the CAST operator.

FossilOrigin-Name: 91d8a8d0b792ea5c4fe68fd9caaf3345eddea486
2014-08-25 20:11:52 +00:00
dan f741e0491e In cases where stat4 data is available but cannot be used because the rhs of a range constraint is too complex a expression, fall back to using the default estimates for number of rows scanned.
FossilOrigin-Name: e06dc6f0c35f87c44292c71677111b74f073a5c4
2014-08-25 18:29:38 +00:00
drh 034596153d Query or change the maximum number of worker threads allowed on each
database connection separately using the "PRAGMA threads" command.

FossilOrigin-Name: 29c5e8a7c9d7ce349a1e1d72082d23450e877b45
2014-08-25 15:13:22 +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 c137807a87 Remove the pager_lookup() function since it is redundant with
sqlite3PagerLookup().

FossilOrigin-Name: 54164ce47cfc3ad5dd8797114e4ba78811f23bef
2014-08-25 11:33:41 +00:00
drh 12b7c7d8c3 Change the name of the VdbeMemRelease() macro to VdbeMemReleaseExtern() to
more accurately reflect what it does.  Performance enhancement to the
sqlite3VdbeMemRelease() function.

FossilOrigin-Name: 3ca5846da7da5e08192a4c96288197be3b7ab6f7
2014-08-25 11:20:27 +00:00
drh 4274dae9e9 The sqlite3VdbeChangeEncoding() routine goes about 3x faster if the
sqlite3VdbeMemTranslate() subroutine is not inlined.

FossilOrigin-Name: 0c7e1b875a14ff9d71af7bb125a0272a23d57353
2014-08-24 02:53:23 +00:00
drh f063e08fd9 Patch the sqlite3PagerWrite() method in the Pager to run a bit faster.
FossilOrigin-Name: c63311e2f3344363a5ed99838fb5850004eaee30
2014-08-24 01:32:43 +00:00
drh efbf044583 Faster implementation of pcache1Fetch()
FossilOrigin-Name: 0371cc3bb07448bcd64fd671f3e71bb7f30deb4d
2014-08-23 23:15:31 +00:00
drh b50c65d561 Faster implementation of the sqlite3ApiExit() routine.
FossilOrigin-Name: bd41d394d48516eb7d8ddc46abdcb427aa80173e
2014-08-23 20:25:53 +00:00
drh b4586f1254 Another memory allocator performance optimization.
FossilOrigin-Name: 6da6f46d0c43e3b68c21f514ddf8ee663c20f249
2014-08-23 19:42:06 +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