内容摘要:嵌入式数据库直接在应用程序进程中运行,提供了零配置(zero-configuration)运行模式,并且资源占用非常少。本文将介绍流行的 SQLite 数据库引擎,并描述如何在应用程序开发中使用它。
清单 3. SQLite 分析器
C:minblogg>sqlite3_analyzer wwwdbalf.db
Analyzing table mytable...
Analyzing table sqlite_master...
/** Disk-Space Utilization Report For wwwdbalf.db
*** As of 2005-Apr-24 18:56:40
Page size in bytes.................... 1024
Pages in the whole file (measured).... 2
Pages in the whole file (calculated).. 2
Pages that store data................. 2 100.0%
Pages on the freelist (per header).... 0 0.0%
Pages on the freelist (calculated).... 0 0.0%
Pages of auto-vacuum overhead......... 0 0.0%
Number of tables in the database...... 2
Number of indices..................... 0
Number of named indices............... 0
Automatically generated indices....... 0
Size of the file in bytes............. 2048
Bytes of user payload stored.......... 13 0.63%
*** Page counts for all tables with their indices ********************
MYTABLE............................... 1 50.0%
SQLITE_MASTER......................... 1 50.0%
*** All tables *******************************************************
Percentage of total database.......... 100.0%
Number of entries..................... 2
Bytes of storage consumed............. 2048
Bytes of payload...................... 91 4.4%
Average payload per entry............. 45.50
Average unused bytes per entry........ 916.50
Maximum payload per entry............. 78
Entries that use overflow............. 0 0.0%
Primary pages used.................... 2
Overflow pages used................... 0
Total pages used...................... 2
Unused bytes on primary pages......... 1833 89.5%
Unused bytes on overflow pages........ 0
Unused bytes on all pages............. 1833 89.5%
*** Table MYTABLE ****************************************************
Percentage of total database.......... 50.0%
Number of entries..................... 1
Bytes of storage consumed............. 1024
Bytes of payload...................... 13 1.3%
Average payload per entry............. 13.00
Average unused bytes per entry........ 999.00
Maximum payload per entry............. 13
Entries that use overflow............. 0 0.0%
Primary pages used.................... 1
Overflow pages used................... 0
Total pages used...................... 1
Unused bytes on primary pages......... 999 97.6%
Unused bytes on overflow pages........ 0
Unused bytes on all pages............. 999 97.6%
来源:ibm 作者:Nils-Erik Frantzell 责编:豆豆技术应用