[sqlite-dev] index_usage fails to run without supposedly optional options

1 view
Skip to first unread message

Arfrever Frehtes Taifersar Arahesis

unread,
May 2, 2019, 9:30:51 PM5/2/19
to SQLite Development
Help message:

$ ./index_usage
Usage: ./index_usage [OPTIONS] DATABASE LOG

DATABASE is an SQLite database against which various statements
have been run. The SQL text is stored in LOG. LOG is an SQLite
database with this schema:

CREATE TABLE sqllog(sql TEXT);

This utility program analyzes statements contained in LOG and prints
a report showing how many times each index in DATABASE is used by the
statements in LOG.

DATABASE only needs to contain the schema used by the statements in
LOG. The content can be removed from DATABASE.

OPTIONS:

--progress N Show a progress message after every N input rows
-q Omit error message when parsing log entries
--using NAME Print SQL statements that use index NAME

Analysis will be done by SQLite version 3.29.0 dated 2019-05-02 15:56:39
checkin number 509d8a8aebe0da4847e95cf737c21313a665de9a. Different versions
of SQLite might use different indexes.
$


So --progress, -q and --using are supposedly optional.
But index_usage fails without any of them:

$ ./sqlite3 <<< $'.save a.db'
$ ./sqlite3 <<< $'CREATE TABLE sqllog(sql TEXT);\n.save b.db'
$ ./index_usage a.db b.db
Usage: ./index_usage [OPTIONS] DATABASE LOG

DATABASE is an SQLite database against which various statements
have been run. The SQL text is stored in LOG. LOG is an SQLite
database with this schema:

CREATE TABLE sqllog(sql TEXT);

This utility program analyzes statements contained in LOG and prints
a report showing how many times each index in DATABASE is used by the
statements in LOG.

DATABASE only needs to contain the schema used by the statements in
LOG. The content can be removed from DATABASE.

OPTIONS:

--progress N Show a progress message after every N input rows
-q Omit error message when parsing log entries
--using NAME Print SQL statements that use index NAME

Analysis will be done by SQLite version 3.29.0 dated 2019-05-02 15:56:39
checkin number 509d8a8aebe0da4847e95cf737c21313a665de9a. Different versions
of SQLite might use different indexes.
$ ./index_usage --progress 1 a.db b.db
$ ./index_usage -q a.db b.db
$ ./index_usage --using x a.db b.db
$

--
Arfrever Frehtes Taifersar Arahesis
_______________________________________________
sqlite-dev mailing list
sqlit...@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-dev

Reply all
Reply to author
Forward
0 new messages