/ File History
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

History of src/vdbesort.c

2020-01-28
20:27
[2be76d26] part of check-in [59a31b16] Faster decoding of 32-bit variable-length integers in cases were we do not need to know the number of bytes in the encoding. (check-in: [59a31b16] user: drh branch: trunk, size: 96397)
2019-10-07
20:33
[a3be032c] part of check-in [5d76dbc5] Omit a pointless memory allocation in vdbeSorterSort(). (check-in: [5d76dbc5] user: drh branch: trunk, size: 96391)
2019-08-12
16:36
[da75f505] part of check-in [07babb0f] Experimental implementation of NULLS FIRST/LAST. This branch still has problems - the most significant of which is that ORDER BY clauses with a non-default NULLS FIRST/LAST qualifier can never use an index. (check-in: [07babb0f] user: dan branch: nulls-last, size: 96488)
2019-07-16
19:44
[3531ae3a] part of check-in [9e664585] Add new assert() statements in an attempt to help static analyzers avoid false-positives. (check-in: [9e664585] user: drh branch: trunk, size: 96267)
2019-04-16
11:21
[66592d47] part of check-in [af61a2fc] Avoid a sanitizer error (pointer arithmatic overflow) in vdbesort.c. (check-in: [af61a2fc] user: dan branch: trunk, size: 96217)
2019-04-13
04:01
[31c7794a] part of check-in [0b6ae032] Enforce the SQLITE_LIMIT_COLUMN limit on virtual tables. (check-in: [0b6ae032] user: drh branch: trunk, size: 96119)
2018-08-21
12:46
[90aad5a9] part of check-in [38f9ce65] Further attempts to reduce the number of false-positives genenerated by static analysis tools. (check-in: [38f9ce65] user: drh branch: trunk, size: 96069)
2017-08-28
17:26
[789ad666] part of check-in [cc440400] Remove the rarely-used scratch memory allocator. This makes the code smaller, faster, and easier to maintain. In place of the scratch allocator, add the SQLITE_CONFIG_SMALL_MALLOC configuration option that provides a hint to SQLite that large memory allocations should be avoided. (check-in: [cc440400] user: drh branch: begin-concurrent-branch-3.19, size: 95936)
15:51
[731a09e5] part of check-in [54b00024] Remove the rarely-used scratch memory allocator. This makes the code smaller, faster, and easier to maintain. In place of the scratch allocator, add the SQLITE_CONFIG_SMALL_MALLOC configuration option that provides a hint to SQLite that large memory allocations should be avoided. (check-in: [54b00024] user: drh branch: trunk, size: 95881)
2017-08-02
22:43
[fea2bea2] part of check-in [aea5990e] In the KeyInfo object, refactor the nField and nXField elements into nKeyField and nAllField, which are more useful and run a little faster. (check-in: [aea5990e] user: drh branch: trunk, size: 95965)
2017-05-30
18:34
[f512c68d] part of check-in [e972a386] Change sqlite3BtreeNext() and sqlite3BtreePrevious() so that they return SQLITE_DONE if they have already reached the end (or beginning) of the table. This gives a performance increase and size reduction. (check-in: [e972a386] user: drh branch: trunk, size: 96020)
2017-05-27
22:42
[f26595df] part of check-in [542dc4c5] Smaller and faster vdbeSorterCompareText(). (check-in: [542dc4c5] user: drh branch: trunk, size: 95815)
2017-04-03
12:04
[e72fe02a] part of check-in [84fa069c] Slightly smaller and faster implementation for vdbeSorterCompareInt(). (check-in: [84fa069c] user: drh branch: trunk, size: 95846)
2016-12-21
19:45
[eda25cb2] part of check-in [f7ab01f2] Simplifications to the way UnpackedRecord objects are allocated. Smaller and faster code that also fixes a subtle (currently unreachable) bug. (check-in: [f7ab01f2] user: drh branch: trunk, size: 95912)
2016-12-10
12:58
[bb34eed4] part of check-in [8165f88b] Reorder the fields in the VdbeCursor object so that those that need to be bulk zeroed on allocation are grouped at the beginning, and the memset() only runs over those fields that really need it. (check-in: [8165f88b] user: drh branch: trunk, size: 96076)
2016-05-20
14:54
[91fda390] part of check-in [9033afbb] Optimizations to link list merge sort code in vdbesort.c, pcache.c, and rowset.c. Resulting binaries are 10 bytes smaller and use 0.03% fewer CPU cycles. (check-in: [9033afbb] user: drh branch: trunk, size: 96075)
2016-04-14
15:44
[0a8f9836] part of check-in [79147dca] Correctly interpret negative "PRAGMA cache_size" values when determining the cache-size used for sorting large amounts of data (i.e. the functionality in vdbesort.c). (check-in: [79147dca] user: dan branch: trunk, size: 96013)
2016-02-19
14:20
[307460bf] part of check-in [398522e6] Fix a harmless uninitialized variable access. (check-in: [398522e6] user: drh branch: trunk, size: 95795)
2016-02-13
23:43
[74c22db6] part of check-in [6a9c4a3e] Enhance ability to debug out-of-memory errors. (check-in: [6a9c4a3e] user: mistachkin branch: noMemBkpt, size: 95791)
2016-01-29
08:38
[ef3c6d1f] part of check-in [2910ef64] Avoid two more instances of pointer arithmetic on freed pointers. (check-in: [2910ef64] user: dan branch: trunk, size: 95701)
2016-01-25
22:08
[3bb1f1f0] part of check-in [7c49a947] Fix a compiler warning about doing pointer arithmetic involving a NULL pointer even though the result of computation is never used. (check-in: [7c49a947] user: drh branch: trunk, size: 95692)
2016-01-12
14:10
[0971557e] part of check-in [4bb2c1df] Fix a harmless use of an uninitialized variable following system errors in the multi-threaded sorter. (check-in: [4bb2c1df] user: drh branch: trunk, size: 95653)
2015-12-17
17:30
[90a3545e] part of check-in [98b710c3] Reduce the size of the VdbeCursor object by a pointer (the pBt pointer used for ephemeral tables). (check-in: [98b710c3] user: drh branch: optimize-vdbecursor, size: 95658)
2015-11-20
19:22
[a7ec02da] part of check-in [9b1d174d] Refactor the VdbeCursor object. It is now slightly smaller and faster and is easier to understand. (check-in: [9b1d174d] user: drh branch: trunk, size: 95652)
2015-10-14
20:34
[8b23930a] part of check-in [1c46c194] Fix harmless compiler warnings. (check-in: [1c46c194] user: mistachkin branch: trunk, size: 95237)
2015-05-02
12:40
[f5009e7a] part of check-in [78c7ec95] Reorganize some multi-threaded code in vdbesort.c so that full MC/DC test coverage does not depend on the outcome of a race condition. (check-in: [78c7ec95] user: dan branch: trunk, size: 95229)
2015-04-13
12:45
[2e7f6834] part of check-in [f666ef06] Remove an unreachable branch from the vdbeSorterCompareInt() routine. (check-in: [f666ef06] user: drh branch: trunk, size: 94115)
2015-04-11
20:44
[5a729a15] part of check-in [79326d6e] Optimizations for VACUUM, CREATE INDEX and some cases of ORDER BY. (check-in: [79326d6e] user: dan branch: trunk, size: 94103)
20:20
[a9d39d99] part of check-in [acca97ef] Fix a problem with sorting large amounts of partially ordered data. (check-in: [acca97ef] user: dan branch: trunk, size: 88726)
2015-04-02
09:06
[74a41fcd] part of check-in [80a00539] Fix a problem in vdbesort.c to do with caching unpacked records. (check-in: [80a00539] user: dan branch: sorter-opt, size: 94214)
2015-03-30
12:06
[7b368466] part of check-in [601e7b6b] Improve performance of multi-field sorts where the first field has a low cardinality. (check-in: [601e7b6b] user: dan branch: sorter-opt, size: 94211)
09:58
[f283b28d] part of check-in [b58191e9] Remove some unnecessary code from vdbesort.c. (check-in: [b58191e9] user: dan branch: sorter-opt, size: 93458)
2015-03-28
19:56
[b3d16bbd] part of check-in [24fe9f25] Further optimizations for sorting records that begin with integer or text values. (check-in: [24fe9f25] user: dan branch: sorter-opt, size: 93656)
2015-03-26
11:55
[a8d82ed4] part of check-in [ce5ad17c] Optimize cases where all the sorter is sorting a set of records that all begin with integer values, or that all begin with text values to be compared using BINARY. (check-in: [ce5ad17c] user: dan branch: sorter-opt, size: 90205)
2015-03-18
16:00
[919717d7] part of check-in [49ea2cde] Add another sqlite3FaultSim() to the multi-threaded sorter logic to improve testability. (check-in: [49ea2cde] user: drh branch: trunk, size: 88837)
2015-01-12
17:56
[6d64c544] part of check-in [11e81ac2] Add an assert() in order to calm a scan-build warning. (check-in: [11e81ac2] user: drh branch: trunk, size: 88780)
2015-01-02
21:54
[560bdfd9] part of check-in [e0de5807] Fix a harmless compiler warning. (check-in: [e0de5807] user: drh branch: trunk, size: 88743)
15:55
[fc1aa0d1] part of check-in [acb0d1e8] Add the SQLITE_CONFIG_PMASZ start-time option. (check-in: [acb0d1e8] user: drh branch: trunk, size: 88733)
2014-12-30
14:40
[80e40d88] part of check-in [77664841] If the sorter uses mmap'd temp files, ensure all pages of the temp file have been allocated before it is accessed. Otherwise, a disk-full condition might result in a SIGBUS exception. (check-in: [77664841] user: dan branch: trunk, size: 88904)
2014-12-09
19:16
[c150803a] part of check-in [1ba8911c] Lower the default SQLITE_SORTER_PMASZ value back to 10, where it has been for the past couple of releases. Applications that need a larger value can set one. (check-in: [1ba8911c] user: drh branch: trunk, size: 88818)
14:42
[db015e20] part of check-in [b05340fe] Increase the default minimum PMA size for multi-threaded sorting from 10x the page size to 250x the page size. Provide the SQLITE_SORTER_PMASZ compile-time option to change this default. (check-in: [b05340fe] user: drh branch: trunk, size: 88819)
2014-11-25
18:59
[42c166f7] part of check-in [62382719] Fix an integer overflow bug in vdbesort.c. (check-in: [62382719] user: dan branch: trunk, size: 88778)
2014-11-04
17:23
[87f39234] part of check-in [d423349d] Add various requirements evidence marks for sqlite3_config() options. (check-in: [d423349d] user: drh branch: trunk, size: 88525)
2014-11-03
14:46
[daf87ea5] part of check-in [a518bc33] Use exponential buffer size growth in StrAccum, as long as the size does not grow to large, to avoid excess memory allocation resize operations. Also, document the fact that setting scratch memory causes SQLite to try to avoid large memory allocations. (check-in: [a518bc33] user: drh branch: trunk, size: 88520)
2014-10-16
21:39
[975aeffa] part of check-in [06c576c1] Work around MSVC not being able to deduce that a local variable was initialized in a called function. (check-in: [06c576c1] user: mistachkin branch: trunk, size: 88635)
2014-09-19
19:43
[5c1bacf9] part of check-in [3ab20ba1] Do not attempt to extend the temp file if VFS version 3 is not supported and hence memory mapped I/O is unavailable. (check-in: [3ab20ba1] user: drh branch: trunk, size: 88631)
00:43
[75c66c2f] part of check-in [5b9b8987] Add the sqlite3VdbeMemClearAndResize() interface to be used in place of sqlite3VdbeMemGrow(). A C++ style comment was left in this check-in by mistake, and so it has been moved into a branch to avoid problems in any future bisects on windows. (check-in: [5b9b8987] user: drh branch: Cplusplus-comment, size: 88631)
2014-09-16
14:37
[09efa5e5] part of check-in [8239c35a] Reduce the number of arguments to RecordCompare functions from 4 to 3, resulting in a small performance increase. (check-in: [8239c35a] user: drh branch: micro-optimizations, size: 88624)
2014-09-15
16:50
[a7a40cec] part of check-in [dedaa6fb] Avoid attempting to call the xFetch() method of an sqlite3_io_methods object with a version number less than 3. (check-in: [dedaa6fb] user: dan branch: trunk, size: 88630)
15:34
[36ac0900] part of check-in [55b8011d] Merge latest trunk changes with this branch. (check-in: [55b8011d] user: dan branch: ota-update, size: 88586)
2014-09-06
16:39
[ab39574e] part of check-in [e62aab5e] Fix typos in comments. No code changes. (check-in: [e62aab5e] user: peter.d.reid branch: trunk, size: 88523)
2014-09-04
11:03
[7c45bfcd] part of check-in [071f7f2d] Avoid calling sqlite3OsFetch() on a file-handle for which the xFetch method is NULL. (check-in: [071f7f2d] user: dan branch: ota-update, size: 88590)
2014-09-01
17:36
[02646a9f] part of check-in [b1c0f0bc] 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. (check-in: [b1c0f0bc] user: drh branch: trunk, size: 88527)
2014-08-29
16:20
[f92628f3] part of check-in [1b598c68] Add SQLITE_LIMIT_WORKER_THREADS for controlling the maximum number of worker threads. (check-in: [1b598c68] user: drh branch: threads, size: 88554)
2014-08-25
23:44
[50fe3442] part of check-in [e3305d4b] 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. (check-in: [e3305d4b] user: drh branch: threads, size: 88338)
15:13
[3a76f51e] part of check-in [29c5e8a7] Query or change the maximum number of worker threads allowed on each database connection separately using the "PRAGMA threads" command. (check-in: [29c5e8a7] user: drh branch: threads, size: 88161)
2014-07-30
18:47
[b9a83068] part of check-in [655d8cfc] Add a new sqlite3FaultSim() call to vdbePmaReaderSeek() to facilitate tests of error handling in the sorter. (check-in: [655d8cfc] user: drh branch: threads, size: 88094)
17:21
[e37e4942] part of check-in [721cd965] Mark some invariants in the vdbesort.c logic when SQLITE_MAX_WORKER_THREADS==0. (check-in: [721cd965] user: drh branch: threads, size: 88039)
14:44
[cab84b48] part of check-in [5b50a838] Merge recent trunk changes, and especially the fix for the CREATE UNIQUE INDEX problem of ticket [9a6daf340df99ba9]. (check-in: [5b50a838] user: drh branch: threads, size: 87416)
13:56
[f7f5563b] part of check-in [6b785e92] 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]. (check-in: [6b785e92] user: drh branch: trunk, size: 36400)
2014-07-29
18:46
[2198e33d] part of check-in [3175e366] Fix unreachable branches in the threads.c module. (check-in: [3175e366] user: drh branch: threads, size: 87462)
17:22
[48b99b15] part of check-in [216d21d0] Fix a harmless compiler warning. (check-in: [216d21d0] user: drh branch: threads, size: 87447)
2014-07-28
20:16
[e78efeed] part of check-in [f2407a40] Remove an unnecessary parameter from vdbeMergeEngineStep(). Rename a couple other routines to be more descriptive of what they do. (check-in: [f2407a40] user: drh branch: threads, size: 87457)
19:58
[143de4b9] part of check-in [5b084a2d] Rename vdbeIncrMergerInit() to vdbeMergeEngineInit() - a much more accurate name. (check-in: [5b084a2d] user: drh branch: threads, size: 87545)
18:57
[2ee08671] part of check-in [09d50d9f] In vdbesort.c, rename vdbeSorterDoCompare() to vdbeMergeEngineCompare() and move it closer to the one place where it is called. Other minor comment changes. (check-in: [09d50d9f] user: drh branch: threads, size: 87541)
17:18
[cbd9f27e] part of check-in [518290a7] 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. (check-in: [518290a7] user: drh branch: threads, size: 87001)
14:54
[ef998096] part of check-in [9af50a87] 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. (check-in: [9af50a87] user: drh branch: threads, size: 86450)
2014-05-29
20:24
[e2784e2e] part of check-in [416cb091] Merge changes from the trunk into the threads branch. (check-in: [416cb091] user: drh branch: threads, size: 85339)
2014-05-27
20:19
[44441d73] part of check-in [b8b66103] Remove an incorrect assert() in the sorter. (check-in: [b8b66103] user: drh branch: trunk, size: 36456)
2014-05-20
11:03
[a8b8798f] part of check-in [99efb235] In vdbesort.c, change the names of PmaReader variables "pIter" to "pReadr". Other related comment changes. The generated object code should be the same. (check-in: [99efb235] user: drh branch: threads, size: 85384)
2014-05-19
19:26
[5b3e6963] part of check-in [aa7e2041] Fix harmless compiler warnings in MSVC. (check-in: [aa7e2041] user: drh branch: safer-malloc, size: 36506)
15:16
[20246077] part of check-in [17349a49] Changes to help ensure that a multiplication does not overflow when computing the number of bytes needed for a memory allocation, and cause a malfunction. No problems existing problems were discovered. However, these changes should help to ensure that no problems arise in the future. (check-in: [17349a49] user: drh branch: safer-malloc, size: 36501)
2014-05-16
20:24
[15d1405f] part of check-in [17afd770] Rearrange some conditionals and add #if statements to make the code more testable. (check-in: [17afd770] user: drh branch: threads, size: 85150)
17:31
[f126a837] part of check-in [cceac14f] Add a pair of sqlite3FaultSim(100) calls to vdbesort.c to facilitate testing of obscure and hard to reach error conditions. (check-in: [cceac14f] user: drh branch: threads, size: 84822)
12:18
[7946115f] part of check-in [88cfe6d7] Use #ifdef logic to avoid an always-true branch when SQLITE_MAX_WORKER_THREADS=0 (check-in: [88cfe6d7] user: drh branch: threads, size: 84758)
2014-05-15
16:56
[0cb40c33] part of check-in [2e8d287d] Use #ifdef to omit code that is not used when SQLITE_MAX_WORKER_THREADS is zero. (check-in: [2e8d287d] user: drh branch: threads, size: 84748)
2014-05-12
15:30
[0daa0299] part of check-in [d7e2b0d9] 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. (check-in: [d7e2b0d9] user: drh branch: threads, size: 84652)
2014-05-05
15:58
[b3607043] part of check-in [2d2edfe5] Fix a race condition in the sorter code. (check-in: [2d2edfe5] user: dan branch: threads, size: 84153)
09:08
[af752fa4] part of check-in [bde28b70] Add tests so that the "coverage-sorter" test permutation covers all branches in vdbesort.c. Fix a few minor problems in the same file. (check-in: [bde28b70] user: dan branch: threads, size: 83716)
2014-05-03
20:43
[db67b5b5] part of check-in [a33a366b] Add an extra fault-injection test to sortfault.test. Remove an unreachable branch from vdbesort.c. (check-in: [a33a366b] user: dan branch: threads, size: 83439)
19:33
[c443cdf0] part of check-in [32ccf3ae] Fix a race condition in the sorter. (check-in: [32ccf3ae] user: dan branch: threads, size: 83527)
14:28
[3e8827bb] part of check-in [3a66c4e1] Fix a problem in the sorter causing it to return spurious SQLITE_NOMEM errors when configured to use memsys3 or memsys5. (check-in: [3a66c4e1] user: dan branch: threads, size: 82807)
11:22
[d205b56d] part of check-in [e0dea89b] Add the SQLITE_DEFAULT_WORKER_THREADS compile-time option. Fix a NULL-pointer dereference that can occur following OOM. (check-in: [e0dea89b] user: drh branch: threads, size: 82779)
2014-05-02
16:22
[6bcf73fb] part of check-in [d4d39638] Failure to extend a temp file for use with mmap() in vdbesort.c is benign. (check-in: [d4d39638] user: drh branch: orderby-planning, size: 45184)
16:03
[0095545a] part of check-in [d95d68aa] Remove a faulty assert() from vdbesort.c. (check-in: [d95d68aa] user: dan branch: threads, size: 82737)
15:25
[d0fc5ecd] part of check-in [9196ce40] Fix a faulty assert() statement. (check-in: [9196ce40] user: drh branch: orderby-planning, size: 45218)
2014-04-24
16:25
[469ae9af] part of check-in [bf09ce24] Improved header comment on the vdbesort.c module. No changes to code. (check-in: [bf09ce24] user: drh branch: orderby-planning, size: 45216)
12:28
[2b13026e] part of check-in [9fb5e212] Improvements to comments. Store some extra information in SqliteThread that is useful for debugging. (check-in: [9fb5e212] user: drh branch: threads, size: 82799)
2014-04-18
13:40
[f93c8aaf] part of check-in [f8f72ecb] Fix harmless compiler warnings. (check-in: [f8f72ecb] user: drh branch: threads, size: 82615)
2014-04-17
08:57
[a41721a8] part of check-in [12b190db] Fix build problems in vdbesort.c. Add further comments and changes to make things easier to understand. (check-in: [12b190db] user: dan branch: threads, size: 82457)
2014-04-16
19:04
[fcd15eb4] part of check-in [c0c8cff1] Clarify the purpose of the nField argument passed to sqlite3VdbeSorterInit(). (check-in: [c0c8cff1] user: dan branch: threads, size: 80124)
17:41
[70e42f93] part of check-in [6622d876] Change the name of vdbeIncrInit2 to vdbePmaReaderIncrInit. Add a header comment to the same function. (check-in: [6622d876] user: dan branch: threads, size: 79253)
16:43
[30505a84] part of check-in [69026ec7] 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. (check-in: [69026ec7] user: dan branch: threads, size: 78879)
2014-04-15
20:52
[56c66377] part of check-in [2f94f9ce] Fix some problems to do with OOM conditions in vdbesort.c. Some problems remain. (check-in: [2f94f9ce] user: dan branch: threads, size: 75731)
19:52
[ceb8e160] part of check-in [d03f5b86] Fix further code and documentation issues in vdbesort.c. (check-in: [d03f5b86] user: dan branch: threads, size: 75407)
2014-04-14
18:41
[15f59dc5] part of check-in [02610cd9] Improve performance in single-threaded mode by having the final merge pass keys directly to the VDBE, instead of going via a final PMA. (check-in: [02610cd9] user: dan branch: threads-experimental, size: 71102)
08:45
[364cb94c] part of check-in [e400bbbf] Minor fixes so that builds with SQLITE_MAX_WORKER_THREADS=0 work. (check-in: [e400bbbf] user: dan branch: threads-experimental, size: 70325)
07:30
[b047de6a] part of check-in [e1bdc4b8] Improve use of multiple threads in sqlite3VdbeSorterRewind(). (check-in: [e1bdc4b8] user: dan branch: threads-experimental, size: 70240)
2014-04-12
19:34
[bc0d90e0] part of check-in [62c406a0] Fix many issues with new code. (check-in: [62c406a0] user: dan branch: threads-experimental, size: 69093)
2014-04-11
19:43
[2984e362] part of check-in [98bf0307] Avoid having the sorter merge too many PMAs at a time when incrementally merging data following a SorterRewind(). (check-in: [98bf0307] user: dan branch: threads-experimental, size: 70966)
2014-04-09
20:04
[26823b62] part of check-in [f9d5e09a] Experimental multi-threaded sorting changes to allow the sorter to begin returning items to the VDBE before all data is sorted. (check-in: [f9d5e09a] user: dan branch: threads-experimental, size: 62972)
2014-04-07
18:44
[07c29a5a] part of check-in [cbfc0f6d] Experimental multi-threaded sorting changes to begin merging PMAs before SorterRewind() is called. (check-in: [cbfc0f6d] user: dan branch: abandoned, size: 58722)
2014-04-04
02:13
[8da916fc] part of check-in [217814bc] 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. (check-in: [217814bc] user: drh branch: threads, size: 56992)
2014-04-03
16:25
[252d7ab7] part of check-in [9d3351b8] Fix an integer overflow problem in the sorter. (check-in: [9d3351b8] user: dan branch: threads, size: 57037)
14:29
[5e7ed44b] part of check-in [0561272a] Fix minor errors causing compilation to fail with SQLITE_MAX_WORKER_THREADS set to a value greater than zero. (check-in: [0561272a] user: dan branch: threads, size: 56867)
02:54
[a4e349ff] part of check-in [d284e30e] Refactor local object and method names in vdbesort.c so that their names more closely reflect their actual use. (check-in: [d284e30e] user: drh branch: threads, size: 56849)
2014-04-02
18:58
[523283d7] part of check-in [eef60f1b] 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. (check-in: [eef60f1b] user: drh branch: threads, size: 57109)
15:15
[e830ea4a] part of check-in [47e702bd] Fix some problems with OOM handling in vdbesort.c. (check-in: [47e702bd] user: dan branch: threads, size: 53303)
14:38
[0cb83fc3] part of check-in [4ee2d910] Change the name of the SorterThread object to "SortSubtask" to avoid confusion with the SQLiteThread object. (check-in: [4ee2d910] user: drh branch: threads, size: 53270)
14:16
[ea221800] part of check-in [abbdb925] Incorrect change to a comment. (check-in: [abbdb925] user: drh branch: mistake, size: 53313)
2014-04-01
18:41
[be494ad4] part of check-in [821d1ac4] 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. (check-in: [821d1ac4] user: dan branch: threads, size: 53205)
15:38
[375919a7] part of check-in [643c86a0] 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. (check-in: [643c86a0] user: dan branch: threads, size: 53395)
10:19
[35c27063] part of check-in [59cd5229] Fix a problem with OOM handling in the sorter code. (check-in: [59cd5229] user: dan branch: threads, size: 53099)
2014-03-31
19:57
[b4d6133b] part of check-in [2774710d] Add the SQLITE_MAX_WORKER_THREADS compile time option. And the SQLITE_CONFIG_WORKER_THREADS sqlite3_config() switch. (check-in: [2774710d] user: dan branch: threads, size: 52955)
2014-03-29
19:48
[d42a32a4] part of check-in [83a105c8] Changes to make the multi-threaded sorter sort stably. (check-in: [83a105c8] user: dan branch: threads-closed, size: 54149)
10:01
[2881297f] part of check-in [18d1b402] Fix a broken assert() in vdbesort.c. (check-in: [18d1b402] user: dan branch: threads, size: 52636)
09:34
[80812ceb] part of check-in [a683c05f] Fix a problem in vdbesort.c causing spurious SQLITE_NOMEM errors when using memsys3 or memsys5. (check-in: [a683c05f] user: dan branch: threads, size: 52636)
06:27
[d7ef3c43] part of check-in [fc4d04e6] Add the optimization to avoid some unnecessary calls to sqlite3VdbeRecordUnpack() added to the trunk by [707ea170b3]. (check-in: [fc4d04e6] user: dan branch: threads, size: 52552)
2014-03-28
19:47
[ad0f9f71] part of check-in [58f7ca29] Fix a compiler warning and an after-OOM memory leak. (check-in: [58f7ca29] user: drh branch: orderby-planning, size: 42822)
19:18
[01068b89] part of check-in [4c7fb542] Merge latest changes from orderby-planning branch. (check-in: [4c7fb542] user: dan branch: threads, size: 50418)
2014-03-27
19:25
[08d5e1ee] part of check-in [81987c8c] Instead of allocating a single large buffer at the beginning of each sort operation, start with a small buffer and extend it using realloc() as required. (check-in: [81987c8c] user: dan branch: orderby-planning, size: 42791)
17:23
[d46f384a] part of check-in [f4ac1bf2] Use xFetch() to access temporary files in vdbesort.c. Use a single large allocation instead of many small allocations when accumulating records in vdbesort.c. This is an interim commit - it allocates a buffer the size of the page-cache every time data is sorted. (check-in: [f4ac1bf2] user: dan branch: orderby-planning, size: 40085)
2014-03-25
17:07
[691f2186] part of check-in [d3e640af] Fix a problem in the code added by [707ea170b3] causing vdbesort.c to sort unstably. (check-in: [d3e640af] user: dan branch: orderby-planning, size: 37272)
14:12
[c3e427de] part of check-in [1cab8357] Enable four sorting threads by default in the command-line shell. (check-in: [1cab8357] user: drh branch: threads, size: 43625)
13:17
[0fbaf5b3] part of check-in [b415dfb6] Merge all fixes and enhancements from trunk. (check-in: [b415dfb6] user: drh branch: threads, size: 43625)
2014-03-24
20:19
[46e50c6b] part of check-in [3f90abdd] Omit the sequence value from sorter records used by GROUP BY queries that cannot use an index. (check-in: [3f90abdd] user: dan branch: orderby-planning, size: 36556)
2014-03-20
20:56
[4abb7c0f] part of check-in [eca35871] Merge trunk fixes for "x IN (?)" handling. (check-in: [eca35871] user: drh branch: orderby-planning, size: 36501)
15:14
[0fef5fa8] part of check-in [b1435f26] Fix harmless compiler warnings. (check-in: [b1435f26] user: drh branch: trunk, size: 36134)
2014-03-19
23:42
[17336685] part of check-in [e4bfffb9] Merge the vdbesort.c optimization from trunk. (check-in: [e4bfffb9] user: drh branch: orderby-planning, size: 36491)
20:01
[0a9e5e63] part of check-in [707ea170] Avoid some unnecessary calls to sqlite3VdbeRecordUnpack() that were being made when merging data from two or more temp files together in vdbesort.c (check-in: [707ea170] user: dan branch: trunk, size: 36124)
17:41
[553537f6] part of check-in [7ce2daaf] Make it possible for block-sort to use the OP_SorterOpen sorter in addition to a generic OP_OpenEphemeral. (check-in: [7ce2daaf] user: drh branch: orderby-planning, size: 34646)
2014-03-17
15:43
[1d973fcd] part of check-in [ff0b5c85] Add an experimental multi-threaded capability to vdbesorter.c. (check-in: [ff0b5c85] user: dan branch: threads, size: 43206)
2014-03-01
19:44
[46801acb] part of check-in [3861e853] Remove the vdbeRecordCompareLargeHeader function. Fix some other details. (check-in: [3861e853] user: dan branch: experimental, size: 34279)
2014-02-27
20:44
[72290f12] part of check-in [57089374] Further changes to sqlite3VdbeRecordCompare(). (check-in: [57089374] user: dan branch: experimental, size: 34498)
2014-02-25
21:01
[5144d84b] part of check-in [85206e0b] Attempt to speed up sqlite3VdbeRecordCompare() by various means. This code is in an interim state. (check-in: [85206e0b] user: dan branch: experimental, size: 34276)
2013-11-01
22:02
[9d83601f] part of check-in [302a8139] Size KeyInfo objects so that IdxInserts always compare the correct number of fields. (check-in: [302a8139] user: drh branch: omit-rowid, size: 34283)
2013-05-28
12:11
[3937e06b] part of check-in [a0d5cc93] Many small harmless comment changes. Removal of obsolete comments and fixing misspelled words. No changes to code. (check-in: [a0d5cc93] user: drh branch: trunk, size: 34198)
2013-03-24
22:56
[4fad6407] part of check-in [8b44d6fb] Remove the SQLITE_OMIT_MERGE_SORT compile-time option and its related code. The merge sorter is now a required component. (check-in: [8b44d6fb] user: drh branch: trunk, size: 34198)
2012-10-26
19:22
[c61ca318] part of check-in [e24ba5be] Fix a 32-bit integer overflow problem that could cause an error in a CREATE INDEX statement that writes more than 16GB of data. (check-in: [e24ba5be] user: dan branch: trunk, size: 34274)
2012-08-22
15:16
[acaefad5] part of check-in [acdc7d12] Do not let the multi-core sorter use lookaside memory, which is not thread-safe. (check-in: [acdc7d12] user: drh branch: threads-sort-ex1, size: 37350)
2012-08-16
20:05
[3945ae71] part of check-in [11dd05e5] Attempt to use two cores to do sorting. Unfortunately, instead of making sorts go faster as was hoped, this changes slows sorting down by about 10%. (Later:) The previous measurement was compiled using -pg. When compiled using -Os, this new code is roughly 10% faster than the original. (check-in: [11dd05e5] user: drh branch: threads-sort-ex1, size: 36805)
2012-08-15
15:57
[e4aa1c16] part of check-in [2bb8c492] Experimental change to speed up ORDER BY clauses that sort based on a single expression. (check-in: [2bb8c492] user: dan branch: sorter-exp, size: 40282)
2012-08-14
19:04
[0dc1b274] part of check-in [a5431c86] Silence three harmless compiler warnings in vdbesort.c. (check-in: [a5431c86] user: drh branch: trunk, size: 34223)
2012-08-07
22:53
[bd5ce83f] part of check-in [de804f4c] Simplifications to the sorter to support full-coverage testing. (check-in: [de804f4c] user: drh branch: trunk, size: 34204)
2012-08-06
19:28
[4897215f] part of check-in [e1e9cb08] Merge the sorter-coalesce-writes branch into the trunk. This improves CREATE INDEX performance on some platforms. (check-in: [e1e9cb08] user: dan branch: trunk, size: 34459)
19:12
[1de867bf] part of check-in [2e5741f7] Fix a crash that could follow an OOM condition. (check-in: [2e5741f7] user: dan branch: sorter-coalesce-writes, size: 34435)
18:10
[ad307856] part of check-in [214f8cda] Update sorter-coalesce-writes branch with latest trunk changes. (check-in: [214f8cda] user: dan branch: sorter-coalesce-writes, size: 34399)
2012-07-26
09:21
[106796ce] part of check-in [f4b3fded] Update some comments in vdbesort.c. (check-in: [f4b3fded] user: dan branch: sorter-coalesce-writes, size: 34357)
2012-07-24
19:46
[628b2bc0] part of check-in [d8da26f1] Mark parameters to sorter interfaces as const where appropriate. (check-in: [d8da26f1] user: drh branch: trunk, size: 29343)
2012-07-23
20:10
[bd37dbd4] part of check-in [4ba266fc] Fix an edge case in vdbesort.c. (check-in: [4ba266fc] user: dan branch: sorter-coalesce-writes, size: 32886)
19:25
[6822221a] part of check-in [55e47ef3] Modify the code in vdbesort.c so that most reads and writes to temporary files are aligned page-sized blocks. (check-in: [55e47ef3] user: dan branch: sorter-coalesce-writes, size: 32769)
2012-02-02
21:02
[b25814d3] part of check-in [f14e7f29] More structure packing for smaller objects and less memory usage. (check-in: [f14e7f29] user: drh branch: trunk, size: 29301)
2011-09-14
18:19
[468d43c0] part of check-in [3035dc1c] Remove 'const' from a variable that might actually be written when an OOM error occurs. Also, fix a couple MSVC/Win32 compiler warnings. (check-in: [3035dc1c] user: mistachkin branch: trunk, size: 29301)
13:41
[8dd9c1ac] part of check-in [a1f3aeeb] Remove unused parameters from internal routines in vdbesort.c. This is an additional simplification made possible by recent optimizations. (check-in: [a1f3aeeb] user: drh branch: trunk, size: 29210)
13:23
[df1953a4] part of check-in [607aba6c] Remove code from vdbesort.c that was made unreachable by the recent sqlite3VdbeRecordUnpack() optimizations. (check-in: [607aba6c] user: drh branch: trunk, size: 29295)
2011-09-05
20:16
[667bc652] part of check-in [d0712dfb] Fix a minor performance regression in btreeMoveto(). (check-in: [d0712dfb] user: dan branch: trunk, size: 30064)
14:20
[4f326570] part of check-in [f115b230] Refactor the sqlite3VdbeRecordUnpack() interface to better accommodate the vdbesort.c module. (check-in: [f115b230] user: dan branch: trunk, size: 30016)
2011-09-04
01:27
[14d12756] part of check-in [6b657ae7] Fix a compiler warning about an unused parameter in the merge-sort code. (check-in: [6b657ae7] user: drh branch: trunk, size: 30419)
01:11
[4ceadaa2] part of check-in [b5179baf] Improve the testability of the merge-sort logic. (check-in: [b5179baf] user: drh branch: trunk, size: 30591)
2011-09-03
16:42
[e6d6f0c2] part of check-in [99e34bdc] Simplification and performance tweaks in vdbeSorterMerge(). (check-in: [99e34bdc] user: drh branch: merge-sort, size: 30200)
14:36
[5e38e7e1] part of check-in [666c2c3c] Reduce the number of VdbeRecordUnpack() calls made in vdbesort.c. (check-in: [666c2c3c] user: dan branch: merge-sort, size: 30387)
00:17
[aa7ad2ef] part of check-in [68e26c44] The build works again with -DSQLITE_OMIT_MERGE_SORT. The merge-sorter now avoids spilling to disk (letting the in-memory linked list grow without bound) if PRAGMA temp_store=3. (check-in: [68e26c44] user: drh branch: merge-sort, size: 30049)
2011-09-02
21:42
[2ae618be] part of check-in [a9a64592] Remove some dead code. Fix a faulty assert(). Improve some variable names. (check-in: [a9a64592] user: drh branch: merge-sort, size: 29977)
18:03
[b56437b8] part of check-in [cf48ad83] Combine two malloc calls in vdbesort.c. (check-in: [cf48ad83] user: dan branch: merge-sort, size: 30141)
15:41
[a49d4449] part of check-in [065b0c98] Reduce the number of malloc() calls made when creating an index on more than 2 columns. (check-in: [065b0c98] user: dan branch: merge-sort, size: 30283)
11:45
[1e9d4437] part of check-in [71075673] If all data being sorted fits in memory, avoid writing any data out to temporary files in vdbesort.c. (check-in: [71075673] user: dan branch: merge-sort, size: 29777)
10:31
[9c2e8ca2] part of check-in [7769fb98] Instead of a temporary b-tree, use a linked-list and merge-sort to sort records in main memory in vdbesort.c. (check-in: [7769fb98] user: dan branch: merge-sort, size: 28732)
2011-08-31
23:57
[f3d043a1] part of check-in [2869ed28] Avoid using uninitialized variables after failures in the merge sort code. (check-in: [2869ed28] user: drh branch: trunk, size: 25248)
2011-08-26
00:34
[8a61a6d7] part of check-in [c71d7320] Create a new pager type, PAGER_SORTER, for use in the external merge sort. Such pagers are always held in memory but do report when they are under memory pressure by calling pagerStress. (check-in: [c71d7320] user: drh branch: trunk, size: 25207)
2011-08-24
15:12
[d2c87232] part of check-in [46f5a68b] Fix some harmless compiler warnings. (check-in: [46f5a68b] user: drh branch: trunk, size: 24892)
2011-08-17
00:40
[a63bab05] part of check-in [f01766f4] Use OP_Sort rather than OP_Rewind in order to sort the content of a new index on the CREATE INDEX statement. Add an ALWAYS() to the merge sort logic to document an unreachable branch. (check-in: [f01766f4] user: drh branch: trunk, size: 24880)
2011-08-15
15:37
[af82a8b0] part of check-in [c1daa809] Fix an assert() in the merge-sort logic to account for I/O errors. (check-in: [c1daa809] user: drh branch: trunk, size: 24873)
14:41
[18e27c40] part of check-in [bd04756b] When opening a temporary file to use in a merge-sort, pass SQLITE_OPEN_TEMP_JOURNAL instead of SQLITE_OPEN_TEMP_DB. This is a better fit, as merge-sort files are written and read sequentially like journal files. (check-in: [bd04756b] user: dan branch: trunk, size: 24856)
2011-08-12
16:30
[3e6b2268] part of check-in [7e515055] Merge latest trunk changes into experimental branch. (check-in: [7e515055] user: dan branch: experimental, size: 24847)
16:11
[a756d20d] part of check-in [1a8498d8] Remove an unused parameter from a function in vdbesort.c. Fix some comments and other details in the same file. (check-in: [1a8498d8] user: dan branch: experimental, size: 24847)
15:02
[b475ceed] part of check-in [4ced2394] Add the SQLITE_OMIT_MERGE_SORT pre-processor directive. To omit the code in vdbesort.c. (check-in: [4ced2394] user: dan branch: experimental, size: 23229)
2011-08-08
19:26
[6498ab41] part of check-in [eec8c0df] Remove redundant parameter from vdbeSorterInitMerge() in vdbesort.c. (check-in: [eec8c0df] user: dan branch: experimental, size: 23153)
16:44
[e9a7d969] part of check-in [0e6defa6] Add fault-injection and other tests (and fixes) to improve coverage of vdbesort.c. (check-in: [0e6defa6] user: dan branch: experimental, size: 22048)
2011-08-06
15:09
[34523534] part of check-in [038ec9ea] Fix a problem with building large indexes introduced by the previous commit. (check-in: [038ec9ea] user: dan branch: experimental, size: 21545)
12:01
[d7739da9] part of check-in [8051c176] In temp files used for merge sorting, store the size of each packed-memory-array at the start of the array itself. This is to avoid having to store the offsets of all arrays in the (potentially very large) file in main-memory. (check-in: [8051c176] user: dan branch: experimental, size: 21477)
2011-08-05
11:49
[f17fa625] part of check-in [9ddc324a] Minor internal changes to vdbesort.c. Also, default to merging lists together 16 at a time. (check-in: [9ddc324a] user: dan branch: experimental, size: 19940)
2011-08-04
18:43
[87c3b292] part of check-in [db8518ca] Fix a comment in vdbesort.c. (check-in: [db8518ca] user: dan branch: experimental, size: 21085)
12:14
[e7d1a86e] part of check-in [a4770d07] Change to using packed-memory-arrays instead of b-trees when performing an offline merge-sort for CREATE INDEX. This makes it easier to control the number of disc seeks required when merging. (check-in: [a4770d07] user: dan branch: experimental, size: 21044)
2011-08-02
10:56
[40bb17d3] part of check-in [7f339c0e] Minor fixes to vdbesort.c code in preparation for a major rework. (check-in: [7f339c0e] user: dan branch: experimental, size: 16990)
2011-07-12
14:28
[f07d526d] part of check-in [30dbf0fe] Experimental support for speeding up CREATE INDEX commands using an offline merge sort. (check-in: [30dbf0fe] user: dan branch: experimental, size: 16940) Added