[MERGE] btree prefetch
John Arbash Meinel
john at arbash-meinel.com
Wed Oct 29 00:56:52 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Martin Pool wrote:
> On Wed, Oct 29, 2008 at 6:38 AM, John Arbash Meinel
> <john at arbash-meinel.com> wrote:
>>> It looks like you're searching for integers in a set of key tuples, which
>>> would presumably never match?
>> The key for a page is actually the integer offset. (So the page at bytes
>> 4096-8191 is at offset 1 and uses key == 1.)
>>
>> I called it "_get_cached_keys" because I'm not getting the bytes to the
>> pages themselves (to say get_cached_pages). "get_cached_offsets" doesn't
>> quite work either. Perhaps "get_offsets_to_cached_pages" ?
>>
>> The code, in general, is bad about terminology. Sometimes calling it
>> 'nodes', sometimes calling it 'pages', etc. I'll do a pass which changes
>> references to the *key* for a page to use terms like "offset".
>>
>> There is also the possibility to use the "node_index" terminology, but
>> as the class is a BTreeIndex, that is double-overloading 'index' as well...
>
> I think if they're byte offsets then 'offset' or maybe 'position'
> would be good. 'key' is fairly strongly associated with tuple keys.
>
It is a 'page offset'. So byte_offset / _PAGE_SIZE.
I switched the code to use 'offset' at least in those functions.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkkHtNQACgkQJdeBCYSNAAN8WwCgjECr7+XYSf6sOd9bXJzj2S+O
ZCsAoMJ4yMC2YkAeIywdg8nIOARNziis
=bx9F
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list