New Fetch Plan strategies

74 views
Skip to first unread message

Luca Molino

unread,
Feb 1, 2012, 11:06:23 AM2/1/12
to orient-...@googlegroups.com
Hi all,

I'm happy to announce new OrientDB Fetch Plan strategies and improvement (trunk revision 4742):

Commons features:
  1. Centralized fetch algorithm
  2. fetch depth is record centric: now every field that is not a record or a collection of record will be fetched.
  3. fetch level 0 (zero) is no more "don't fetch" but means fetch current record
  4. fetch level >0 means fetch x level of depth (Example: *:0--> fetch only root record, *:2 fetch all records two depht levels down)
  5. fields fetch now works in dot notation
  6. fetch algorithm now uses an improved OFetchListener and a new OFetchContext
  7. Class fetch (Classname.classfield:x) it's not available anymore (will be reimplemented again soon)
OFetchListener interface takes care of what to do in case of field fetching: standard, record to fetch, record not to fetch, map or collection entries.

OFetchContext interface takes care of anything the user wants do do before and after fetching an entire record or a single field divided by its type (Standard, Document, Collection, Map,Array).

ObjectDatabase users need to know that now if fetch reached its max level the field inside the user object will be set as null.

Examples:

Invoice
 
3:100
   
|
   
| customer
   
+---------> Customer
   
|            5:233
   
| city            country
   
+---------> City ---------> Country
   
|           11:2             12:3
   
|
   
| orders
   
+--------->* [OrderItem OrderItem OrderItem]
               
[  8:12      8:19      8:23   ]


*:0 --> will fetch all standard field of Invoice; customer, city and orders fields will be not fetched
*:1 --> will fetch all standard field of Invoice, customer, city and orders.
*:0 --> city.country:0 will fetch same as *:0 but it will fetch also city and country fields.
*:0 --> city.country:0 orders:0 will also fetch orders collection.


Wiki page will be updated soon.

Bye all

Luca Molino

kant

unread,
Feb 1, 2012, 9:23:15 PM2/1/12
to OrientDB
Nice. I definitely have a use for this.

On Feb 1, 11:06 am, Luca Molino <molino.l...@gmail.com> wrote:
> Hi all,
>
> I'm happy to announce new OrientDB Fetch Plan strategies and improvement
> (trunk revision 4742):
>
> *Commons features*:
>
>    1. Centralized fetch algorithm
>    2. fetch depth is record centric: now every field that is not a record
>    or a collection of record will be fetched.
>    3. fetch level 0 (zero) is no more "don't fetch" but means fetch current
>    record
>    4. fetch level >0 means fetch x level of depth (Example: *:0--> fetch
>    only root record, *:2 fetch all records two depht levels down)
>    5. fields fetch now works in dot notation
>    6. fetch algorithm now uses an improved OFetchListener and a new
>    OFetchContext
>    7. Class fetch (Classname.classfield:x) it's not available anymore (will
>    be reimplemented again soon)
>
> OFetchListener interface takes care of what to do in case of field
> fetching: standard, record to fetch, record not to fetch, map or collection
> entries.
>
> OFetchContext interface takes care of anything the user wants do do before
> and after fetching an entire record or a single field divided by its type
> (Standard, Document, Collection, Map,Array).
>
> ObjectDatabase users need to know that now if fetch reached its max level
> the field inside the user object will be set as *null*.
>
> *Examples*:
Reply all
Reply to author
Forward
0 new messages