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

Re: IndexedDB: Retrieving A Slice Of A Record Value.

From: Odin Hørthe Omdal <odinho@opera.com>
Date: Tue, 17 Apr 2012 14:15:45 +0200
To: "Joran Greef" <joran@ronomon.com>, "public-webapps@w3.org" <public-webapps@w3.org>
Message-ID: <op.wcwscjk449xobu@odinho.eng.oslo.osa>
On Tue, 17 Apr 2012 14:05:39 +0200, Joran Greef <joran@ronomon.com> wrote:
> That would require twice as many keys to be stored, and twice as many  
> disk seeks for every retrieval of the full value?

It'll be up to the browser to implement something efficient there. It's
possible to be smart about it. It's rather easy, because when you search
by the index, you'll get the object returned back, which has both the
header and the body, so you already get everything you need straight up.

If you only wanted to iterate the keys, and do some manual search on them
(because the body is huge), then you'd just open a keyCursor (which
doesn't include the value), and you can go through them efficiently. The
implementation is allowed to optimize (and guess it'd be smart to ;-)
Don't yet know what strange stuff IDB will be used for in future) there.
When you finally want to fetch your real object, you can just 'get()' it
with your new found key.


Anyway, if you have something specific in mind, you should test it. Gecko
has a quite recent-ish released implementation of the spec.

-- 
Odin Hørthe Omdal (Velmont/odinho) · Core, Opera Software ·  
http://opera.com/
Received on Tuesday, 17 April 2012 12:16:19 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:51 GMT