1, the 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 for this macro is 1 billion, and you can adjust the default value at compile time using a command line parameter like this: -dsqlite_max_length=123456789 Only string or blob lengths are supported to be raised to the maximum 231-1 or 2147483647 in the current implementation. And this time some of the built-in functions such as Hex () will be called failed. It is best not to attempt to increase the maximum length of string and blob in security-sensitive applications. In fact, if you can, you can reduce the maximum length of a string and blob by a certain range (hundreds of-square bytes). In SQLite insert and select processing, all the contents of each row in the database are encoded into a single blob. So sqlite_max_length This parameter also defines the maximum number of bytes in a row. The maximum length of a string or blob can be lowered at run time by the Sqlite3_limit (Db,sqlite_limit_length,size) method. 2, the maximum number of columns Sqlite_max_column is used to set an upper limit at compile time: The default setting Sqlite_max_column value is 2000. You can adjust it to a maximum of 32767 at compile time. On the other hand, many experienced database designers would argue that a well-designed database would never require more than 100 columns in a table. The number of columns in most applications is very small, about dozens of. The algorithm used in the SQLite code generator is O (N²), and this N is the number of columns. So if you redefine sqlite_max_column as a huge number, use this large number of columns when generating SQL and you will find that SQLITE3_PREPARE_V2 () is running slowly. The maximum number of columns can be lowered at run time using the Sqlite3_limit (db,sqlite_limit_column,size) method.
Number of columns in the table
Number of columns in the index
Number of columns in the view
The number of items in the SET clause in the UPDATE statement
Number of columns in the result set of the SELECT statement
Number of items in the GROUP by or ORDER by clause
Number of value items in INSERT statement
|