• 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: Best Way To Lookup From a Huge Table
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best Way To Lookup From a Huge Table


  • Subject: Re: Best Way To Lookup From a Huge Table
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 13 Mar 2008 15:30:37 -0700


On 13 Mar '08, at 2:11 PM, Karan Lyons wrote:

The table itself is pretty simple: It's just two columns, one with every zipcode in the US, and the other with the corresponding weather code.

If the weather-codes are all as short as in your example, you could create a file that's just an on-disk flat array of weather-codes, indexed by zip code. In other words, if a weather-code is at most n bytes long, you just seek to zipcode*n in the file and read n bytes.


Assuming n==8 as in your example, it would be an 800kbyte file. (But I bet it will compress really well, so it'll increase your app's download size by much less than that.)

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

References: 
 >Best Way To Lookup From a Huge Table (From: Karan Lyons <email@hidden>)

  • Prev by Date: Re: sorting large tables
  • Next by Date: Re: How do I empty WebView;s cache?
  • Previous by thread: Re: Best Way To Lookup From a Huge Table
  • Next by thread: Re: Best Way To Lookup From a Huge Table
  • Index(es):
    • Date
    • Thread