Re: IndexedDB: MultiEntry index limited to 50 indexed values? Ouch.

The spec has no such limitation, implicit or explicit. I put this together:

http://pastebin.com/0GLPxekE

In Chrome 35, at least, I had no problems indexing 100,000 tags. (It's a
bit slow, though, so the pastebin code has only 10,000 by default)

You mention 50 items, which just happens to be how many records are shown
on one page of Chrome's IDB inspector in dev tools. And paging in the
inspector was recently broken (known bug, fix just landed:
http://crbug.com/379483). Are you sure you're not just seeing that?

If you're seeing this consistently across browsers, my guess is that
there's a subtle bug in your code (assuming we've ruled out a double-secret
limit imposed by the cabal of browser implementors...) This isn't a support
forum, so you may want to take the issue elsewhere - the chromium-html5 is
one such forum I lurk on.

If you're not seeing this across browsers, then this is definitely not the
right forum. As always, please try and reduce any issue to a minimal test
case; it's helpful both to understand what assumptions you may be making
(i.e. you mention a cursor; is that a critical part of your repro or is a
simple count() enough?) and for implementors to track down actual bugs. If
you do find browser bugs, please report them - crbug.com,
bugzilla.mozilla.org, etc.



On Thu, Jun 5, 2014 at 2:15 PM, marc fawzi <marc.fawzi@gmail.com> wrote:

> Hi Joshua, IDB folks,
>
> I was about to wrap up work on a small app that uses IDB but to my
> absolute surprise it looks that the number of indexed values in a
> MultiEntry index is limited to 50. Maybe it's not meant to contain an
> infinite number but 50 seems small and arbitrary. Why not 4096?
> Performance? If so, why is it NOT mentioned in any of the IDB docs
> published by the browser vendors?
>
> Following from my previous example (posted to this list), "tags" is a
> multiEntry index defined like so:
>
> objectStore.createIndex("tags", "tags", {unique: false, multiEntry: true})
>
> When I put in say 3000 tags as follows:
>
> var req = objectStore.add({tags: myTagsArray, someKey: someValue, etc:
> etc})
>
> Only the first 50 elements of myTagsArray show up in the Keys column
> within the Chrome Web Console (under Resources-->IndexedDB--->tags) and
> it's not a display issue only: The cursor (shown below) cannot find any
> value beyond the initial 50 values in myTagsArray. This is despite the
> cursor.value.tags containing all 100+ values.
>
> var range = IDBKeyRange.only(tags[0], "prev")
>
> var cursor = index.openCursor(range)
>
> Is this by design? Anyway to get around it (or do it differently) ? and
> why is the limit of 50 on indexed values not mentioned in any of the docs?
>
> I bet I'm missing something... because I can't think of why someone would
> pick the number 50.
>
> Thanks,
>
> Marc
>
>
>
>

Received on Thursday, 5 June 2014 21:53:42 UTC