Item 12 on the limits page (http://www.sqlite.org/limits.html) states that a 
maximum SQLite database size is about 140 terabytes.  But item 13 on the same 
page refers to 14 terabytes as the maximum.  

The calculation given in item 12 yields this value:

2147483646 * 65536 = 140,737,488,224,256

I don't see a calculation supporting item 13's maximum of 14 terabytes, so 
perhaps the two references to "14" in item 13 are a typo?  Or perhaps they 
refer to another actual limit?  In either case, the seeming contradiction is 
confusing.

Thanks,
Jeff Robbins

  12. Maximum Number Of Pages In A Database File
SQLite is able to limit the size of a database file to prevent the database 
file from growing too large and consuming too much disk space. The 
SQLITE_MAX_PAGE_COUNT parameter, which is normally set to 1073741823, is the 
maximum number of pages allowed in a single database file. An attempt to insert 
new data that would cause the database file to grow larger than this will 
return SQLITE_FULL. 

The largest possible setting for SQLITE_MAX_PAGE_COUNT is 2147483646. When used 
with the maximum page size of 65536, this gives a maximum SQLite database size 
of about 140 terabytes.

The max_page_count PRAGMA can be used to raise or lower this limit at run-time. 

   13. 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. 
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to