drh
38587159dd
Omit a pointless memory allocation in vdbeSorterSort().
...
FossilOrigin-Name: 5d76dbc5b0584c15d7d59e5c079868f2077f32b865f406b40ec837b8ab6ef2e1
2019-10-07 20:33:26 +00:00
dan
6e11892db8
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.
...
FossilOrigin-Name: 07babb0f897fc8c9cb5b30481899c32fdd743f3f3ca508d8d957826252107dd5
2019-08-12 16:36:38 +00:00
drh
55f66b341a
Add new assert() statements in an attempt to help static analyzers avoid
...
false-positives.
FossilOrigin-Name: 9e66458592d40fbd96ea5f21339573110ca1cfe328238a020c9420a87d35dd72
2019-07-16 19:44:32 +00:00
dan
2eb2ca8391
Avoid a sanitizer error (pointer arithmatic overflow) in vdbesort.c.
...
FossilOrigin-Name: af61a2fc45a0fa1277d7453779238b77de4c298a9f60714b7dc62ddca5874f80
2019-04-16 11:21:13 +00:00
drh
0aa3231ff0
Enforce the SQLITE_LIMIT_COLUMN limit on virtual tables.
...
FossilOrigin-Name: 0b6ae032c28e7fe34d81d1769f6e2901addbd1b95cd9a255dcef274061fb0164
2019-04-13 04:01:12 +00:00
drh
f396ecadcd
Further attempts to reduce the number of false-positives genenerated by
...
static analysis tools.
FossilOrigin-Name: 38f9ce6503c4dd05ccdd73463b1784a6df7ed6e5018c29c5874a3681ca34ba54
2018-08-21 12:46:34 +00:00
drh
b2a0f75c06
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.
FossilOrigin-Name: 54b000246cfb5c7b8adb61a17357ef5a49adddde9e48e8937834d5ba0beb8a6b
2017-08-28 15:51:35 +00:00
drh
a485ad191f
In the KeyInfo object, refactor the nField and nXField elements into
...
nKeyField and nAllField, which are more useful and run a little faster.
FossilOrigin-Name: aea5990eab5e85f92df966aa641db2271c81052010ad2d80982475c4275a1284
2017-08-02 22:43:14 +00:00
drh
2ab792e4c0
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.
FossilOrigin-Name: e972a3860892022d57b26ec44ce0fbadc61c1ff54b7a10b7e82390db88d323a7
2017-05-30 18:34:07 +00:00
drh
ae2ac854b3
Smaller and faster vdbeSorterCompareText().
...
FossilOrigin-Name: 542dc4c5eb87017fe03b6c181e779993aa84564785e1177ccf937d52f985593b
2017-05-27 22:42:36 +00:00
drh
caab5f42db
Slightly smaller and faster implementation for vdbeSorterCompareInt().
...
FossilOrigin-Name: 84fa069c5bdfe41d03d03875c9157cc6785150b677c04e40b8916ba5af073dc8
2017-04-03 12:04:39 +00:00
drh
a582b01698
Simplifications to the way UnpackedRecord objects are allocated. Smaller
...
and faster code that also fixes a subtle (currently unreachable) bug.
FossilOrigin-Name: f7ab01f254cd9d7006b8dec29adb234a671b8e6f
2016-12-21 19:45:54 +00:00
drh
fbd8cbdcf5
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.
FossilOrigin-Name: 8165f88bb1d40693d67005a8d5dc499085f64b91
2016-12-10 12:58:15 +00:00
drh
b982bfea37
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.
FossilOrigin-Name: 9033afbb31b28a8ad6856ac1f773d8e83bc9ec1c
2016-05-20 14:54:54 +00:00
dan
fc26f7cfed
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).
...
FossilOrigin-Name: 79147dca87cfd7eb62d57baa3b70fa2a8542232a
2016-04-14 15:44:37 +00:00
drh
b1f4efd20b
Fix a harmless uninitialized variable access.
...
FossilOrigin-Name: 398522e686b34e7f82a62e62d8b0a0ea924de064
2016-02-19 14:20:46 +00:00
mistachkin
fad3039c51
Enhance ability to debug out-of-memory errors.
...
FossilOrigin-Name: 6a9c4a3ebfb7cc0738ef6634440ccab44a21ff28
2016-02-13 23:43:46 +00:00
dan
98a4d5a7fa
Avoid two more instances of pointer arithmetic on freed pointers.
...
FossilOrigin-Name: 2910ef64097b890c9f8929bf609ea2827db7ac97
2016-01-29 08:38:35 +00:00
drh
2aac8c7ba1
Fix a compiler warning about doing pointer arithmetic involving a NULL pointer
...
even though the result of computation is never used.
FossilOrigin-Name: 7c49a9478bd36564e81d33458ca1f4063ddaca83
2016-01-25 22:08:11 +00:00
drh
d1dd7507e4
Fix a harmless use of an uninitialized variable following system errors
...
in the multi-threaded sorter.
FossilOrigin-Name: 4bb2c1df105c2d21f5c4c7ef656ff1d6e15f78bc
2016-01-12 14:10:05 +00:00
drh
c960dcbace
Refactor the VdbeCursor object. It is now slightly smaller and faster and is
...
easier to understand.
FossilOrigin-Name: 9b1d174d862500a627840008ffac4c8419dc97e2
2015-11-20 19:22:01 +00:00
mistachkin
cdabd7bd50
Fix harmless compiler warnings.
...
FossilOrigin-Name: 1c46c194a2da24fe613d77b5a8d727cc2fc9faa4
2015-10-14 20:34:57 +00:00
dan
36b948f88a
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.
...
FossilOrigin-Name: 78c7ec95931265b89a92f6a799fc9b1a9f0476bf
2015-05-02 12:40:12 +00:00
drh
4a614e9013
Remove an unreachable branch from the vdbeSorterCompareInt() routine.
...
FossilOrigin-Name: f666ef06869f4fb655c43daacf5034c17575d951
2015-04-13 12:45:58 +00:00
dan
ead438156e
Optimizations for VACUUM, CREATE INDEX and some cases of ORDER BY.
...
FossilOrigin-Name: 79326d6eece926fd1c148b29f0b726208d8b44c0
2015-04-11 20:44:28 +00:00
dan
96974bd393
Fix a problem with sorting large amounts of partially ordered data.
...
FossilOrigin-Name: acca97efda86a0c020854d2dd9da16f5879986b1
2015-04-11 20:20:29 +00:00
dan
29f1a19cd9
Fix a problem in vdbesort.c to do with caching unpacked records.
...
FossilOrigin-Name: 80a00539506c95443165a781d1d869205057ca6c
2015-04-02 09:06:21 +00:00
dan
7004f3f6a3
Improve performance of multi-field sorts where the first field has a low cardinality.
...
FossilOrigin-Name: 601e7b6b8e6bfabda03b70f75094c9014e3a3c49
2015-03-30 12:06:26 +00:00
dan
d2e1191929
Remove some unnecessary code from vdbesort.c.
...
FossilOrigin-Name: b58191e91736b1d978db4127f22867dfe2302f7c
2015-03-30 09:58:38 +00:00
dan
a9d9111c4a
Further optimizations for sorting records that begin with integer or text values.
...
FossilOrigin-Name: 24fe9f25d64ee516633fed1ae7ebc21554aa69ca
2015-03-28 19:56:41 +00:00
dan
57a140946f
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.
...
FossilOrigin-Name: ce5ad17c25cf2f8274ce304c51e4421faae0b32b
2015-03-26 11:55:03 +00:00
drh
2b3f1409db
Add another sqlite3FaultSim() to the multi-threaded sorter logic to
...
improve testability.
FossilOrigin-Name: 49ea2cded4a76596f85419c820cdaf4a1751d7ac
2015-03-18 16:00:44 +00:00
drh
8d9da63dac
Add an assert() in order to calm a scan-build warning.
...
FossilOrigin-Name: 11e81ac2a7c917f7c9afc218d104d9870daf9668
2015-01-12 17:56:06 +00:00
drh
b96ef64921
Fix a harmless compiler warning.
...
FossilOrigin-Name: e0de580726a0ed35565783ed14440ef9bcdc3a3d
2015-01-02 21:54:32 +00:00
drh
3bd1791dfb
Add the SQLITE_CONFIG_PMASZ start-time option.
...
FossilOrigin-Name: acb0d1e8324f19da3d4d577d58748848de1bcef7
2015-01-02 15:55:29 +00:00
dan
d348c66e29
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.
...
FossilOrigin-Name: 776648412c30dce206f1024ff849c2cb025bb006
2014-12-30 14:40:53 +00:00
drh
80cdfd199b
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.
FossilOrigin-Name: 1ba8911c18f2fe34c20dc42f25a8f3c1c798fa7a
2014-12-09 19:16:41 +00:00
drh
b11c3f22b8
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.
FossilOrigin-Name: b05340fe3cd5f1676a55023228dc8d1a92de5936
2014-12-09 14:42:49 +00:00
dan
0a79238b39
Fix an integer overflow bug in vdbesort.c.
...
FossilOrigin-Name: 623827192532f08b68bc0eb9ed1449e173361f0c
2014-11-25 18:59:55 +00:00
drh
4d9f188f00
Add various requirements evidence marks for sqlite3_config() options.
...
FossilOrigin-Name: d423349d2cd8bc7e04f3d90ca7bab11e1ad86e25
2014-11-04 17:23:24 +00:00
drh
7b4d780b54
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.
FossilOrigin-Name: a518bc3318232d652349eb29303ff250aee40459
2014-11-03 14:46:29 +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
drh
d74a90eab8
Do not attempt to extend the temp file if VFS version 3 is not supported and
...
hence memory mapped I/O is unavailable.
FossilOrigin-Name: 3ab20ba14f0204efeec62c7dbb87cb3f60e2497f
2014-09-19 19:43:20 +00:00
drh
322f2852f2
Add the sqlite3VdbeMemClearAndResize() interface to be used in place of
...
sqlite3VdbeMemGrow().
FossilOrigin-Name: 5b9b8987797abf7c68d2c3154f6657be9b8b1c8f
2014-09-19 00:43:39 +00:00
drh
75179ded97
Reduce the number of arguments to RecordCompare functions from 4 to 3,
...
resulting in a small performance increase.
FossilOrigin-Name: 8239c35aedd583af79505378bb7dbb78346a3f45
2014-09-16 14:37:35 +00:00
dan
ed7bcba798
Avoid attempting to call the xFetch() method of an sqlite3_io_methods object with a version number less than 3.
...
FossilOrigin-Name: dedaa6fb3d2e6e697d4a48649af5f42d9a11c333
2014-09-15 16:50:34 +00:00
peter.d.reid
60ec914c74
Fix typos in comments. No code changes.
...
FossilOrigin-Name: e62aab5e9290503869e1f4d5e0fefd2b4dee0a69
2014-09-06 16:39:46 +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
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
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