• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Fast tree scan
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Fast tree scan
      • From: Mike Schrag <email@hidden>
  • Next by Date: What is the best way to synchronize EOs between coordinators?
  • Next by thread: Re: Fast tree scan
  • Index(es):
    • Date
    • Thread