Re: Fast tree scan
Re: Fast tree scan
- Subject: Re: Fast tree scan
- From: Florijan Stamenkovic <email@hidden>
- Date: Thu, 1 Jun 2006 10:33:52 +0200
Flor,
Two things spring to mind.
The first is to just have the entity cached in RAM via the setting
in EOModeler. Select the entity, inspect it, and go to the advanced
entity inspector (the second icon), and select the checkbox at the
bottom that says, "Cache in Memory". This will pull in all of the
snapshots for the entity, and then when you traverse the tree the
EO's are generated from the cached snapshots and you avoid the
round trip to the database. This works best if you are going to
traverse all of the trees and there aren't so many individual EO's
that you start running out of RAM.
Don't think this will go. These tree structures as one of the central
points in the db, and there is a lot hanging on them. They are
flexible and changeable, and their relationships to other entities
(mostly to-many) are continuously changing. And I never really know
which trees a certain client will need. Out of a potentially large
number of them. No go.
The second technique is to set a prefetching key path. This is
made really easy because you already have a single separate root
object that has a to-many relationship to all of the nodes of a
particular tree. Fetch that root node, but in the fetch
specification set a prefetching key path that follows the to-many
relationship and gets all of the nodes into memory in one round-
trip to the database. This works best if you are going to traverse
only one or a few of many trees, or if there are so many nodes that
you can't cache them all in memory.
Yes, this will probably work. I will have to change the way I get my
root objects (as at the moment I get them by resolving a
relationship), but besides that it should work.
Hope this helps.
Yup, hope so. Thanks a lot, also to everybody else who commented.
Cheers,
Flor
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden