Silex
Silex

Reputation: 2713

SQL queries versus search algorithms

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:

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?

Upvotes: 0

Views: 1106

Answers (1)

Jigar Pandya
Jigar Pandya

Reputation: 5987

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.

Upvotes: 4

Related Questions