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.)
Your particular case is one of these three, but the only way to find out is to measure the performance yourself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With