- 新增了IN子查询重写优化。
- 详情请参考https://app.pawsql.com/docs/rule/RuleInSubqueryRewrite
- 全面支持PostgreSQL和MySQL分析函数。
聚集函数
select string_agg(c_name,',') as name from customer group by c_phone;
select c_custkey,group_concat(c_name order by c_name desc ) from customer group by c_custkey;
聚集函数 + 过滤
select string_agg(c_name,',') filter (where c_name like 'ABC%') as name from customer group by c_phone;
select count(1) filter (where c_name like 'ABC%') from customer group by c_phone;
窗口函数
select *, row_number() over (partition by o_custkey order by o_orderkey desc) as rank from orders where o_orderdate = '2022-01-01';
select string_agg(c_name,',') over (partition by c_phone) as name from customer;
-- rows/range
select string_agg(c_name,',') filter (where c_name like 'ABC%') over(partition by c_phone order by c_name ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) as name from customer;
-- exclude
select string_agg(c_name,',') over(partition by c_phone order by c_name ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE TIES) as name
from customer;
窗口函数 + 过滤
select string_agg(c_name,',') filter (where c_name like 'ABC%') over(partition by c_phone) as name from customer;
select *, row_number() filter (where c_name like 'ABC%') over (partition by o_custkey order by o_orderkey desc) as rank from orders where o_orderdate = '2022-01-01';
WITHIN函数
select string_agg(c_name,',') within group(order by c_custkey) over(partition by c_phone) name from customer;
SELECT percentile_cont(0.5) WITHIN GROUP (ORDER BY o.o_totalprice) FROM orders o group by o_custkey;
支持表函数
SELECT * FROM generate_series(1, 10 ) AS t (n); SELECT * FROM customer c, (VALUES( 1 ,2), (3, 4)) AS t(a, b) WHERE t.a = c.c_current_addr_sk AND c.c_customer_sk > t.b;
异常处理
PawSQL识别两种语法解析错误,并在结果中提示用户,以便用户修正自己的SQL。
- 语法解析错误
- 数据库对象不存在
What-If性能验证analyze支持
- 在进行What-If性能验证时,提供analzye选项,获取SQL的真实解析及执行代价,避免了MySQL对中间结果表explain的缺陷,代价估算更加精确。
用户反馈
- 在首页及SQL优化详情页面新增了用户反馈渠道。
- 方便用户对PawSQL整体功能、使用感受进行反馈。
- 方便用户对特定SQL优化结果进行反馈。
ChatGpt集成
- 在SQL优化详情页面的反馈渠道集成了ChatGpt功能,用户可以通过此功能获取ChatGpt对相关SQL的优化建议。
缺陷修复
- 已知缺陷的修复
关于PawSQL
PawSQL专注数据库性能优化的自动化和智能化,支持MySQL,PostgreSQL,Opengauss等,提供的SQL优化产品包括。
- PawSQL Cloud,在线自动化SQL优化工具,支持SQL审查,智能查询重写、基于代价的索引推荐,适用于数据库管理员及数据应用开发人员。
- PawSQL Advisor,IntelliJ 插件, 适用于数据应用开发人员,可以IDEA/DataGrip应用市场通过名称搜索“PawSQL Advisor”安装。
- PawSQL Engine, 是PawSQL系列产品的后端优化引擎,可以独立安装部署,并通过http/json的接口提供SQL优化服务。PawSQL Engine以docker镜像的方式提供部署安装。