Hi Yuva, On Fri, 4 Jan 2008 15:32:44 +0530, "Yuvaraj Athur Raghuvir" <[EMAIL PROTECTED]> wrote:
>Hello, > >Is there any way to estimate the size of the metadata of a SQLite database? > >I am trying to do the following: >1) Set the DB size using MAX_PAGE_COUNT and PAGE_SIZE parameters >2) I want to do a bulk insert. >3) However, I want to insert only those many records such that the insert >succeeds. >4) I also want to keep a 30% buffer for the data. I would like to start new >DB instances when that threshold is reached. > >To do step 3 successfully, I have to estimate the size of the meta-data. >Assuming that there is no more data model changes, is there a algorithm or >heuristic to determine the amount of meta data present in the database? > >Thanks and Regards, >Yuva The metadata is mostly in the fileheader and the sqlite_master table. If your schema is more or less static, a run with sqlite3_analyzer will tell you all you need to know. Runs of sqlite3_analyzer on a few sample databases could tell you something about the overhead for your specific data and filling pattern. A more reliable approach is to COMMIT your INSERTs frequently and measure the size of the database file. HTH -- ( Kees Nuyt ) c[_] ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------