Re: Prefetching?
Re: Prefetching?
- Subject: Re: Prefetching?
- From: Jeffrey Simpson <email@hidden>
- Date: Fri, 30 Jan 2009 16:49:29 -0500
- Thread-topic: Prefetching?
I am talking about relationship prefetching but it is different then Batch
Fetching.
>From what I read you set the prefetch path on the fetch spec and it is
suppose to make one single fetch.
Example:
2 Entities E1 and E2
E1 has relationship R1 to E2
EOFetchSpecification fs = new EOFetchSpecification("E1", someQual, null);
fs.setPrefetchingRelationshipKeyPaths(new NSArray("R1"));
NSArray array = ec.ObjectsWithFetchSpecification(fs);
If query should return both the E1 object with the reationship R1 already
loaded. This would be done in one select.
I would try this myself but we are using a DB2 plugin that was written in
2004 and does not support this.
I may be reading the documentation wrong.
On 1/30/09 10:05 AM, "Stamenkovic Florijan" <email@hidden> wrote:
> Hi Jeffrey,
>
> Are you referring to relationship prefetching? As in: a row in table1
> relates to many rows in table2, and you want to prefetch table2 rows
> based on that relationship?
>
> If so, well, I would assume most people use it, as it can drastically
> increase your performance.
>
> Say you have a single row in table1, and 1000 rows in table2 relating
> to it. Let's assume that you will for sure need those 1000 rows in
> your app... If you pre-fetch the table1 ->> table2 relationship when
> fetching table1 row(s), then those 1000 objects will be fetched from
> the database immediately using a single select, resulting in total in
> a few selects, as opposed to (a few + 1000) selects... This can speed
> fetching up *a lot*, and is in many situations not only beneficial,
> but a must-do.
>
> Does this help? If you are referring to something else, please clarify.
>
> F
>
> On Jan 30, 2009, at 10:18, Jeffrey Simpson wrote:
>
>> I was reading though WebObjects Documentation and ran across a
>> section on
>> Prefetching. I then looked through the mailing list and did not
>> find any
>> messages about it.
>>
>> Does anyone use it?
>> Is it worth using?
>>
>> Jeffrey Simpson
>> Youth For Understanding USA
>> email@hidden
>> Telephone: (240) 235-2114
>> FAX: (202) 235-2104
>>
>> Preparing young people for their responsibilities and opportunities
>> in a
>> changing, interdependent world.
>>
>>
>>
>>
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> email@hidden
>>
>> This email sent to email@hidden
>
Jeffrey Simpson
Youth For Understanding USA
email@hidden
Telephone: (240) 235-2114
FAX: (202) 235-2104
Preparing young people for their responsibilities and opportunities in a
changing, interdependent world.
_______________________________________________
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