Re: SELECT statement on relationship binding

2011-01-24 Thread Alexander Spohr
Why remove it?
Just uncheck the diamond. You can then still use it in qualifiers but it won’t 
get fetched.

atze



Am 23.01.2011 um 23:42 schrieb Mark Wardle:

 Remove the inverse relationship. 
 
 Mark
 
 -- 
 Dr. Mark Wardle
 Specialist registrar, Neurology
 (Sent from my mobile)
 
 
 On 23 Jan 2011, at 22:05, Tarun Reddy t...@cornell.edu wrote:
 
 So I've got a situation where I'm seeing a SELECT that will eventually kill 
 my performance and want to see if I can fix it before my site goes live.
 
 My EOModel has an object called a Landing and an object called a 
 SiteDefinition. The SiteDefinition defines what the site looks like and the 
 Landing represents a user landing on the site. When a user comes to the 
 site, I create a Landing and associate it with the SiteDefinition so that I 
 can capture what site a user sees and what users were on a site.
 
 SiteDefinition to many Landings
 
 When I add the relationship using this:
 aLanding.setSiteDefinitionRelationship(getSiteDefinition());
 
 WebObjects decides it needs to select all Landings where the 
 siteDefinitionID equals the one I'm assigning. This is fine in dev where I 
 may only have 17 records but eventually I may have 10s of thousands of 
 records.
 
 Is this my EOModel, and if so how can I prevent it?
 
 Thank you,
 Tarun
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/webobjects-dev/mark%40wardle.org
 
 This email sent to m...@wardle.org
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 http://lists.apple.com/mailman/options/webobjects-dev/atze%40freeport.de
 
 This email sent to a...@freeport.de

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: SELECT statement on relationship binding

2011-01-23 Thread Andrew Lindesay

Hi Tarun;

Large to-many can be trouble for the reason that you have identified.  I 
tend to omit those from the model, leaving the to-one relationship in 
place.  EOF allows this because the relationships are not automatically 
reflexive.


In this I mean that the to-one and to-many relationships are modelled 
separately and you can just remove the to-many one for the large 
relationship.


cheers.




On 24/01/11 11:04 AM, Tarun Reddy wrote:

So I've got a situation where I'm seeing a SELECT that will eventually
kill my performance and want to see if I can fix it before my site goes
live.

My EOModel has an object called a Landing and an object called a
SiteDefinition. The SiteDefinition defines what the site looks like and
the Landing represents a user landing on the site. When a user comes to
the site, I create a Landing and associate it with the SiteDefinition so
that I can capture what site a user sees and what users were on a site.

SiteDefinition to many Landings

When I add the relationship using this:

aLanding.setSiteDefinitionRelationship(getSiteDefinition());


WebObjects decides it needs to select all Landings where the
siteDefinitionID equals the one I'm assigning. This is fine in dev where
I may only have 17 records but eventually I may have 10s of thousands of
records.

Is this my EOModel, and if so how can I prevent it?

Thank you,
Tarun



  ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/apl%40lindesay.co.nz

This email sent to a...@lindesay.co.nz



--
Andrew Lindesay
www.silvereye.co.nz
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: SELECT statement on relationship binding

2011-01-23 Thread Ray Kiddy

On Jan 23, 2011, at 2:04 PM, Tarun Reddy wrote:

 So I've got a situation where I'm seeing a SELECT that will eventually kill 
 my performance and want to see if I can fix it before my site goes live.
 
 My EOModel has an object called a Landing and an object called a 
 SiteDefinition. The SiteDefinition defines what the site looks like and the 
 Landing represents a user landing on the site. When a user comes to the site, 
 I create a Landing and associate it with the SiteDefinition so that I can 
 capture what site a user sees and what users were on a site.
 
 SiteDefinition to many Landings
 
 When I add the relationship using this:
 aLanding.setSiteDefinitionRelationship(getSiteDefinition());
 
 WebObjects decides it needs to select all Landings where the siteDefinitionID 
 equals the one I'm assigning. This is fine in dev where I may only have 17 
 records but eventually I may have 10s of thousands of records.
 
 Is this my EOModel, and if so how can I prevent it?
 
 Thank you,
 Tarun

I think you want to look at the documentation on faulting and/or pre-fetching. 
EOF will optimize certain operations by pre-fetching data or setting up faults, 
which are place-holder objects for EOs. It is not all that common to edit 
EOModel objects dynamically. I suspect that when you create this relationship, 
it uses the most conservative faulting strategy it has, and so fetches a lot of 
stuff immediately.

You may also find the behavior changes if there is or is not an inverse 
relationship and different things about how the inverse relationship is set up 
will change things.

For example, look in the javadoc for EORelationship. You will see methods such 
as numberOfToManyFaultsToBatchFetch(), inverseRelationship(),  and 
ownsDestination(). See also the prefetchingRelationshipKeyPaths() method in 
EOFetchSpecification. These may not be exactly what you need but they will 
probably get you started.

Also, do you need to create your relationship dynamically in this way? There 
may be a better way to set up the relationship so that you do not have to do 
this.

cheers - ray


 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: SELECT statement on relationship binding

2011-01-23 Thread Mark Wardle
Remove the inverse relationship.

Mark

-- 
Dr. Mark Wardle
Specialist registrar, Neurology
(Sent from my mobile)


On 23 Jan 2011, at 22:05, Tarun Reddy t...@cornell.edu wrote:

So I've got a situation where I'm seeing a SELECT that will eventually kill
my performance and want to see if I can fix it before my site goes live.

My EOModel has an object called a Landing and an object called a
SiteDefinition. The SiteDefinition defines what the site looks like and the
Landing represents a user landing on the site. When a user comes to the
site, I create a Landing and associate it with the SiteDefinition so that I
can capture what site a user sees and what users were on a site.

SiteDefinition to many Landings

When I add the relationship using this:

aLanding.setSiteDefinitionRelationship(getSiteDefinition());

WebObjects decides it needs to select all Landings where the
siteDefinitionID equals the one I'm assigning. This is fine in dev where I
may only have 17 records but eventually I may have 10s of thousands of
records.

Is this my EOModel, and if so how can I prevent it?

Thank you,
Tarun

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/mark%40wardle.org

This email sent to m...@wardle.org
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com