Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7514271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:26:48+00:00 2026-05-30T00:26:48+00:00

I have a SQLite database with with just over 6,000 rows of addresses in

  • 0

I have a SQLite database with with just over 6,000 rows of addresses in a table. This is a read-only database – no updates or changes after the app is built and deployed. I have an index on the state field. My app uses a simple select statement to get all rows that match the given state. I have used the explain and explain query plan statements to see that my query is using the index.

Most of the time the query comes back in under a second – not great, but good enough for my application.

Every so often the query takes longer – even up to 14 seconds, often 3-4 seconds. Exact same query on the exact same read-only database (and table) on the same phone, invoked by the exact same binary.

I can see that no garbage collection is occurring, and no exceptions are being generated from monitoring logcat

There is just a variation that sometimes occurs. A variation that creates an inconsistent user experience.

It appears that the SQLite database system is being shared by other apps – such as the email client. Could it be that my query is being queued behind another app’s queries and thus the variation is due to when the shared SQLite database system actually gets to run my query? If this is the case, is it possible to “create my own SQLite instance” so that I can get consistent performance?

If it is not a shared SQLite database system (and thus I do have my own instance) what else could be causing such a large variation in query performance given that everything else is equal?

Note that I can’t easily bring the data into memory to run the query there as the rows are pretty long (have more information than just the address) and I have a number of other parts of my code that make use of more complex select queries. I’ve narrowed the performance variation down to just the simplest “select where state = ” query for this question (plea for help).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T00:26:50+00:00Added an answer on May 30, 2026 at 12:26 am

    It appears that the SQLite database system is being shared by other apps – such as the email client.

    Not exactly. Storage is shared by other apps. And on Android 1.x and most 2.x devices, internal storage is formatted YAFFS2, which only allows one process to access the storage at a time. This should be less of a problem on Android 3.0+ devices (and some 2.3 devices) that are running ext4 instead of YAFFS2.

    Could it be that my query is being queued behind another app’s queries and thus the variation is due to when the shared SQLite database system actually gets to run my query?

    Not exactly. Your disk I/O could be queued behind another app’s disk I/O, though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an sqlite database, and I would like to keep it read-only without
I have an sqlite database with over 400k records. I have just found that
I have a SQLite database with cyrillic rows in it. For example: CREATE TABLE
I have a datalogging application (c#/.net) that logs data to a SQLite database. This
I have a DataTable which I want to save to a SQLite Database Table.
I have an sqlite database whose data I need to transfer over the network,
I have a Sqlite notes database with a Toxi schema (Notes table, Tags table,
I have this weird problem. I have defined a column in a SQLite database
I have an SQLite database with a simple table of Persons. Each row represents
I have a SQLite database that I read items out of feed into a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.