Friday, March 20, 2009

Speed Questions

I've been messing around with Objective-C and developing in OSX. So I was reading a tutoral using SQLite3 and the tutoral did something I'd never seen or thought of with the database object. He had the list object populate only the ids (index/primary key) of the objects. Then when you tried to access any of the properties on the object, it would use that id to fetch the rest of the object.

I was intreged, this is better? I had assumed that I would want to get as much data as possible in the fewest calls as possible. But I never actaully tested this theory (or have any idea where it came from.)


So I'm going to test this. I'll perform three tests.

  1. I'll try the way I've been developing the objects. Where I try to get as much informaiton in each SQL statement as possible.

  2. I'll use the method I read about in the tutoral, where I'll get the ids from everything in the list and return a completed object as I call it.

  3. I'll try a varation of the new method. I'll get all the ids, but I'll only return the property requested as it's requested instead of filling out the whole object.


The database is MySql 5.1 with InnoDB tables

No comments: