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

Wenn我在"the_date"上对mongodb表"earnings" Presto seems to do a full table scan and not have the Connector use the index 进行查询:

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) 将数据分组,它将再次进行全面扫描 .

Is there a way to enforce the use of indexes?