W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2013

[IndexedDB] request feedback on IDBKeyRange.inList([]) enhancement

From: Ben Kelly <bkelly@mozilla.com>
Date: Fri, 17 May 2013 17:37:24 -0400
Message-Id: <DAB6534F-96AD-4302-A45B-C8838642F1E3@mozilla.com>
To: public-webapps@w3.org
Hello all,

Recently I've been working on a mobile application that makes heavy use of IndexedDB.  In particular, there are times when this app must query a potentially large, non-consecutive list of keys.  Currently (to my knowledge) the IndexedDB API requires that this be done via separate get() calls.  Due to some performance issues I investigated enhancing the IndexedDB API to allow the list of keys to be queried in a single request.  The resulting changes seem to show significant performance improvement on the mozilla mobile platform.

I would like to get your feedback and input on this API change.

The enhancement essentially adds an inList() function to IDBKeyRange.  Similar to the other factory methods on IDBKeyRange, this returns an object which can be used to query a matching set of keys.  The inList() function takes an array of keys to match against.  In practice it would look like the following:

  var keyRange = IDBKeyRange.inList(['key-1', 'key-2', 'key-3']);
  var request = index.openCursor(keyRange);

Duplicate keys in the list are ignored.  The order of the results would be controlled by the normal cursor ordering mechanisms.

I've written a rough proof-of-concept for the mozilla platform here:

  https://bugzilla.mozilla.org/show_bug.cgi?id=872741

I realize there has been some discussion of this topic in the past.  In particular, Ben Turner referred me to:

  https://www.w3.org/Bugs/Public/show_bug.cgi?id=16595
  https://docs.google.com/a/mozilla.com/document/d/1vvC5tFZCZ9T8Cwd2DteUvw5WlU4YJa2NajdkHn6fu-I/edit

From these links it sounds like there has been a lack of interest, but no strong objection.  Since there appears to be some legitimate benefit from the API enhancement I thought I would send it out to the list for feedback.  I have to admit I'm new to the standardization process, though.  I apologize for the noise if this is essentially a non-starter.

Any feedback is greatly appreciated.  Thank you!

Ben Kelly
Received on Sunday, 19 May 2013 15:40:14 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:18:49 UTC