1. 安装过程 

sudo apt-get install tcl8.-dev:i386
wget -c "http://www.sqlite.org/2013/sqlite-analyzer-linux-x86-3080200.zip"
unzip sqlite-analyzer-linux-x86-.zip -d ~/bin

 2. 使用示例

  sqlite3_analyzer test.db

/** Disk-Space Utilization Report For test.db

Page size in bytes................................ 1024
Pages in the whole file (measured)................ 6
Pages in the whole file (calculated).............. 6
Pages that store data............................. 5 83.3%
Pages on the freelist (per header)................ 0 0.0%
Pages on the freelist (calculated)................ 0 0.0%
Pages of auto-vacuum overhead..................... 1 16.7%
Number of tables in the database.................. 4
Number of indices................................. 1
Number of defined indices......................... 1
Number of implied indices......................... 0
Size of the file in bytes......................... 6144
Bytes of user payload stored...................... 73 1.2% *** Page counts for all tables with their indices ***************************** TEST.............................................. 2 33.3%
SQLITE_MASTER..................................... 1 16.7%
TEST2............................................. 1 16.7%
TEST3............................................. 1 16.7% *** Page counts for all tables and indices separately ************************* SQLITE_MASTER..................................... 1 16.7%
TEST.............................................. 1 16.7%
TEST2............................................. 1 16.7%
TEST3............................................. 1 16.7%
TEST_IDX.......................................... 1 16.7% *** All tables and indices **************************************************** Percentage of total database...................... 83.3%
Number of entries................................. 19
Bytes of storage consumed......................... 5120
Bytes of payload.................................. 476 9.3%
Average payload per entry......................... 25.05
Average unused bytes per entry.................... 233.32
Maximum payload per entry......................... 77
Entries that use overflow......................... 0 0.0%
Primary pages used................................ 5
Overflow pages used............................... 0
Total pages used.................................. 5
Unused bytes on primary pages..................... 4433 86.6%
Unused bytes on overflow pages.................... 0
Unused bytes on all pages......................... 4433 86.6% *** All tables **************************************************************** Percentage of total database...................... 66.7%
Number of entries................................. 14
Bytes of storage consumed......................... 4096
Bytes of payload.................................. 430 10.5%
Average payload per entry......................... 30.71
Average unused bytes per entry.................... 248.43
Maximum payload per entry......................... 77
Entries that use overflow......................... 0 0.0%
Primary pages used................................ 4
Overflow pages used............................... 0
Total pages used.................................. 4
Unused bytes on primary pages..................... 3478 84.9%
Unused bytes on overflow pages.................... 0
Unused bytes on all pages......................... 3478 84.9% *** All indices *************************************************************** Percentage of total database...................... 16.7%
Number of entries................................. 5
Bytes of storage consumed......................... 1024
Bytes of payload.................................. 46 4.5%
Average payload per entry......................... 9.20
Average unused bytes per entry.................... 191.00
Maximum payload per entry......................... 11
Entries that use overflow......................... 0 0.0%
Primary pages used................................ 1
Overflow pages used............................... 0
Total pages used.................................. 1
Unused bytes on primary pages..................... 955 93.3%
Unused bytes on overflow pages.................... 0
Unused bytes on all pages......................... 955 93.3% *** Table SQLITE_MASTER ******************************************************* Percentage of total database...................... 16.7%
Number of entries................................. 5
Bytes of storage consumed......................... 1024
Bytes of payload.................................. 357 34.9%
Average payload per entry......................... 71.40
Average unused bytes per entry.................... 107.80
Maximum payload per entry......................... 77
Entries that use overflow......................... 0 0.0%
Primary pages used................................ 1
Overflow pages used............................... 0
Total pages used.................................. 1
Unused bytes on primary pages..................... 539 52.6%
Unused bytes on overflow pages.................... 0
Unused bytes on all pages......................... 539 52.6% *** Table TEST and all its indices ******************************************** Percentage of total database...................... 33.3%
Number of entries................................. 10
Bytes of storage consumed......................... 2048
Bytes of payload.................................. 88 4.3%
Average payload per entry......................... 8.80
Average unused bytes per entry.................... 190.90
Maximum payload per entry......................... 11
Entries that use overflow......................... 0 0.0%
Primary pages used................................ 2
Overflow pages used............................... 0
Total pages used.................................. 2
Unused bytes on primary pages..................... 1909 93.2%
Unused bytes on overflow pages.................... 0
Unused bytes on all pages......................... 1909 93.2% *** Table TEST w/o any indices ************************************************ Percentage of total database...................... 16.7%
Number of entries................................. 5
Bytes of storage consumed......................... 1024
Bytes of payload.................................. 42 4.1%
Average payload per entry......................... 8.40
Average unused bytes per entry.................... 190.80
Maximum payload per entry......................... 10
Entries that use overflow......................... 0 0.0%
Primary pages used................................ 1
Overflow pages used............................... 0
Total pages used.................................. 1
Unused bytes on primary pages..................... 954 93.2%
Unused bytes on overflow pages.................... 0
Unused bytes on all pages......................... 954 93.2% *** Index TEST_IDX of table TEST ********************************************** Percentage of total database...................... 16.7%
Number of entries................................. 5
Bytes of storage consumed......................... 1024
Bytes of payload.................................. 46 4.5%
Average payload per entry......................... 9.20
Average unused bytes per entry.................... 191.00
Maximum payload per entry......................... 11
Entries that use overflow......................... 0 0.0%
Primary pages used................................ 1
Overflow pages used............................... 0
Total pages used.................................. 1
Unused bytes on primary pages..................... 955 93.3%
Unused bytes on overflow pages.................... 0
Unused bytes on all pages......................... 955 93.3% *** Table TEST2 *************************************************************** Percentage of total database...................... 16.7%
Number of entries................................. 3
Bytes of storage consumed......................... 1024
Bytes of payload.................................. 23 2.2%
Average payload per entry......................... 7.67
Average unused bytes per entry.................... 327.00
Maximum payload per entry......................... 9
Entries that use overflow......................... 0 0.0%
Primary pages used................................ 1
Overflow pages used............................... 0
Total pages used.................................. 1
Unused bytes on primary pages..................... 981 95.8%
Unused bytes on overflow pages.................... 0
Unused bytes on all pages......................... 981 95.8% *** Table TEST3 *************************************************************** Percentage of total database...................... 16.7%
Number of entries................................. 1
Bytes of storage consumed......................... 1024
Bytes of payload.................................. 8 0.78%
Average payload per entry......................... 8.00
Average unused bytes per entry.................... 1004.00
Maximum payload per entry......................... 8
Entries that use overflow......................... 0 0.0%
Primary pages used................................ 1
Overflow pages used............................... 0
Total pages used.................................. 1
Unused bytes on primary pages..................... 1004 98.0%
Unused bytes on overflow pages.................... 0
Unused bytes on all pages......................... 1004 98.0% *** Definitions *************************************************************** Page size in bytes The number of bytes in a single page of the database file.
Usually 1024. Number of pages in the whole file The number of 1024-byte pages that go into forming the complete
database Pages that store data The number of pages that store data, either as primary B*Tree pages or
as overflow pages. The number at the right is the data pages divided by
the total number of pages in the file. Pages on the freelist The number of pages that are not currently in use but are reserved for
future use. The percentage at the right is the number of freelist pages
divided by the total number of pages in the file. Pages of auto-vacuum overhead The number of pages that store data used by the database to facilitate
auto-vacuum. This is zero for databases that do not support auto-vacuum. Number of tables in the database The number of tables in the database, including the SQLITE_MASTER table
used to store schema information. Number of indices The total number of indices in the database. Number of defined indices The number of indices created using an explicit CREATE INDEX statement. Number of implied indices The number of indices used to implement PRIMARY KEY or UNIQUE constraints
on tables. Size of the file in bytes The total amount of disk space used by the entire database files. Bytes of user payload stored The total number of bytes of user payload stored in the database. The
schema information in the SQLITE_MASTER table is not counted when
computing this number. The percentage at the right shows the payload
divided by the total file size. Percentage of total database The amount of the complete database file that is devoted to storing
information described by this category. Number of entries The total number of B-Tree key/value pairs stored under this category. Bytes of storage consumed The total amount of disk space required to store all B-Tree entries
under this category. The is the total number of pages used times
the pages size. Bytes of payload The amount of payload stored under this category. Payload is the data
part of table entries and the key part of index entries. The percentage
at the right is the bytes of payload divided by the bytes of storage
consumed. Average payload per entry The average amount of payload on each entry. This is just the bytes of
payload divided by the number of entries. Average unused bytes per entry The average amount of free space remaining on all pages under this
category on a per-entry basis. This is the number of unused bytes on
all pages divided by the number of entries. Non-sequential pages The number of pages in the table or index that are out of sequence.
Many filesystems are optimized for sequential file access so a small
number of non-sequential pages might result in faster queries,
especially for larger database files that do not fit in the disk cache.
Note that after running VACUUM, the root page of each table or index is
at the beginning of the database file and all other pages are in a
separate part of the database file, resulting in a single non-
sequential page. Maximum payload per entry The largest payload size of any entry. Entries that use overflow The number of entries that user one or more overflow pages. Total pages used This is the number of pages used to hold all information in the current
category. This is the sum of index, primary, and overflow pages. Index pages used This is the number of pages in a table B-tree that hold only key (rowid)
information and no data. Primary pages used This is the number of B-tree pages that hold both key and data. Overflow pages used The total number of overflow pages used for this category. Unused bytes on index pages The total number of bytes of unused space on all index pages. The
percentage at the right is the number of unused bytes divided by the
total number of bytes on index pages. Unused bytes on primary pages The total number of bytes of unused space on all primary pages. The
percentage at the right is the number of unused bytes divided by the
total number of bytes on primary pages. Unused bytes on overflow pages The total number of bytes of unused space on all overflow pages. The
percentage at the right is the number of unused bytes divided by the
total number of bytes on overflow pages. Unused bytes on all pages The total number of bytes of unused space on all primary and overflow
pages. The percentage at the right is the number of unused bytes
divided by the total number of bytes. *******************************************************************************
The entire text of this report can be sourced into any SQL database
engine for further analysis. All of the text above is an SQL comment.
The data used to generate this report follows:
*/
BEGIN;
CREATE TABLE space_used(
name clob, -- Name of a table or index in the database file
tblname clob, -- Name of associated table
is_index boolean, -- TRUE if it is an index, false for a table
nentry int, -- Number of entries in the BTree
leaf_entries int, -- Number of leaf entries
payload int, -- Total amount of data stored in this table or index
ovfl_payload int, -- Total amount of data stored on overflow pages
ovfl_cnt int, -- Number of entries that use overflow
mx_payload int, -- Maximum payload size
int_pages int, -- Number of interior pages used
leaf_pages int, -- Number of leaf pages used
ovfl_pages int, -- Number of overflow pages used
int_unused int, -- Number of unused bytes on interior pages
leaf_unused int, -- Number of unused bytes on primary pages
ovfl_unused int, -- Number of unused bytes on overflow pages
gap_cnt int, -- Number of gaps in the page layout
compressed_size int -- Total bytes stored on disk
);
INSERT INTO space_used VALUES('sqlite_master','sqlite_master',,,,,,,,,,,,,,,);
INSERT INTO space_used VALUES('test','test',,,,,,,,,,,,,,,);
INSERT INTO space_used VALUES('test2','test2',,,,,,,,,,,,,,,);
INSERT INTO space_used VALUES('test3','test3',,,,,,,,,,,,,,,);
INSERT INTO space_used VALUES('test_idx','test',,,,,,,,,,,,,,,);
COMMIT;

〖Linux〗Ubuntu 64位安装sqlite3_analyzer的更多相关文章

  1. Ubuntu 64位安装32位运行库

    sudo apt-get install ia32-libs 32-64sudo apt-get install libc6:i386sudo apt-get install librt:i386su ...

  2. wine qq 2013 for linux deb包 Ubuntu 64位兼容

    2013-08-08     Wine 1.6,如果您想体验下该版本的wine,目前可以通过ppa进行安装:   sudo add-apt-repository ppa:ubuntu-wine/ppa ...

  3. ubuntu 14.04 64位安装iNodeClient

    ubuntu 14.04 64位安装iNodeClieng(华三校园客服端) http://pan.baidu.com/s/12dpxk ubuntu 14.04 64bit Install H3C ...

  4. Ubuntu 14.04 64位安装Android Studio 和 genymotion (下)

    接上一篇,上回书说到,我们可以进android studio的编辑器了.感觉不错.挺好的,先不说genymotion,先看看你的android项目有没有r文件,项目有没有错误? 如果没有问题的话,下面 ...

  5. hadoop2.6.0汇总:新增功能最新编译 32位、64位安装、源码包、API下载及部署文档

    相关内容: hadoop2.5.2汇总:新增功能最新编译 32位.64位安装.源码包.API.eclipse插件下载Hadoop2.5 Eclipse插件制作.连接集群视频.及hadoop-eclip ...

  6. hadoop2.5发布:最新编译 32位、64位安装、源码包、API以及新特性

    hadoop2.5发布:最新编译 32位.64位安装.源码包.API以及新特性 http://www.aboutyun.com/thread-8751-1-1.html (出处: about云开发) ...

  7. CentOS6.0(64位)安装Apache+PHP+Mysql教程,安装Magento(解决DOM,Mcrypt,GD问题)完整教程

    CentOS6.0(64位)安装Apache+PHP+Mysql教程,安装Magento(解决DOM,Mcrypt,GD问题)完整教程 0   Posted by :小黑 On : 2012 年 9 ...

  8. 在Ubuntu 64位OS上运行hadoop2.2.0[重新编译hadoop]

    最近在学习搭建Hadoop, 我们从Apache官方网站直接下载最新版本Hadoop2.2.官方目前是提供了linux32位系统可执行文件,结果运行时发现提示 “libhadoop.so.1.0.0 ...

  9. ubuntu 64位android项目报错的解决方案,打开64位 Ubuntu 的32位支持功能

    ubuntu的64位下的android环境,说实话,还真得费点精力了,解决一个问题,又出来一个新问题. 小编昨天刚好不容易将android的环境搭建好了,这不,刚建了个项目,直接就报错,下面是罗列出的 ...

随机推荐

  1. hdu 4647 Another Graph Game,想到了就是水题了。。

    题目是给一个无向图,其中每个节点都有点权,边也有边权,然后就有2个小朋友开始做游戏了ALICE &BOB 游戏规定ALICE 先行动然后是BOB,然后依次轮流行动,行动时可以任意选取一个节点并 ...

  2. Delphi7下使用FastMM4

    1> 将文件Replacement BorlndMM DLL/Precompiled/for Delphi IDE/Performance/BorlndMM.dll,替换掉Delphi/Bin下 ...

  3. 由于拷贝的文件太大,不可能一直开着SHELL,所以让SCP后台运行

    原文地址: http://blog.itpub.net/90618/viewspace-750822/ 1:开一个终端,scp命令运行后,输入密码让其拷贝 # scp chris@221.179.1. ...

  4. 转 如何在IOS设备中去掉屏幕上的status bar

    引入如何在IOS设备中去掉屏幕上的status bar,即:不显示设备上方的[网络.时间.电池??]条?操作方法一:在-info.list项目文件中,加上“Status bar is initiall ...

  5. freecms怎样在信息列表类标签中提取info.content

    原文地址:http://javaz.cn/site/javaz/site_study/info/2015/22026.html 项目地址:http://www.freeteam.cn/ 因为info. ...

  6. log4j.properties打印日志信息(1)

    log4j.properties log4j.rootLogger=debug,stdout,logfile ### 把日志信息输出到控制台 ### log4j.appender.stdout=org ...

  7. Spring3数据源的6种配置方法

    在Spring3中,配置DataSource的方法有五种. 第一种:beans.xml <bean id="dataSource" class="org.apach ...

  8. 2008技术内幕:T-SQL语言基础 联接查询摘记

    续 2008技术内幕:T-SQL语言基础 单表查询摘记 第三章 联接查询 Microsoft SQL Server 2008 支持四种表运算符 join(ANSI标准).apply(T-SQL扩展). ...

  9. <mvc:annotation-driven />做了什么

    <mvc:annotation-driven /> 是一种简写形式,完全可以手动配置替代这种简写形式,简写形式可以让初学都快速应用默认配置方案.<mvc:annotation-dri ...

  10. go语言基础之可见性规则验证

    1.可见性规则验证 如果想使用别的包的函数.结构体类型.络构体成员. 函数名.类型名,结构体成员变量名,首字母必段大写,可见. 如果首字母是小写,只能在同一个包里使用. 文件夹样例: 示例: vi t ...