Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Filter 重新定义DB筛选器,然后按索引进行区分_Filter_Distinct_Rethinkdb - Fatal编程技术网

Filter 重新定义DB筛选器,然后按索引进行区分

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"

我有一张长得很快的大桌子。我想通过一个字段进行过滤,然后通过另一个字段获得不同的值。然而,在RejectDB中,这会导致从磁盘读取所有记录,就像我从仪表板看到的那样,这需要花费太多的时间。我的质询如下:

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