Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Incremental hydration for fetch-joined entities
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jasper N. Brouwer  
View profile  
 More options Sep 27 2012, 8:12 am
From: "Jasper N. Brouwer" <jas...@nerdsweide.nl>
Date: Thu, 27 Sep 2012 14:12:14 +0200
Local: Thurs, Sep 27 2012 8:12 am
Subject: Re: [doctrine-user] Incremental hydration for fetch-joined entities
One option that comes to mind is to have "the first" query only fetch ids of the root entity. You can loop over the array of ids and perform the fetch-join query you need to fully load that entity (with all associations).
I know this will still perform N + 1 queries (where N is the amount of ids), but it's better than N * A + 1 queries (where A is the amount of associations you need to load).

--
Jasper N. Brouwer

On 27-09-2012, at 13:59, acid24 <aci...@gmail.com> wrote:

> Hi,

> I am aware of the note from the manual that says "Iterating results is not possible with queries that fetch-join a collection-valued association. The nature of such SQL result sets is not suitable for incremental hydration.". But is there a work-around for this? I need to retrieve a set of fetch-joined entities and I really would like to hydrate them one by one instead of loading the all the entities in memory. The obvious alternative is to load each association of each entity (and the associations' associations) manually (by accessing them), but this will trigger way too much queries. I should mention that retrieving the result set as arrays doesn't help me, what I need are the entities (and their loaded associations).


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.