Advertise Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

sdkIQ for iPhone
($4.99)

Your First iPhone App
($1.99)

iPhone Code Generator
($9.99)

Dual Matches
($0.99)

Calcuccino Programmers' Calculator
($2.99)

SDKtoday
(free)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 05-21-2009, 08:53 PM   #2 (permalink)
Lars
Registered Member
 
Join Date: Mar 2009
Posts: 112
Default

I vote that you query the data when you need it and release it when you are done. If you see bad performance, you can think of changing the method, but I have a feeling performance won't be bad.

Just to give you an example, I created the game downWORD which is a tetris style game where letters fall and you place them trying to spell words. I needed to query for various matches both vertically and horizontally. If a word is found, the row disappears and all tiles slide down. Then I must query against all possible words in all directions. I'm doing this against the SOWPODS database with 189,000 words and soon with a French dictionary with 212,000 words. I'm really able to run upwards of 30 queries in less than a second so that the game doesn't show any slowdown checking for the words.

My guess is as long as you setup your indexes correctly you shouldn't have any problems. Even if you have inner joins on the tables, things should go okay. By keeping the memory clean, you won't have to worry about what to do when the phone suddenly sends you those out-of-memory warnings.

One last thing, I did have to break from tradition with an enterprise database and create and open the connection and leave it open. When I tried closing the connection and reopening when needed, performance was really unacceptable, especially as the board filled up with letters. But beyond that, it was just a matter of setting indexes.

Hope that helps, good luck.
Lars is offline   Reply With Quote
 
» Advertisements
» Online Users: 364
22 members and 342 guests
AdamSubach, anonymous@, bensj, Duncan C, gtyt38, Jeremy1026, lifeCoder45, maxus182, mickm, mox, Mr. Mojo Risin, Olesesy, Ovidius, Paul10, pofak, raheel, squidboy, ufbobbo, ultrayard077
Most users ever online was 965, 06-30-2010 at 04:26 AM.
» Stats
Members: 41,859
Threads: 49,768
Posts: 213,052
Top Poster: BrianSlick (3,138)
Welcome to our newest member, ultrayard077
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:49 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.