You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by John Wilson <sa...@gmail.com> on 2018/06/19 23:45:54 UTC

Two quick questions on index page and data page

Hi,


   1. An index page contains the hash value of key and a link; where a link
   is page_id + offset. Question: what is this offset? Is it the offset to the
   item in the data page? In other words, Ignite locates the page and the item
   within the page and finally gets the key-value pair by following the item?
   2. The design doc below states that the item serves as an internal
   reference (offset) to the key value pair. Does the item has information
   about the size of the key-value is it pointing to? If not, how does it now
   the size of the key-value.

https://cwiki.apache.org/confluence/display/IGNITE/Ignite+Durable+Memory+-+under+the+hood

Thanks,
John

Re: Two quick questions on index page and data page

Posted by Ivan Rakov <iv...@gmail.com>.
Hello John,

1) Quote from the same article:

> Values are inserted into data page from the end to beginning. Items 
> are filled from beginning to end.
>
> To address particular Key-Value pair ignite uses Link = Page ID + 
> order in page.
>
> Link allows to read K,V pair as N-th item in page.
>
Simply put, external link to K,V pair consists of Page ID and number of 
item in page.
Exact offset in page is not exposed to external link keeper (e.g. SQL 
index) and saved inside page in corresponding "item". This is handy: 
exact offset may change (for example, when we decide to defragment the 
page) while item number always remains intact.

2) Item itself doesn't contain information about entry size. Every 
payload piece keep its size in header. K,V pair may be stored either in 
one payload piece (then its size is equal to size of payload piece) or 
in several pieces on different pages (case when entry is too big for one 
page).

Best Regards,
Ivan Rakov

On 20.06.2018 2:45, John Wilson wrote:
> Hi,
>
>
>     1. An index page contains the hash value of key and a link; where a link
>     is page_id + offset. Question: what is this offset? Is it the offset to the
>     item in the data page? In other words, Ignite locates the page and the item
>     within the page and finally gets the key-value pair by following the item?
>     2. The design doc below states that the item serves as an internal
>     reference (offset) to the key value pair. Does the item has information
>     about the size of the key-value is it pointing to? If not, how does it now
>     the size of the key-value.
>
> https://cwiki.apache.org/confluence/display/IGNITE/Ignite+Durable+Memory+-+under+the+hood
>
> Thanks,
> John
>