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
c0fea3cf53
Add a new sqlite3FaultSim() call to vdbePmaReaderSeek() to facilitate
...
tests of error handling in the sorter.
FossilOrigin-Name: 655d8cfc752b3f5f63521a57f2155f8e14aaf7c4
2014-07-30 18:47:12 +00:00
drh
c690461ea1
Mark some invariants in the vdbesort.c logic when SQLITE_MAX_WORKER_THREADS==0.
...
FossilOrigin-Name: 721cd965859c9ccc24d2a1d2851c914229e584b3
2014-07-30 17:21:37 +00:00
drh
bd1c881a91
Merge recent trunk changes, and especially the fix for the CREATE UNIQUE INDEX
...
problem of ticket [9a6daf340df99ba9].
FossilOrigin-Name: 5b50a8380b2b678c1646ff303e3696efc1d7d92c
2014-07-30 14:44:24 +00:00
drh
ac50232d0f
Ensure that the correct number of columns in a UNIQUE index are checked for
...
uniqueness, regardless of whether or not the original table has a ROWID or
if the columns are NOT NULL, etc. Ticket [9a6daf340df99ba93c].
FossilOrigin-Name: 6b785e92f279cb65746834d5cd25594fd3333342
2014-07-30 13:56:48 +00:00
drh
b92284de11
Fix unreachable branches in the threads.c module.
...
FossilOrigin-Name: 3175e366bbf7579ec9ab27214b0a4e5cd27ea204
2014-07-29 18:46:30 +00:00
drh
cd4b637760
Fix a harmless compiler warning.
...
FossilOrigin-Name: 216d21d0e62b3c0ad49f3cb395c845bf4f17ac61
2014-07-29 17:22:12 +00:00
drh
bde27aaa5a
Remove an unnecessary parameter from vdbeMergeEngineStep(). Rename a couple
...
other routines to be more descriptive of what they do.
FossilOrigin-Name: f2407a40f339fa6c2cec194f78ae7c93655b1ec1
2014-07-28 20:16:41 +00:00
drh
d906514d98
Rename vdbeIncrMergerInit() to vdbeMergeEngineInit() - a much more accurate
...
name.
FossilOrigin-Name: 5b084a2dd581141b2d0cd9d1a5975625f65ec34d
2014-07-28 19:58:41 +00:00
drh
8a4865f139
In vdbesort.c, rename vdbeSorterDoCompare() to vdbeMergeEngineCompare() and
...
move it closer to the one place where it is called. Other minor comment
changes.
FossilOrigin-Name: 09d50d9f0fe7df26dadb0a332731683a07a89fde
2014-07-28 18:57:40 +00:00
drh
a4c8ca049e
In vdbesort.c, rename all pointers to sqlite3_file objects "pFd" and use the
...
name "pFile" only for pointers to SortFile objects. Other comment enhancements.
FossilOrigin-Name: 518290a7fc0994f9593c5c3ba5b2610a1b86dae1
2014-07-28 17:18:28 +00:00
drh
ac65196e4d
Improvements to comments in the multi-threaded sorter. Also include a
...
function name change for clarity. And add a test to help show that the
MergeEngine object is only used by a single thread.
FossilOrigin-Name: 9af50a878f67c1c2a4f1520160cc989650d7196a
2014-07-28 14:54:50 +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
e9afc3f279
Remove an incorrect assert() in the sorter.
...
FossilOrigin-Name: b8b66103de8c554cb87df40bf040760ec29f2ae1
2014-05-27 20:19:06 +00:00
drh
de823bedef
In vdbesort.c, change the names of PmaReader variables "pIter" to "pReadr".
...
Other related comment changes. The generated object code should be the same.
FossilOrigin-Name: 99efb235a08784020535a770d7e7d96d9ccee12d
2014-05-20 11:03:53 +00:00
drh
5f4a479048
Rearrange some conditionals and add #if statements to make the code more
...
testable.
FossilOrigin-Name: 17afd77057f8695733a9a60225646c1d8813b1a0
2014-05-16 20:24:51 +00:00
drh
190d695967
Add a pair of sqlite3FaultSim(100) calls to vdbesort.c to facilitate testing
...
of obscure and hard to reach error conditions.
FossilOrigin-Name: cceac14fd83ddd8f868c1767cdc66635607cb159
2014-05-16 17:31:42 +00:00
drh
8f0dab37cb
Use #ifdef logic to avoid an always-true branch when
...
SQLITE_MAX_WORKER_THREADS=0
FossilOrigin-Name: 88cfe6d7de5f19f484304d0db585eac5de6c00ae
2014-05-16 12:18:08 +00:00
drh
6cc3759383
Use #ifdef to omit code that is not used when SQLITE_MAX_WORKER_THREADS is zero.
...
FossilOrigin-Name: 2e8d287d4f41d395a488bf65b20e956b0e311177
2014-05-15 16:56:56 +00:00
drh
b0f935e4da
In the sorter, only use large memory allocations if scratch memory has not
...
been configured. Add #ifdefs to disable unused code when
SQLITE_MAX_WORKER_THREADS is zero. Other sorter changes in support
of testability.
FossilOrigin-Name: d7e2b0d9cb099eda3341bc934bedff9facfe88bd
2014-05-12 15:30:00 +00:00
dan
0d3a4085e5
Fix a race condition in the sorter code.
...
FossilOrigin-Name: 2d2edfe58db101d42a96772b856e6e55b401aab6
2014-05-05 15:58:40 +00:00
dan
d94d4ee7bd
Add tests so that the "coverage-sorter" test permutation covers all branches in vdbesort.c. Fix a few minor problems in the same file.
...
FossilOrigin-Name: bde28b702dabd02269e333535cc41481351c5efc
2014-05-05 09:08:54 +00:00
dan
f7f425d600
Add an extra fault-injection test to sortfault.test. Remove an unreachable branch from vdbesort.c.
...
FossilOrigin-Name: a33a366ba8a0da81ddd895d552a348441ef8529a
2014-05-03 20:43:13 +00:00
dan
e18e90ebaf
Fix a race condition in the sorter.
...
FossilOrigin-Name: 32ccf3ae18531682dfd039fa8df6ad9a907ac455
2014-05-03 19:33:00 +00:00
dan
0d51def29e
Fix a problem in the sorter causing it to return spurious SQLITE_NOMEM errors when configured to use memsys3 or memsys5.
...
FossilOrigin-Name: 3a66c4e1bf311d38668dfcdcd77867feff6db7bd
2014-05-03 14:28:14 +00:00
drh
a09c8855b7
Add the SQLITE_DEFAULT_WORKER_THREADS compile-time option.
...
Fix a NULL-pointer dereference that can occur following OOM.
FossilOrigin-Name: e0dea89b3e9f295f80210fcca007681bf1b08692
2014-05-03 11:22:09 +00:00
dan
012e133772
Remove a faulty assert() from vdbesort.c.
...
FossilOrigin-Name: d95d68aa1d14b750888d50068380cc107f9070df
2014-05-02 16:03:57 +00:00
drh
3de4df27dd
Improvements to comments. Store some extra information in SqliteThread that
...
is useful for debugging.
FossilOrigin-Name: 9fb5e212089d85cdd3b4787dd69c72e6d84560b6
2014-04-24 12:28:28 +00:00
drh
958d261bb8
Fix harmless compiler warnings.
...
FossilOrigin-Name: f8f72ecb9052a4cace1db75879fb8b5131ea4f50
2014-04-18 13:40:07 +00:00
dan
a9f43d735b
Fix build problems in vdbesort.c. Add further comments and changes to make things easier to understand.
...
FossilOrigin-Name: 12b190db1d20c34390c768614b40ff58a9d3b74c
2014-04-17 08:57:17 +00:00
dan
31a0bfde9b
Clarify the purpose of the nField argument passed to sqlite3VdbeSorterInit().
...
FossilOrigin-Name: c0c8cff17b7311bbc4fd081313a5552f927c3833
2014-04-16 19:04:23 +00:00
dan
db30fc4ff2
Change the name of vdbeIncrInit2 to vdbePmaReaderIncrInit. Add a header comment to the same function.
...
FossilOrigin-Name: 6622d87675c1d7992b1e6d52ae7da1007a1568a4
2014-04-16 17:41:22 +00:00
dan
7f0a24b7bf
Rework the way trees of MergeEngine objects are built in vdbesort.c to make it easier to follow. Fix memory leaks that could follow an OOM or IO error. Add various comments to explain functions in vdbesort.c.
...
FossilOrigin-Name: 69026ec7dc3bd3e33bbe17c221a53cf1dd0f8945
2014-04-16 16:43:05 +00:00
dan
22ace89179
Fix some problems to do with OOM conditions in vdbesort.c. Some problems remain.
...
FossilOrigin-Name: 2f94f9ce9bf11f1599bbc640b3fc8c15da588416
2014-04-15 20:52:27 +00:00
dan
1a088a8ef5
Fix further code and documentation issues in vdbesort.c.
...
FossilOrigin-Name: d03f5b8622d304f029f73c7cd0bee3182a81d081
2014-04-15 19:52:34 +00:00
dan
f77ceba594
Improve performance in single-threaded mode by having the final merge pass keys directly to the VDBE, instead of going via a final PMA.
...
FossilOrigin-Name: 02610cd9b77caa2c181210056088beb3ad6ce30f
2014-04-14 18:41:21 +00:00
dan
92a20dde1f
Minor fixes so that builds with SQLITE_MAX_WORKER_THREADS=0 work.
...
FossilOrigin-Name: e400bbbf26cdfe88f6cb231e96cdcddb9a6bcc0f
2014-04-14 08:45:32 +00:00
dan
be3018c18f
Improve use of multiple threads in sqlite3VdbeSorterRewind().
...
FossilOrigin-Name: e1bdc4b810907cc0e55e0c923c8ebc777068cfe0
2014-04-14 07:30:39 +00:00
dan
82a8a9f120
Fix many issues with new code.
...
FossilOrigin-Name: 62c406a042d7246f6df6b943421182a88483b2e3
2014-04-12 19:34:44 +00:00
dan
4be4c406fa
Avoid having the sorter merge too many PMAs at a time when incrementally merging data following a SorterRewind().
...
FossilOrigin-Name: 98bf0307b121b0776a7170108cc8d3f948a7ebfe
2014-04-11 19:43:07 +00:00
dan
d30ab3d9dd
Experimental multi-threaded sorting changes to allow the sorter to begin returning items to the VDBE before all data is sorted.
...
FossilOrigin-Name: f9d5e09afaf64d68a0e461c1c2f38179bcea4b1f
2014-04-09 20:04:17 +00:00
drh
6b5d4759ce
Change vdbeSorterExtendFile() so that it makes a best effort to create the
...
PMA file of the desired size, but does not return an error if unable.
FossilOrigin-Name: 217814bc4b53fab7bdad433e24e8aef8998c38fe
2014-04-04 02:13:26 +00:00
dan
8930c2ab0c
Fix an integer overflow problem in the sorter.
...
FossilOrigin-Name: 9d3351b8d713232133dad149c73fb2a27c72abb1
2014-04-03 16:25:29 +00:00
dan
6e4cc55e1f
Fix minor errors causing compilation to fail with SQLITE_MAX_WORKER_THREADS set to a value greater than zero.
...
FossilOrigin-Name: 0561272abf357a2f4709f6c02866e570d19cd344
2014-04-03 14:29:08 +00:00
drh
a634fb1577
Refactor local object and method names in vdbesort.c so that their names
...
more closely reflect their actual use.
FossilOrigin-Name: d284e30eb1db144965fa85566e4234e30464350b
2014-04-03 02:54:27 +00:00
drh
ac4f0039c0
Add a big introductory comment to vdbesort.c explaining its operation at a
...
high level. Also adjust some symbolic names and fix other comment issues in
that file.
FossilOrigin-Name: eef60f1bf54fcdc7b32f96ebb87a9a0bf0776e8b
2014-04-02 18:58:49 +00:00
dan
dd95d30f82
Fix some problems with OOM handling in vdbesort.c.
...
FossilOrigin-Name: 47e702bd8392bc50c4edaf6a2c8c499af87b520e
2014-04-02 15:15:25 +00:00
drh
8d8f56296b
Change the name of the SorterThread object to "SortSubtask" to avoid confusion
...
with the SQLiteThread object.
FossilOrigin-Name: 4ee2d910fbbed8d4def15e4e99ee225839f3a739
2014-04-02 14:38:14 +00:00
dan
fad9f9a8a6
When sorting data for a CREATE INDEX statement in single-threaded mode, assume that keys are delivered to the sorter in primary key order. Also fix various comments that had fallen out of date.
...
FossilOrigin-Name: 821d1ac4504243fa13b9e3c0d56361ad9fb80d78
2014-04-01 18:41:51 +00:00
dan
578e1ca8d7
Even if compile time option SQLITE_MAX_WORKER_THREADS is set to one or greater, set the default number of worker threads to zero. Distribute data more evenly between threads in sqlite3VdbeSorterWrite() to improve performance when sorting large amounts of data. Add new test file sort2.test.
...
FossilOrigin-Name: 643c86a056168e39fcb7f39b8a72731f1eb246db
2014-04-01 15:38:44 +00:00