Commit Graph

12872 Commits

Author SHA1 Message Date
drh d05ab6aacf Increase the resolution of the second parameter to the likelihood() SQL
function (the probability value) so that it can handle probabilities
as small as 0.00000001.  Formerly, it ran out of precision at 0.001.

FossilOrigin-Name: 0f08924fe0c52a85a103f67bee9809e0f8f884b0
2014-10-25 13:42:16 +00:00
drh 051575cbf4 Do not use virtual (and hence redundant) WHERE-clause terms to restrict the
content of a automatic partial index.  Show when an automatic partial index
is used in the EXPLAIN QUERY PLAN output.

FossilOrigin-Name: b9ad601eab1d7298d369267eb697c7fa1bc16985
2014-10-25 12:28:25 +00:00
drh 059b2d50e1 Enhance the automatic index logic so that it creates a partial index when
doing so gives the same answer for less work.

FossilOrigin-Name: d95d0313c447f5baeabdb17284d8606331ab7d49
2014-10-24 19:28:09 +00:00
drh 4dd96a8315 Honor a high likelihood() on range constraints.
FossilOrigin-Name: 401235edf40fcd665eaf426cf5155ac6855e8537
2014-10-24 15:26:29 +00:00
drh 9769efcc4c Get the likelihood() functions working on operators like BETWEEN that
create virtual terms in the WHERE-clause analysis.

FossilOrigin-Name: 03d0498d0f24bec2383d5d79edf25069effecd59
2014-10-24 14:32:21 +00:00
drh 4f81bbb528 Implement sqlite3_create_collation() by invoking
sqlite3_create_collation_v2() with a NULL destructor argument.  This saves
a little space.

FossilOrigin-Name: 9762ad0639cca2fc1ef0573113fb613ce9e7e83e
2014-10-23 01:01:26 +00:00
drh b7288e28e4 Disable the use of strchrnul() unless specifically enabled by compile-time
options.

FossilOrigin-Name: e580470db77d6da970c755102790e603fb26b3c6
2014-10-22 20:07:19 +00:00
drh d7d7147022 Change the 0x800 bit of SQLITE_TESTCTRL_OPTIMIZATIONS so that it disables
the loading of STAT3 and STAT4 content, not just the using of that content.
Change the internal name of that bit to SQLITE_Stat34.

FossilOrigin-Name: ca3b00c44ec52d209642a5ba9ef82e085fac39db
2014-10-22 19:57:16 +00:00
drh 9f07cf7b2e Take steps to avoid misestimating range query costs based on STAT4 data
due to the roundoff error of converting from integers to LogEst and back
to integers.

FossilOrigin-Name: 3c933bf95f291f7957580d823dce92c981375a5c
2014-10-22 15:27:05 +00:00
drh 442c5cd3cf Call fsync() right after ftruncate() when in journal_mode=TRUNCATE and
when synchronous=FULL in order to ensure that transactions are durable
across a power loss that happens moments after the commit.  Proposed
fix for [https://bugzilla.mozilla.org/show_bug.cgi?id=1072773].

FossilOrigin-Name: 3e922208b68563489c7766abb9afb4885113e7b8
2014-10-21 21:56:06 +00:00
drh f7f2e84a9c Further tuning of the cost estimates for skip-scan loops, especially for cases
when skip-scan loops are in competition with regular loops.

FossilOrigin-Name: a27861c28c4791e51d797aa37e9cca806cb58775
2014-10-21 18:16:21 +00:00
drh 1b131b7a7a Improvements to the WHERETRACE debugging logic.
FossilOrigin-Name: ec1e942f08548695ff02645b3f3cd6bb2516bc9a
2014-10-21 16:01:40 +00:00
drh c8bbce1e6a If a skip-scan is a proper subset of some other scan, then adjust the
cost of the skip-scan upward so that it is more costly than the other scan.
Such a cost imbalance can arise under STAT4 because of difficulties in getting
an accurate estimate for skip-scans.

FossilOrigin-Name: f4b22a2620a5dc48949048c2ecbd226755d4b2c3
2014-10-21 01:05:09 +00:00
drh 40253262e0 Fix a (probably harmless) but in the CSV output mode of the command-line
shell.

FossilOrigin-Name: 19fe4a0a475bd94f491031aea7a183f7c0515cf3
2014-10-17 21:35:05 +00:00
drh 81b567a4c7 Version 3.8.7
FossilOrigin-Name: e4ab094f8afce0817f4074e823fabe59fc29ebb4
2014-10-17 11:24:17 +00:00
mistachkin 7bdc9749d5 Work around MSVC not being able to deduce that a local variable was initialized in a called function.
FossilOrigin-Name: 06c576c152c4013080c255cbbeb45bf2e298be9f
2014-10-16 21:39:17 +00:00
mistachkin 92c2e0da8f Changes to work around Win32 and MSVCRT APIs that are not present on Windows CE 200x.
FossilOrigin-Name: 1418c006e377d7915a50577d4ccb21125b750bae
2014-10-16 18:34:50 +00:00
dan facd5fd622 Update the vdbe-compress.tcl script to account for expressions of the form (123>var), where "var" should be replaced with a reference to a union member.
FossilOrigin-Name: 640345d880c6178f8434e3ce40329b7527588843
2014-10-16 11:45:14 +00:00
dan 5d510d4c41 Update releasetest.tcl so that x86-64 runs a superset of the x86 tests.
FossilOrigin-Name: 3c1e70f4d55bc009ed9ed4cf6d756d7061985851
2014-10-15 15:28:27 +00:00
dan f41652419e Fix a problem causing lock5.test to fail in mmap-mode.
FossilOrigin-Name: b3e7b446bdb47cf9d7fe43dc37e3b4f8010ee09e
2014-10-15 14:45:34 +00:00
drh 92787cf042 Add a four-byte prefix to the BtShared.pTmpSpace buffer to avoid reading
before the beginning of an allocation.

FossilOrigin-Name: 9386bfca128023583a24303e5f1d832987a49d43
2014-10-15 11:55:51 +00:00
dan 74439167cb Rearrange an expression in vdbemem.c to avoid a (harmless) reference to a possibly unitialized variable.
FossilOrigin-Name: 4a7b3fa049a9aa0668e318287edd4a78c0588bf8
2014-10-15 11:31:35 +00:00
drh 5604cc0d3b Make sure new sqlite3_vtab objects created by the xCreate() virtual table
method are initialized by the system, in accordance with the documentation.

FossilOrigin-Name: eab82330631187dcc3e5d2dddd23dbda5752904b
2014-10-14 20:25:43 +00:00
drh 8dd8362d64 Optimize a database corruption test inside of the OP_Column opcode.
FossilOrigin-Name: 005e5b388a8a97bca6d1f0e06c40d68d92aa1212
2014-10-13 23:39:02 +00:00
drh facf47a891 Use the padding word in the Mem object as temporary storage for
serial_type value in OP_Record, and thus avoid a redundant computation of
the serial_type for each column.

FossilOrigin-Name: 4b3b65ee5ea61e9b9671ca027940bf02689cb890
2014-10-13 20:12:47 +00:00
drh f526dcad29 Three small optimizations to vdbeaux.c.
FossilOrigin-Name: 04892f8ba6c55cec4fe37bfe59b6349fd2a40698
2014-10-13 17:42:05 +00:00
drh c22284f4b3 Reduce the CPU load imposed by sqlit3VdbeCursorMoveto() by factoring out
some of its functions and by avoiding unnecessary calls.

FossilOrigin-Name: c2799aece17d347c64217a0e407bb10e50c184a3
2014-10-13 16:02:20 +00:00
drh 6cf4a7dfa6 Remove the OPFLAG_CLEARCACHE flag from OP_Column. In its place, change the
P3 parameter of OP_SorterData to be the index of the pseudo-table cursor whose
record header cache is to be cleared.  This gives a small size reduction
and performance increase.

FossilOrigin-Name: 20062f49428a2349a2dd705af570c60b499a3eef
2014-10-13 13:00:58 +00:00
drh b53a5a9e50 Remove the VdbeCursor.lastRowid cache of the current rowid, since maintaining
the correct cache value uses more CPU cycles than just recomputing the rowid
on the occasions when it is actually needed.  Replace it with the
VdbeCursor.aOffset field which used to be computed from VdbeCursor.aType
when needed. Saves 100 bytes of code space and runs 0.2% faster.

FossilOrigin-Name: 91384a7d727ef0f285cd430e829ba9f3852db50e
2014-10-12 22:37:22 +00:00
drh c81aa2e120 Performance optimization and very slight size reduction for OP_Column.
FossilOrigin-Name: 869c30e45cc87063be423c650f16b99e8adb3df0
2014-10-11 23:31:52 +00:00
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
drh 8683e08676 Require the SQLITE_ENABLE_RTREE compile-time option in speedtest1.c in order
to enable the R-Tree tests.

FossilOrigin-Name: 5d29a033b0f17b0fd74656b28a8367a9a9067f81
2014-10-11 10:52:54 +00:00
drh 4929047d1a Make sure that a GROUP BY that also implements an ORDER BY scans the table
in the correct order.  Fix for ticket [ba7cbfaedc7e6].

FossilOrigin-Name: 7a32fdfd4be2138c0ab00f3dc6f54a70e4e07be4
2014-10-11 02:12:58 +00:00
drh c631faa922 Remove an unnecessary conditional from the EXPLAIN QUERY PLAN logic.
FossilOrigin-Name: c5dc83ebded914f07286b7f98d0a50c28c16f609
2014-10-11 01:22:16 +00:00
dan b6453201d2 Account for the ASC/DESC properties of ORDER BY expressions when using the same index for GROUP BY and ORDER BY. Candidate fix for [ba7cbfaedc].
FossilOrigin-Name: 2a9573962b837973c4959465d8a5f2641d109a5a
2014-10-10 20:52:53 +00:00
drh 1f8817cb32 Restrict the scope of the explainIndexRange() function in where.c.
FossilOrigin-Name: c30124520027f0f860223bf842e2f09db3dafb5f
2014-10-10 19:15:35 +00:00
dan 5bd8af7c6b Fix a failing test case in index5.test. Also tweak the way cache memory is divided between read-only and dirty pages when using SQLITE_CONFIG_PAGECACHE to reduce IO in some cases.
FossilOrigin-Name: 8541dfb3bbdf63dc9ab304d8a0ab8b290cdc9d96
2014-10-10 19:10:59 +00:00
drh ab993380a2 Changes to enable compiling using VC6.
FossilOrigin-Name: 9ee5686ab3b0bca8cabdf455c75bd9410cdc5378
2014-10-10 18:09:52 +00:00
drh e35626fabd When using the -config option to releasetest.tcl, default the testing type
to "fulltest" if it is not specified on the command line.

FossilOrigin-Name: cf291cbe9f49396f03cfca39c2e892f27f750107
2014-10-10 17:47:00 +00:00
drh 2eeb7ae437 Provide the new "-config CONFIG" option to the test/releasetest.tcl script,
which allows one to run a single test configuration selected by name.

FossilOrigin-Name: d479e32be205f6cd0474f002282eae6eec613f36
2014-10-10 17:44:03 +00:00
drh 98545bb2ed Add the estimated number of output rows to the EXPLAIN QUERY PLAN output
if compiled with SQLITE_EXPLAIN_ESTIMATED_ROWS.  This feature is off by
default for the time being.

FossilOrigin-Name: daa8314fba9dc3c4f5e7fbda42c97604fbfc4392
2014-10-10 17:20:39 +00:00
drh 6c97789d2e Simplify the code used to generate the text for EXPLAIN QUERY PLAN.
FossilOrigin-Name: beea1efc3a49cad08087fcbb18dbce71c873fe57
2014-10-10 15:47:46 +00:00
drh 681fca0018 Fix a potential problem in the whereRangeScanEst() routine when STAT4 is
active.  The problem was introduced by recent enhancements.

FossilOrigin-Name: 68e1b4de700b5291f79249a03e1a750c6b2c9ae4
2014-10-10 15:01:46 +00:00
drh bf59bf94b2 Cause the command-line shell to return non-zero if the final SQL statement
is incomplete.

FossilOrigin-Name: 177fff3b98b101b98f1e7d334b6a80530b645565
2014-10-10 13:08:33 +00:00
dan 6e1a037357 Allow FTS tokenizers to choose whether or not to consider the "*" character part of tokens or not. This restores the pre-[e21bf7a2ad] behaviour. Also fix a problem causing FTS to interpret tokens beginning with "*" characters as EOF.
FossilOrigin-Name: 49dfee7cd1c9ab2901b8a871a6cd00b2ead76801
2014-10-09 15:08:17 +00:00
drh 622d4f8bb1 Add a test case for the memory leak fixed by the previous check-in.
FossilOrigin-Name: bae36d544676c90e337381a83f4513b4d925ab05
2014-10-09 14:10:38 +00:00
drh a8950d5038 Fix a memory leak associated with the FTS4 matchinfo() function.
FossilOrigin-Name: fb8da82411b80a234c6a5481622027815450996a
2014-10-09 14:00:49 +00:00
drh 8e0a8f681a Remove an always-true branch in whereRangeScanEst(). Replace it with an
assert().

FossilOrigin-Name: 42e48fd3a6a6219d9bd6135d821b38c5157922ba
2014-10-08 19:33:54 +00:00
drh 3705ef6a73 Fix up test cases to account for the new SQLITE_LIMIT_WORKER_THREADS limit.
FossilOrigin-Name: 6483d426c4c5c772cd49412ea37e0fa7a0378904
2014-10-08 15:53:21 +00:00
drh f6aff80525 Set the connection-specific lastRowid value before calling any SQL function.
FossilOrigin-Name: dff0f6422e60a7e2e4efb658aab202a119cfa702
2014-10-08 14:28:31 +00:00