In focus
What Are The Limitations Of SQLite

Learn SQLite

SQLite is one of the smallest and most widely used SQL databases. SQLite is a self-contained, serverless, zero-configuration, and transactional SQL database engine. This series talks about SQLite and how to use it.

What Are The Limitations Of SQLite


SQLite database is capable of handling large volume of data to build scalable and robust applications but compare to major databases such as Oracle and SQL Server, it has some size and other limitations. Some of these limitations also have workarounds.
 
Here is list of these limitations.
 
Maximum Database Size
 
SQLite can have a maximum database size of 140 terabytes (TB). A SQLite database is a set of one more pages where every page is the same size. Maximum size of a page cannot exceed 65536 bytes. The maximum size of a database file is 2147483646 pages.
 
65536 bytes x 2147483646 pages = 140 TB (140,000 GB)
 
Maximum Number Of Attached Databases
 
SQLite allows you to attach multiple databases with a database connection. The maximum number of database attachment limit is 125. The default limit is 10.
 
Maximum Number Of Pages In A Database File
 
The SQLITE_MAX_PAGE_COUNT parameter, which is normally set to 1073741823, is the maximum number of pages allowed in a single database file. But the maximum number of pages a SQLite database can be increased to 2147483646 pages. The maximum page size is 65536 bytes.
 
Maximum Number Of Tables In A Schema
 
Each table in a SQLite database requires one or more pages. A SQLite database can have maximum 2147483646 pages. Hence the maximum number of tables in a schema cannot reach more than 2147483646.
 
Maximum Number Of Rows In A Table
 
The maximum number of rows in a table is 264.
 
Maximum Number Of Columns
 
The maximum number of columns is 32767 in a table. The default setting for SQLITE_MAX_COLUMN is 2000.
 
Maximum Length Of An SQL Statement
 
The maximum number of bytes in the text of an SQL statement is limited to SQLITE_MAX_SQL_LENGTH which defaults to 1000000. You can redefine this limit to be as large as the smaller of SQLITE_MAX_LENGTH and 1073741824.
 
Maximum Number Of Tables In A Join
 
SQLite does not support joins containing more than 64 tables.
 
Maximum Number Of Arguments On A Function
 
The maximum number of arguments in a function cannot be more than 127. The default value of this limit is 100.
 
Maximum length of a string or BLOB
 
The maximum number of bytes in a string or BLOB in SQLite is defined by the preprocessor macro SQLITE_MAX_LENGTH. The default value of this macro is 1 billion. The current implementation will only support a string or BLOB length up to 231-1 or 2147483647.
 
Maximum Depth Of An Expression Tree
 
SQLite parses expressions into a tree for processing. The default value of expression tree is 1000.
 
Maximum Depth Of Trigger Recursion
 
The default maximum trigger recursion depth is 1000.
 
Maximum Length Of A LIKE Or GLOB Pattern
 
The default maximum length of A LIKE Or GLOB pattern limit is 50000 in a SQLite database.