space からいくつかのレコードをフェッチする必要がありますusers。このスペースには副次索引がありますcategory_status_rating。category=1、、status=1で ユーザーを選択する必要がありますrating<=123456789:
for _, user in box.space.users.index.category_status_rating:pairs({ 1, 1, 123456789 }, { limit = 20, offset = 5, iterator = box.index.LE }) do
if user[categoryIdx] ~= 1 or user[statusIdx] ~= 1 then break end
table.insert(users, user)
end
私が知っているように、反復indexName:pairsはサポートされておらずlimit、自分のカウンターを使用できます。しかし、どうoffsetですか?このパラメーターを使用して、必要な「ページ」から開始できますか? または、何もせずに反復しoffset、役に立たないレコード (約 100000) を渡しtable.insert(users, user)、「ページ」が始まるときに開始しますか? ありがとう!