On Tue, Jul 3, 2012 at 3:59 PM, Igor Tandetnik <itandet...@mvps.org> wrote:
> On 7/3/2012 3:50 PM, Steven E. Harris wrote: > >> The first paragraph mentions that the encoding allows comparison of keys >> with memcmp(), which makes it sound like an entire key -- meaning the >> concatenation of several values -- can be be compared in one operation >> against another key. >> >> The second paragraph notes: >> >> ,---- >> | Keys are compared value by value, from left to right, until a difference >> | if found. The first difference determines the key order. >> `---- >> >> Does "value by value" here mean that before comparison takes place, the >> key must be split apart into values, and then each pairwise value from >> each of the two keys can be compared with one call to memcmp() for each >> pair of values, or does "value by value" mean simply that the >> concatenated values' bytes will be compared from left to right, with one >> call to memcmp() for the entire key? >> > > It doesn't matter. The whole point is that the key is constructed in such > a way that both procedures would arrive at the same result. > Exactly. "Value by value" means conceptually what happens. The actual implementation is a single memcmp() since that is so much faster. > -- > Igor Tandetnik > > > ______________________________**_________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users> > -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users