0
我有一個快速增長的大表。我想按字段進行過濾,然後通過另一個字段獲取不同的值。然而,在RethinkDB中,這會導致從儀表板讀取所有記錄,這是需要太多時間的。我的查詢如下:RethinkDB篩選器然後按索引區分
r.db("mydb").table("mytable").filter({"AssetID": "a"}).pluck("StartedOn").distinct()
最初的查詢是,但RethinkDB給出了一個錯誤,它不是一個表。
r.db("mydb").table("mytable").filter({"AssetID": "a"}).distinct({index:"StartedOn"})
e: Can only perform an indexed distinct on a TABLE in:
FieldsOn和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: