[w3c/IndexedDB] Batch get/getAll (Issue #376)

Currently the only way to query a set of individual rows by key is to use repeated calls to `get` or `getAll`. We have some use cases where we want to query many keys with one row each (e.g. the equivalent of SQL `WHERE id IN (1,3,9,...)`), where the event loop potentially adds quite a bit of overhead.

Another option would be to add a batch method for `get` and/or `getAll`, for example:

```
request = store.batchGetAll(keyRangeArray) 
request = index.batchGetAll(keyRangeArray)
```
Which would return an array of arrays corresponding to the input array.

The Chrome team did some internal prototyping and found that in the best case (1 row per key) there is potential for a 3x speedup over mutliple parallel getAll calls. That hasn't been proven in real world use cases yet and it's unclear if other browsers would see the same improvements, but that would be a significant speedup that can't be replicated with the current APIs.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/IndexedDB/issues/376
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/IndexedDB/issues/376@github.com>

Received on Friday, 18 February 2022 03:18:04 UTC