]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix a comment in vdbesort.c.
authordan <dan@noemail.net>
Thu, 4 Aug 2011 18:43:37 +0000 (18:43 +0000)
committerdan <dan@noemail.net>
Thu, 4 Aug 2011 18:43:37 +0000 (18:43 +0000)
FossilOrigin-Name: db8518cab8e329b1dbe4cd6c81b21ef3ea69fcb1

manifest
manifest.uuid
src/vdbesort.c

index c2cb6abec338d5d97f129b2edeb139ef74ade835..0c6b6c3b089bde055bf269ea0aafcebc74513311 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Change\sto\susing\spacked-memory-arrays\sinstead\sof\sb-trees\swhen\sperforming\san\soffline\smerge-sort\sfor\sCREATE\sINDEX.\sThis\smakes\sit\seasier\sto\scontrol\sthe\snumber\sof\sdisc\sseeks\srequired\swhen\smerging.
-D 2011-08-04T12:14:04.747
+C Fix\sa\scomment\sin\svdbesort.c.
+D 2011-08-04T18:43:37.790
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in c1d7a7f4fd8da6b1815032efca950e3d5125407e
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -245,7 +245,7 @@ F src/vdbeapi.c 11dc47987abacb76ad016dcf5abc0dc422482a98
 F src/vdbeaux.c 8fb978eb73a97b34d352dd3ef3bff35b1b3fa7e9
 F src/vdbeblob.c f024f0bf420f36b070143c32b15cc7287341ffd3
 F src/vdbemem.c 0498796b6ffbe45e32960d6a1f5adfb6e419883b
-F src/vdbesort.c e7d1a86ebe0501161988001514c6ce0d0bb76a5a
+F src/vdbesort.c 87c3b2921cbfd29a7fd0ef834f29b5a4fd8be56e
 F src/vdbetrace.c 5d0dc3d5fd54878cc8d6d28eb41deb8d5885b114
 F src/vtab.c 901791a47318c0562cd0c676a2c6ff1bc530e582
 F src/wal.c 0c70ad7b1cac6005fa5e2cbefd23ee05e391c290
@@ -954,7 +954,7 @@ F tool/symbols.sh caaf6ccc7300fd43353318b44524853e222557d5
 F tool/tostr.awk 11760e1b94a5d3dcd42378f3cc18544c06cfa576
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
 F tool/warnings.sh 2ebae31e1eb352696f3c2f7706a34c084b28c262
-P 7f339c0e2655310d7530041c379b082d49ce8c7f
-R d1224a68c01eeac1a445468ca51c2250
+P a4770d079c1b236eb54751e75a44cccc997c6b93
+R ec95e9bd54ef30cddfc95ab39fec1eee
 U dan
-Z 3f3c28dfd1bf55734d647cab0b6dad47
+Z 35780c1186756c8599cb8966b7d9180f
index 5adf05ac716e694f2cdce4f2248b5f04b08c461a..c35a8ab1a4e64a318e5da44229fcada3d15b4f1a 100644 (file)
@@ -1 +1 @@
-a4770d079c1b236eb54751e75a44cccc997c6b93
\ No newline at end of file
+db8518cab8e329b1dbe4cd6c81b21ef3ea69fcb1
\ No newline at end of file
index a8abff9b2383aabcb6dcc06d95a66192ce1dde60..6ee9a15dfa25e54e199dd23316df796c6471419a 100644 (file)
 typedef struct VdbeSorterIter VdbeSorterIter;
 
 /*
-** The aIter[] and aTree[] arrays are used to iterate through the sorter
-** contents after it has been populated. To iterate through the sorter
-** contents, the contents of all packed-memory-arrays (PMAs) must be 
-** merged. This structure supports merging any number of arrays in a 
-** single pass with no redundant comparison operations.
+** As keys are added to the sorter, they are written to disk in a series
+** of sorted packed-memory-arrays (PMAs). The size of each PMA is roughly
+** the same as the cache-size allowed for temporary databases. In order
+** to allow the caller to extract keys from the sorter in sorted order,
+** all PMAs currently stored on disk must be merged together. This comment
+** describes the data structure used to do so. The structure supports 
+** merging any number of arrays in a single pass with no redundant comparison 
+** operations.
 **
-** TODO: It may turn out that the optimum number of PMAs to merge in a 
-** single pass is 2. If this is the case, this data structure could be
-** simplified.
+** The aIter[] array contains an iterator for each of the PMAs being merged.
+** An aIter[] iterator either points to a valid key or else is at EOF. For 
+** the purposes of the paragraphs below, we assume that the array is actually 
+** N elements in size, where N is the smallest power of 2 greater to or equal 
+** to the number of iterators being merged. The extra aIter[] elements are 
+** treated as if they are empty (always at EOF).
 **
-** The first few elements of the aIter[] array contain pointers into
-** each of the PMAs being merged. An aIter[] element either points to a 
-** valid key or else is at EOF. For the purposes of the paragraphs below, 
-** we assume that the array is actually N elements in size, where N is the
-** smallest power of 2 greater to or equal to nRoot. The extra aIter[]
-** elements are treated as if they are empty PMAs (always at EOF).
-**
-** The aTree[] array is N elements in size. The value of N is stored in
+** The aTree[] array is also N elements in size. The value of N is stored in
 ** the VdbeSorter.nTree variable.
 **
 ** The final (N/2) elements of aTree[] contain the results of comparing