Support `.eqp` like in sqlite3
还没有人认领这个 Issue。
评估
调研方向
首先检查 litecli 的命令处理方式,以及它如何将 SQLite 语句发送到数据库;payload 未指定具体的文件或测试。将所请求的行为与 sqlite3 的 .eqp on 模式进行比较。完成的标准是 litecli 接受该命令,并为后续的每个请求显示执行计划树,同时有测试覆盖这一行为。
由索引模型根据 Issue 内容生成。
描述
There is an awesome .eqp on command in the default sqlite3 shell. It works like this:
sqlite> .eqp on
sqlite> select distinct book.id, (select coalesce(json_group_array(json_array(v0, v1, v2, v3, v4, v5, v6, v7)), json_array()) from (select b.id as v0, b.path as v1, b.name as v2, b.date as v3, b.added as v4, b.sequence as v5, b.sequence_number as v6, b.lang as v7 from book as b where b.id = book.id) as t) as book, (select coalesce(json_group_array(json_array(v0, v1, v2, v3, v4, v5, v6)), json_array()) from (select distinct author.id as v0, author.fb2id as v1, author.first_name as v2, author.middle_name as v3, author.last_name as v4, author.nickname as v5, author.added as v6 from author join book_author on book_author.author_id = author.id where book_author.book_id = book.id) as t) as authors, (select coalesce(json_group_array(json_array(v0)), json_array()) from (select distinct genre.name as v0 from genre join book_genre on book_genre.genre_id = genre.id where book_genre.book_id = book.id) as t) as genres from book join book_author on book_author.book_id = book.id where (book.sequence = 'Звёздные войны' and book_author.author_id = 45826) order by book.sequence_number asc nulls last, book.name
...> ;
QUERY PLAN
|--SEARCH book_author USING INDEX book_author_author_id (author_id=?)
|--SEARCH book USING INTEGER PRIMARY KEY (rowid=?)
|--CORRELATED SCALAR SUBQUERY 2
| `--SEARCH b USING INTEGER PRIMARY KEY (rowid=?)
|--CORRELATED SCALAR SUBQUERY 4
| |--CO-ROUTINE t
| | |--SEARCH book_author USING COVERING INDEX sqlite_autoindex_book_author_1 (book_id=?)
| | |--SEARCH author USING INTEGER PRIMARY KEY (rowid=?)
| | `--USE TEMP B-TREE FOR DISTINCT
| `--SCAN t
|--CORRELATED SCALAR SUBQUERY 6
| |--CO-ROUTINE t
| | |--SEARCH book_genre USING COVERING INDEX sqlite_autoindex_book_genre_1 (book_id=?)
| | |--SEARCH genre USING INTEGER PRIMARY KEY (rowid=?)
| | `--USE TEMP B-TREE FOR DISTINCT
| `--SCAN t
|--USE TEMP B-TREE FOR DISTINCT
`--USE TEMP B-TREE FOR ORDER BY
122718|[[122718,"/media/sda3/Books/native/439383.fb2","Заря джедаев: В пустоту","","2022-06-19 23:10:14.992363471","Звёздные войны",1,"ru"]]|[[45826,null,"Тим",null,"Леббон",null,"2022-06-19 20:51:32.016737954"]]|[["sf_space"]]
264789|[[264789,"/media/sda3/Books/native/577219.fb2","Заря джедаев: В бесконечность","","2022-06-20 09:48:50.7587699","Звёздные войны",null,"ru"]]|[[45826,null,"Тим",null,"Леббон",null,"2022-06-19 20:51:32.016737954"]]|[["sf_space"]]
173283|[[173283,"/media/sda3/Books/native/439488.fb2","Заря джедаев: В пустоту","","2022-06-20 03:09:41.412632853","Звёздные войны",null,"ru"]]|[[45826,null,"Тим",null,"Леббон",null,"2022-06-19 20:51:32.016737954"]]|[["sf_space"]]
As you can see it outputs the execution plan tree on each request. Would be nice to support it in litecli too
- 主要语言
- Python
- 星标
- 3.3k
- 派生
- 95
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dbcli/litecli 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 3/5 1-2 天 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
symphony:review
难度 2/5 1-3 小时 新手友好度 45/100
-
难度 2/5 1-3 小时 新手友好度 25/100
相似的 Issue
-
[Bug] @deck.gl/arcgis dist import resolves to unpublished @deck.gl/core source path (9.3.11, 9.4.0)未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
workflow: a tick's dispatch counts as 'only this step', and no review self-grants a round unattended未关闭workflow
难度 2/5 1-3 小时 新手友好度 85/100
kristofdegrave/homeassistant-smart-charging#1505 ·
维护者通常 1 天内回复
-
metadata submission
难度 2/5 1-3 小时 新手友好度 82/100
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
canonical/content-cache-operator#163 · 1 条评论 ·
维护者通常 1 天内回复
-
[submission]未关闭submission
难度 1/5 1 小时以内 新手友好度 65/100
leanprover/lean-eval-submissions#1852 ·
维护者通常 1 天内回复