本讲是android camera性能分析专题的第39讲,我们介perfetto 自动化之如何写sql查询语句。
更多资源:
资源 | 描述 |
---|---|
在线课程 | |
知识星球 | 星球名称:深入浅出android camera 星球id: 17296815 |
极客笔记圈 |
sql基本查询语句
查询所有列的数据
select * from thread
查询指定列的数据
select name as name, tid as tid from thread
限制查询结果数量
select * from thread limit 5
对查询结果进行分组
select name from process group by name
对查询结果进行排序
select * from process order by pid desc
select * from process order by pid asc
sql条件查询语句
基本条件查询
select * from process where name='/system/bin/cameraserver'
select * from process where name in ('com.android.camera2', '/system/bin/cameraserver')
模糊条件查询
select * from process where name like '�m%'
sql 条件运算符
sql多表查询
语法:
select column1, column2, ...
from tablea
join tableb on condition;
例子:查询slice name为frame capture
所在的进程名和pid:
select slice.name, process.pid, process.name
from slice
join process_track on slice.track_id = process_track.id
join process using(upid)
where slice.name = 'frame capture'
group by process.name
等价于
select slice.name, process.pid, process.name
from slice
join process_track on slice.track_id = process_track.id
join process on process_track.upid = process.upid
where slice.name = 'frame capture'
group by process.name