Sqlite_analyzer output:
/** Disk-Space Utilization Report For container10M.db
*** As of 2012-Nov-09 13:04:53
Page size in bytes.................... 1024
Pages in the whole file (measured).... 3412536
Pages in the whole file (calculated).. 3412535
Pages that store data................. 3412497 99.999%
Pages on the freelist (per header).... 38 0.001%
Pages on the freelist (calculated).... 39 0.001%
Pages of auto-vacuum overhead......... 0 0.0%
Number of tables in the database...... 6
Number of indices..................... 3
Number of named indices............... 1
Automatically generated indices....... 2
Size of the file in bytes............. 3494436864
Bytes of user payload stored.......... 1768889095 50.6%
*** Page counts for all tables with their indices ********************
OBJECT................................ 3412485 99.999%
SQLITE_MASTER......................... 6 0.0%
INCOMING_SYNC......................... 2 0.0%
OUTGOING_SYNC......................... 2 0.0%
CONTAINER_STAT........................ 1 0.0%
SQLITE_SEQUENCE....................... 1 0.0%
*** All tables and indices *******************************************
Percentage of total database.......... 99.999%
Number of entries..................... 20000017
Bytes of storage consumed............. 3494396928
Bytes of payload...................... 2941393332 84.2%
Average payload per entry............. 147.07
Average unused bytes per entry........ 19.51
Average fanout........................ 90.00
Fragmentation......................... 75.9%
Maximum payload per entry............. 929
Entries that use overflow............. 0 0.0%
Index pages used...................... 22459
Primary pages used.................... 3390038
Overflow pages used................... 0
Total pages used...................... 3412497
Unused bytes on index pages........... 2745050 11.9%
Unused bytes on primary pages......... 387423351 11.2%
Unused bytes on overflow pages........ 0
Unused bytes on all pages............. 390168401 11.2%
*** All tables *******************************************************
Percentage of total database.......... 59.3%
Number of entries..................... 10000017
Bytes of storage consumed............. 2071290880
Bytes of payload...................... 1768893042 85.4%
Average payload per entry............. 176.89
Average unused bytes per entry........ 18.62
Average fanout........................ 90.00
Fragmentation......................... 59.3%
Maximum payload per entry............. 929
Entries that use overflow............. 0 0.0%
Index pages used...................... 22459
Primary pages used.................... 2000286
Overflow pages used................... 0
Total pages used...................... 2022745
Unused bytes on index pages........... 2745050 11.9%
Unused bytes on primary pages......... 183494605 9.0%
Unused bytes on overflow pages........ 0
Unused bytes on all pages............. 186239655 9.0%
*** All indices ******************************************************
Percentage of total database.......... 40.7%
Number of entries..................... 10000000
Bytes of storage consumed............. 1423106048
Bytes of payload...................... 1172500290 82.4%
Average payload per entry............. 117.25
Average unused bytes per entry........ 20.39
Fragmentation......................... 99.910%
Maximum payload per entry............. 119
Entries that use overflow............. 0 0.0%
Primary pages used.................... 1389752
Overflow pages used................... 0
Total pages used...................... 1389752
Unused bytes on primary pages......... 203928746 14.3%
Unused bytes on overflow pages........ 0
Unused bytes on all pages............. 203928746 14.3%
*** Table CONTAINER_STAT *********************************************
Percentage of total database.......... 0.0%
Number of entries..................... 1
Bytes of storage consumed............. 1024
Bytes of payload...................... 185 18.1%
Average payload per entry............. 185.00
Average unused bytes per entry........ 826.00
Maximum payload per entry............. 185
Entries that use overflow............. 0 0.0%
Primary pages used.................... 1
Overflow pages used................... 0
Total pages used...................... 1
Unused bytes on primary pages......... 826 80.7%
Unused bytes on overflow pages........ 0
Unused bytes on all pages............. 826 80.7%
*** Table INCOMING_SYNC and all its indices **************************
Percentage of total database.......... 0.0%
Number of entries..................... 0
Bytes of storage consumed............. 2048
Bytes of payload...................... 0 0.0%
Average payload per entry............. 0.0
Average unused bytes per entry........ 0.0
Fragmentation......................... 0.0%
Maximum payload per entry............. 0
Entries that use overflow............. 0
Primary pages used.................... 2
Overflow pages used................... 0
Total pages used...................... 2
Unused bytes on primary pages......... 2032 99.22%
Unused bytes on overflow pages........ 0
Unused bytes on all pages............. 2032 99.22%
*** Table INCOMING_SYNC w/o any indices ******************************
Percentage of total database.......... 0.0%
Number of entries..................... 0
Bytes of storage consumed............. 1024
Bytes of payload...................... 0 0.0%
Average payload per entry............. 0.0
Average unused bytes per entry........ 0.0
Maximum payload per entry............. 0
Entries that use overflow............. 0
Primary pages used.................... 1
Overflow pages used................... 0
Total pages used...................... 1
Unused bytes on primary pages......... 1016 99.22%
Unused bytes on overflow pages........ 0
Unused bytes on all pages............. 1016 99.22%
*** Indices of table INCOMING_SYNC ***********************************
Percentage of total database.......... 0.0%
Number of entries..................... 0
Bytes of storage consumed............. 1024
Bytes of payload...................... 0 0.0%
Average payload per entry............. 0.0
Average unused bytes per entry........ 0.0
Maximum payload per entry............. 0
Entries that use overflow............. 0
Primary pages used.................... 1
Overflow pages used................... 0
Total pages used...................... 1
Unused bytes on primary pages......... 1016 99.22%
Unused bytes on overflow pages........ 0
Unused bytes on all pages............. 1016 99.22%
*** Table OBJECT and all its indices *********************************
Percentage of total database.......... 99.999%
Number of entries..................... 20000000
Bytes of storage consumed............. 3494384640
Bytes of payload...................... 2941389187 84.2%
Average payload per entry............. 147.07
Average unused bytes per entry........ 19.51
Average fanout........................ 90.00
Fragmentation......................... 75.9%
Maximum payload per entry............. 178
Entries that use overflow............. 0 0.0%
Index pages used...................... 22458
Primary pages used.................... 3390027
Overflow pages used................... 0
Total pages used...................... 3412485
Unused bytes on index pages........... 2744166 11.9%
Unused bytes on primary pages......... 387416400 11.2%
Unused bytes on overflow pages........ 0
Unused bytes on all pages............. 390160566 11.2%
*** Table OBJECT w/o any indices *************************************
Percentage of total database.......... 59.3%
Number of entries..................... 10000000
Bytes of storage consumed............. 2071280640
Bytes of payload...................... 1768888897 85.4%
Average payload per entry............. 176.89
Average unused bytes per entry........ 18.62
Average fanout........................ 90.00
Fragmentation......................... 59.3%
Maximum payload per entry............. 178
Entries that use overflow............. 0 0.0%
Index pages used...................... 22458
Primary pages used.................... 2000277
Overflow pages used................... 0
Total pages used...................... 2022735
Unused bytes on index pages........... 2744166 11.9%
Unused bytes on primary pages......... 183489686 9.0%
Unused bytes on overflow pages........ 0
Unused bytes on all pages............. 186233852 9.0%
*** Indices of table OBJECT ******************************************
Percentage of total database.......... 40.7%
Number of entries..................... 10000000
Bytes of storage consumed............. 1423104000
Bytes of payload...................... 1172500290 82.4%
Average payload per entry............. 117.25
Average unused bytes per entry........ 20.39
Fragmentation......................... 99.910%
Maximum payload per entry............. 119
Entries that use overflow............. 0 0.0%
Primary pages used.................... 1389750
Overflow pages used................... 0
Total pages used...................... 1389750
Unused bytes on primary pages......... 203926714 14.3%
Unused bytes on overflow pages........ 0
Unused bytes on all pages............. 203926714 14.3%
*** Table OUTGOING_SYNC and all its indices **************************
Percentage of total database.......... 0.0%
Number of entries..................... 0
Bytes of storage consumed............. 2048
Bytes of payload...................... 0 0.0%
Average payload per entry............. 0.0
Average unused bytes per entry........ 0.0
Fragmentation......................... 0.0%
Maximum payload per entry............. 0
Entries that use overflow............. 0
Primary pages used.................... 2
Overflow pages used................... 0
Total pages used...................... 2
Unused bytes on primary pages......... 2032 99.22%
Unused bytes on overflow pages........ 0
Unused bytes on all pages............. 2032 99.22%
*** Table OUTGOING_SYNC w/o any indices ******************************
Percentage of total database.......... 0.0%
Number of entries..................... 0
Bytes of storage consumed............. 1024
Bytes of payload...................... 0 0.0%
Average payload per entry............. 0.0
Average unused bytes per entry........ 0.0
Maximum payload per entry............. 0
Entries that use overflow............. 0
Primary pages used.................... 1
Overflow pages used................... 0
Total pages used...................... 1
Unused bytes on primary pages......... 1016 99.22%
Unused bytes on overflow pages........ 0
Unused bytes on all pages............. 1016 99.22%
*** Indices of table OUTGOING_SYNC ***********************************
Percentage of total database.......... 0.0%
Number of entries..................... 0
Bytes of storage consumed............. 1024
Bytes of payload...................... 0 0.0%
Average payload per entry............. 0.0
Average unused bytes per entry........ 0.0
Maximum payload per entry............. 0
Entries that use overflow............. 0
Primary pages used.................... 1
Overflow pages used................... 0
Total pages used...................... 1
Unused bytes on primary pages......... 1016 99.22%
Unused bytes on overflow pages........ 0
Unused bytes on all pages............. 1016 99.22%
*** Table SQLITE_MASTER **********************************************
Percentage of total database.......... 0.0%
Number of entries..................... 15
Bytes of storage consumed............. 6144
Bytes of payload...................... 3947 64.2%
Average payload per entry............. 263.13
Average unused bytes per entry........ 129.73
Average fanout........................ 5.00
Fragmentation......................... 80.0%
Maximum payload per entry............. 929
Entries that use overflow............. 0 0.0%
Index pages used...................... 1
Primary pages used.................... 5
Overflow pages used................... 0
Total pages used...................... 6
Unused bytes on index pages........... 884 86.3%
Unused bytes on primary pages......... 1062 20.7%
Unused bytes on overflow pages........ 0
Unused bytes on all pages............. 1946 31.7%
*** Table SQLITE_SEQUENCE ********************************************
Percentage of total database.......... 0.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%
*** 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 named indices
The number of indices created using an explicit CREATE INDEX statement.
Automatically generated 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.
Fragmentation
The percentage of pages in the table or index that are not
consecutive in the disk file. Many filesystems are optimized
for sequential file access so smaller fragmentation numbers
sometimes result in faster queries, especially for larger
database files that do not fit in the disk cache.
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',0,19,15,3947,0,0,929,1,5,0,884,1062,0,4,6144);
INSERT INTO space_used
VALUES('outgoing_sync','outgoing_sync',0,0,0,0,0,0,0,0,1,0,0,1016,0,0,1024);
INSERT INTO space_used
VALUES('sqlite_autoindex_outgoing_sync_1','outgoing_sync',1,0,0,0,0,0,0,0,1,0,0,1016,0,0,1024);
INSERT INTO space_used
VALUES('incoming_sync','incoming_sync',0,0,0,0,0,0,0,0,1,0,0,1016,0,0,1024);
INSERT INTO space_used
VALUES('sqlite_autoindex_incoming_sync_1','incoming_sync',1,0,0,0,0,0,0,0,1,0,0,1016,0,0,1024);
INSERT INTO space_used
VALUES('object','object',0,12000276,10000000,1768888897,0,0,178,22458,2000277,0,2744166,183489686,0,1199967,2071280640);
INSERT INTO space_used
VALUES('sqlite_sequence','sqlite_sequence',0,1,1,13,0,0,13,0,1,0,0,999,0,0,1024);
INSERT INTO space_used
VALUES('ix_object_deleted_name','object',1,10000000,10000000,1172500290,0,0,119,0,1389750,0,0,203926714,0,1388495,1423104000);
INSERT INTO space_used
VALUES('container_stat','container_stat',0,1,1,185,0,0,185,0,1,0,0,826,0,0,1024);
COMMIT;
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users