• 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
prefetching run amok
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

prefetching run amok


  • Subject: prefetching run amok
  • From: Zak Burke <email@hidden>
  • Date: Fri, 18 Feb 2005 16:48:05 -0500

I am trying to use prefetching but it's not behaving in the way I expect, or the way I want. I have a two tables, STORY and URL, with a to-one relationship defined from STORY to URL. Other tables have to-one relationships with URL as well, so it has a lot (100k+) of rows.

When I retrieve a set of stories, I always want the stories' related URL items as well so I use EOFetchSpecification.setPrefetchingRelationshipKeyPaths to add an array containing this field to my fetch.

This works, kind of. Instead of individual queries for each URL item, there's only one query (good), but it selects *every* row in URL rather than just those which are related to the STORY rows in the current query (bad). When I run a simple search, I'm retrieving 15 STORY rows and 112,000 URL rows. Yikes.

The query EOF generates is this:

	SELECT DISTINCT t0.contact_id, t0.created,
	t0.created_by, t0.url_description, t0.updated,
	t0.updated_by, t0.url, t0.url_id
	FROM url t0
	WHERE (1=1)

I expected a where clause that ORed together the selected STORY.URL_ID fields.

Is there way to restrict prefetching to only grab the rows related to the current query?

zak.
_______________________________________________
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: prefetching run amok
      • From: Zak Burke <email@hidden>
  • Prev by Date: Re: Determining if an image exists
  • Next by Date: Re: prefetching run amok
  • Previous by thread: Re: Using cell phones with WO...anybody ?
  • Next by thread: Re: prefetching run amok
  • Index(es):
    • Date
    • Thread