Limiting number of rows in a table
My table contains around 16 columns. I want to limit number of rows at 10000. I can :
- Insert only if current size le开发者_运维问答ss than 10000.
- Put a configuration limit (either through some external configuration file or through some dynamic parameter) on the maximum number of rows.
I prefer option 2 because reduced effort checking size for every insert (my table is insert intensive, reading is occasional). It would be useful if this limit can be dynamically set (for example using an sqlite3_limit() -like API), but an /etc/* -like configuration file too would do.
Is this possible on SQLite 3.7.7.1 and Linux (SLES 11)?
精彩评论