• 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: Counting instances in Core Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Counting instances in Core Data


  • Subject: Re: Counting instances in Core Data
  • From: "I. Savant" <email@hidden>
  • Date: Tue, 29 Apr 2008 12:08:44 -0400

>  Execute a fetch for the entity in which you're interested, and count the
> returned array.
>  ________________
>
>  My question is: what is the most efficient fetch to pose given that every
> fetch is IO.

  Yes.

>  A given entity might have a lot of records so an array COULD be an
> unnecessarily large transaction...

  Except that, unless you're accessing attributes (which causes the
entire instance to be 'faulted in'), you're only getting an empty,
unpopulated instance - a placeholder ... a fault. It's pretty damned
quick, too (see the many previous 'Core Data performance' related
threads in the list archives).

  Resist premature optimization (or 'optimisation' for our European
friends) ... it is the root of all time-wasting evil and a brutal
murderer of all that is precious. Unless of course you're at the
optimization/optimisation faze (fase?) of your project ...

--
I.S.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Counting instances in Core Data
      • From: "I. Savant" <email@hidden>
References: 
 >Counting instances in Core Data (From: Steve Cronin <email@hidden>)

  • Prev by Date: Re: NSTableView calls setPlaceHolderString: for image cell
  • Next by Date: Binding a popup button's selected index to a model integer
  • Previous by thread: Counting instances in Core Data
  • Next by thread: Re: Counting instances in Core Data
  • Index(es):
    • Date
    • Thread