Hi guys,

I'd like to shed some light on this "magic" :-)

a RID is made of two numbers (a short and a long, at this stage, but the
first one will become a long too in next releases, it's in the radmap).
Say the RID is #xxx:yyy

xxx is the cluster ID, it identifies the cluster where the record is
stored. OrientDB keeps a 1-1 mapping from this number to a file on the
filesystem (the cluster file, well, two files actually).
yyy is the cluster position, it defines the physical position where the
record is stored in the cluster file.

The cluster is actually made of two files, one is the "directory" of
cluster positions and the second one contains the actual data.
The first file contains fixed size records that contain physical pointers
to positions in the second file.

Now let's do a practical example

#12:20  = {@class="Person", name="Luigi"}

1) OrientDB translates 12 -> "person" cluster
2) person.cpm is the "directory" for that cluster, person.pcl contains data
3) say every entry in the directory is N bytes long, OrientDB seeks in
person.pcm at position N*20 (20 is the cluster position)
4) at this position it will find another number, say 12345, this is the
position of the record content in person.pcl

So to resume you are doing two constant time operations, a direct seek in
person.cpm and another one in person.pcl

Luigi





2015-06-11 11:59 GMT+02:00 James Wang <[email protected]>:

> agreed
>
>
> On Thursday, 11 June 2015 06:38:06 UTC+1, scott molinari wrote:
>>
>> I was wondering, is an index automatically created on the RID? I would
>> imagine it is, just wanted to be sure.
>>
>> Also, are there any plans to create something like a sparse index in
>> MongoDB? Or does Orient already have this capability?
>>
>> Scott
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "OrientDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to