Filter 重新定义DB筛选器,然后按索引进行区分
我有一张长得很快的大桌子。我想通过一个字段进行过滤,然后通过另一个字段获得不同的值。然而,在RejectDB中,这会导致从磁盘读取所有记录,就像我从仪表板看到的那样,这需要花费太多的时间。我的质询如下:Filter 重新定义DB筛选器,然后按索引进行区分,filter,distinct,rethinkdb,Filter,Distinct,Rethinkdb,我有一张长得很快的大桌子。我想通过一个字段进行过滤,然后通过另一个字段获得不同的值。然而,在RejectDB中,这会导致从磁盘读取所有记录,就像我从仪表板看到的那样,这需要花费太多的时间。我的质询如下: r.db("mydb").table("mytable").filter({"AssetID": "a"}).pluck("StartedOn").distinct() 原始查询如下所示,但REJECTDB给出了一个错误,即它不是一个表 r.db("mydb").table("mytable"
r.db("mydb").table("mytable").filter({"AssetID": "a"}).pluck("StartedOn").distinct()
原始查询如下所示,但REJECTDB给出了一个错误,即它不是一个表
r.db("mydb").table("mytable").filter({"AssetID": "a"}).distinct({index:"StartedOn"})
e: Can only perform an indexed distinct on a TABLE in:
StartedOn和AssetID字段都已编制索引filter
不使用索引,因此我尝试使用getAll
,但仍然存在相同的错误:
r.db("mydb").table("mytable").getAll("a", {index: 'AssetID'}).distinct({index:"StartedOn"})
e: Can only perform an indexed distinct on a TABLE in:
您不能通过一个索引
getAll
,然后在另一个索引上使用索引的distinct
。在这种情况下,我建议在getAll
之后使用未索引的distinct
。您不能通过一个索引getAll
,然后在另一个索引上使用索引的distinct
。在这种情况下,我建议在getAll
之后使用未索引的distinct