[Bug 20257] IDBCursor should walk on secondary ordering of index value

https://www.w3.org/Bugs/Public/show_bug.cgi?id=20257

--- Comment #4 from Kyaw Tun <kyawtun@yathit.com> ---
Are there other "interesting" cases: filtering multiple field

Suppose we have two indexes

IndexA

index key primary key
========= ===========
"a" ..... 1
"a" ..... 2
"a" ..... 3
"b" ..... 1
"b" ..... 2
"b" ..... 3
"b" ..... 4

IndexB

index key primary key
========= ===========
"B" ..... 3
"B" ..... 5

We want to query record WHERE IndexA = "b" IndexB = "B"

cursorA = IndexA.openKeyCursor(IDKeyRange.only("b")) 
cursorB = IndexB.openKeyCursor(IDKeyRange.only("B")) 

cursorA => ("b", 1)
cursorB => ("B", 3)

since, primary key of cursorA is lower than cursorB, we continue on cursorA.

cursorA.continue("b", 3) => ("b", 3)

since, primary key of cursorA and cursor B are same, we get a result.
result.push(ObjectStore.get(3))

find, next result

cursorA.continue() => ("b", 4)
cursorB.continue() => ("B", 5)

since, primary key of cursorA is lower than cursorB, we continue on cursorA.

cursorA.continue("b", 5) => null

No more result to be found.

Notice that, number of steps require to get the result is independent of record
size, but depend on result size.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Monday, 26 August 2013 23:18:29 UTC