3

I've a CSV file of 500 thousand rows. I've to insert all rows of CSV file into a table created in SQLite Android. I want to know how much rows I can insert in any table in SQLite?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Manish Dubey
  • 4,206
  • 8
  • 36
  • 65
  • i have inserted 3 lacs rows with compiledSQL insert query – Ketan Parmar Sep 03 '12 at 06:39
  • Are you sure its good idea to store this much data in your application's DB? Our mobile devices are not meant for handling Data Warehousing. – Shrikant Ballal Sep 03 '12 at 06:40
  • one thing is, you cannot use more than 1mb data in a single query. Moreover there are many efficient ways to achieve this, rather than storing all the 5L rows of data. Better tell your purpose of this data. Definitely you must not save such a huge data in android SQLite. – Archie.bpgc Sep 03 '12 at 06:50
  • Problem arise here : A salesman will take 3,000 order per party and he have to get order from 20 parties in a day. Accordingly, at the end of the day salesman will get 60,000 order total. At the end of the month, salesman will get 1,800,000 order. Now I have to insert all data in "Order" table in sqlite. – Manish Dubey Sep 03 '12 at 07:12

3 Answers3

9

From the sqlite3 documentation:

Maximum Number Of Rows In A Table

The theoretical maximum number of rows in a table is 264 (18446744073709551616 or about 1.8e+19). This limit is unreachable since the maximum database size of 14 terabytes will be reached first. A 14 terabytes database can hold no more than approximately 1e+13 rows, and then only if there are no indices and if each row contains very little data.

See this for limits and see this question for some performance characterization.

Community
  • 1
  • 1
av501
  • 6,645
  • 2
  • 23
  • 34
2

As much as you want. Theoretically, there is no limit.

iTurki
  • 16,292
  • 20
  • 87
  • 132
0

Based on your device performance this can be justified. As the size increases you need more RAM and Processing power to run your queries. Unfortunately storing isn't just important retrieving and processing is important too....

Vivek
  • 115
  • 2
  • 13