问题描述
我正在starburst-presto中运行SQL查询。使用相关的连接器将其连接到elasticsearch。
sql具有“ order by”子句。此子句并未推向Elasticsearch。基本上,我想基于特定字段对Elasticsearch中的数据进行排序并返回结果。使用“ presto”查询“ order by”需要花费大量时间。是否有可能以某种方式获得最佳性能?
sql:select e.employee_id from elasticsearch.es."employee:id:""2390571"" && (doj_timestamp:(>=15965454 && <=15972366)) sort=employee_id:desc" e offset 0 limit 5;
有人可以在这里帮助吗?
解决方法
您的查询同时具有ORDER BY和LIMIT,因此在Presto中称为前N个查询。 Presto当前不提供“前N个”下推功能,但是此功能正在开发中。
- 连接器下推的伞问题:https://github.com/prestosql/presto/issues/18
- 针对前N个下推功能(引擎和SPI支持)的PR草案:https://github.com/prestosql/presto/pull/4784
请提交有关Elasticsearch连接器TopN下推的问题。无论如何,我们都会实施它,但是直接的用户反馈有助于理解问题的优先级。
您可以在Presto community slack的#pushdown
频道上了解更多信息。