やってみる

アウトプットすべく己を導くためのブログ。その試行錯誤すらたれ流す。

SQLite3ドットコマンド(.stats)

 DBSTAT仮想テーブルを使うか否か。

成果物

.help shell

sqlite3 :memory: ".help stats"
.stats ?on|off?          Show stats or turn stats on or off

.stats

デフォルトOFF

sqlite3 :memory: ".show" | grep stats
       stats: off

 OFFのときは何も出ない。

sqlite3 :memory: "select * from dbstat;"

DBSTAT

sqlite3 :memory: \
".stats on" \
"select * from dbstat;"
Memory Used:                         141952 (max 150776) bytes
Number of Outstanding Allocations:   274 (max 318)
Number of Pcache Overflow Bytes:     8360 (max 8360) bytes
Largest Allocation:                  120000 bytes
Largest Pcache Allocation:           4256 bytes
Lookaside Slots Used:                77 (max 100)
Successful lookaside attempts:       179
Lookaside failures due to size:      1
Lookaside failures due to OOM:       69
Pager Heap Usage:                    8924 bytes
Page cache hits:                     1
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   656 bytes
Statement Heap/Lookaside Usage:      66968 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               8
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        66968
Bytes received by read():            31733
Bytes sent to write():               1018
Read() system calls:                 59
Write() system calls:                23
Bytes read from storage:             229376
Bytes written to storage:            0
Cancelled write bytes:               0

対象環境

$ uname -a
Linux raspberrypi 4.19.42-v7+ #1218 SMP Tue May 14 00:48:17 BST 2019 armv7l GNU/Linux

前回まで