-
-
Notifications
You must be signed in to change notification settings - Fork 652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make use of getAll & getAllKeys when available in IDBObjectStore & IDBIndex #127
Comments
Thanks! I've noticed that and will update Dexie in a future version to optimize toArray() and other methods where possible. Leaving this open until done. |
These function are now generally available, the flag is no longer needed. |
Fixed in v1.4.0-beta2. |
Collection.toArray () is now shortcuted with IDBObjectStore.getAll() or IDBIndex.getAll() depending on whether primary key or index is used. Also works if having used limit() on the collection since getAll () accepts an optional limit. getAllKeys () on the other hand corresponds to primary keys despite its name but can be utilized by calling the new method Collection.primaryKeys(). On both cases, there are situations when this optimization won't be possible:
I.e the query must be a simple Key Range query such as between (), above (), below () or equals (). If not, toArray () and primaryKeys () will fallback to a normal cursor based query. |
The second edition draft of IndexedDB, https://w3c.github.io/IndexedDB/, defines methods that could speed up some toArray(), limit() & keys() queries. Firefox and Chrome have them implemented behind flags.
The text was updated successfully, but these errors were encountered: