Presto不使用带有mongodb查询的索引

时间:2018-01-08 07:41:56

标签: mongodb presto

我已经设置了一个具有一个Coordinator和一个Worker节点的Presto(0.191)实例,并希望使用来自mysql和mongodb等多个来源的数据进行一些数据分析。

Wenn我在mongodb表上查询“收益”Presto 似乎进行了全表扫描而没有连接器在“the_date”上使用索引

select e._id from mongodb.database.earnings e where e.the_date between timestamp '2015-01-01 00:00 UTC' and timestamp '2015-01-02 00:00 UTC'

我读到谓词下推只有在谓词中没有涉及函数的情况下才有效,所以我创建了一个内存表,其中一行包含我在其中使用的两个时间戳字段与查询的连接。查询看起来像这样,似乎使用索引:

select e._id from mongodb.reporting.dfpearnings e, memory.test.date_range dr where e.the_date between dr.begin and dr.excluding_end

现在,如果我想用group by date(e.the_date)将数据分组,那么它将再次进行全面扫描。

有没有办法强制使用索引?

0 个答案:

没有答案
相关问题