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 8650627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:52:12+00:00 2026-06-12T13:52:12+00:00

There are few questions related to this topic on stackoverflow, But I didn’t get

  • 0

There are few questions related to this topic on stackoverflow, But I didn’t get the proper answer. I have some doubts on performance of flat files, Is it better to use flat files instead of SQLite ?

I took performance statistics for Android SQLite.

I have performance statistics for one table which have 21 columns

Can anybody please suggest how to reduce this insertion time.

Records  Write time in ms   Read time in ms
1000      67813                   608
1000      66340                   604
1000      64359                   609
10000     679837                  5159
10000     618062                  5110
10000     644638                  5729
10000     646878                  5890

Flat file have less time rather than SQLite

So anybody please suggest me how can i improve this time for SQLite.

I am using simple database open insert using ContentValues and database close.

Please suggest me some things how to improve these statistics.

Updated Performance statistics after using below answer.Still i want to increase these performance.

Records    Writetime in ms         Readtime in ms   
1000        1645                       530          
1000        2497                       672          
1000        3143                       610          
10000       16356                     5243          
10000       14006                     5122          
10000       13158                     5002          
10000       14828                     5234          
100000      125525                    77622 

Thanks

  • 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-06-12T13:52:13+00:00Added an answer on June 12, 2026 at 1:52 pm

    I believe you are inserting 1000 or 10000 using a loop.
    Use TRANSACTIONS , it will dramatically reduce the write time. I already encountered such an issue and it reduced the write time in my case from around 30 seconds to about less than 1 second.

    Take a look at this.

    Basically, what you should do is :

    db.beginTransaction();
    try{
        for(int i = 0 ; i < LENGTH ; i++ ) {
            // execute SQL
        }
        db.setTransactionSuccessful(); // marks a commit
        }
    finally{
        db.endTransaction();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are few questions related to this topic on stackoverflow, But I didn't get
There are some related questions here and here , but they didn't really give
There were few questions related to this but none answered the question in my
I have asked a few questions related to this, but from different angles. I
There have been a few similar questions with solutions, but none answered my question,
There have been several questions over the past few days about the proper use
I know there are a few related posts but I didn't fully understand what
I found a few questions related to this around here but not exactly what
First off, I'm aware that there are many questions related to this, but none
I've read a few related questions regarding this topic however none of them are

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.