0

I am kind of new in Android and SQL (not completely newbie, but not pro), so sorry if my question sounds bosh.

I am creating an Android application. For saving the users data I created a database using SQLite.

My problem is that I can't decide which method is faster:

  • get the data with SQLite queries, or
  • get all the data into a List (with an SQLite query) and then search in the list with searching algorithms.

For example: I have a database of Persons (around 1500-2000 records). In one page I want to show all the names, in an other I would like to show only the names who are married, in an other page I want to show the last 30 Persons who has been added recently etc...

Which method would be faster? Do the queries all the time for displaying the data, or get all the data, and than search for the relevant information while displaying?

1
  • 1
    use query all the time displaying data , rather again saving to list! it is quite fast and once u have local db no need to save again data to some list view as it will be wastage of memory Commented Jul 30, 2012 at 12:21

1 Answer 1

4

In any database filter data using database engine is always preferable.. so my opinion you should filter your result set at DB level only and not using android SDK will help performance and memory management.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.