Reputation: 20500
I'm working on a program that requires metadata information in order to populate some arrays. Let's say I have information like "Countries", "Districts" and a bunch of other metadata. That information is stored in a sqlite database. The program at some time need to load all the countries and iterate them in order to search for one. My question is: What is the best way to proceed: Keep the metadata in an array after query them, or every time I need them I should query the database?
Here's some more information so you can evaluate the performance: Metadata tables (like countries): ~10 Estimated times I need to iterate the metadata: several (~100) the arrays contains aprox. 5 fields (primitive types.)
Upvotes: 3
Views: 772
Reputation: 180060
Your particular case is one of these three, but the only way to find out is to measure the performance yourself.
Upvotes: 4