This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 18328 - [IndexedDB] Editorial: Clarify that "record value" === "referenced primary key" for indeces
Summary: [IndexedDB] Editorial: Clarify that "record value" === "referenced primary ke...
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Indexed Database API (show other bugs)
Version: unspecified
Hardware: All All
: P2 minor
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-19 09:37 UTC by Odin Hørthe Omdal
Modified: 2013-01-31 17:43 UTC (History)
3 users (show)

See Also:


Attachments

Description Odin Hørthe Omdal 2012-07-19 09:37:17 UTC
In 3.1.6 Index you find this:

# The records in an index are always sorted according to the records key.
# However unlike object stores, a given index can contain multiple records
# with the same key. Such records are additionally sorted according to the
# records value.


And in a note in the "steps for iterating a cursor" you find:

# records is always sorted in ascending key order. In the case of 
# source being an index, records is secondarily sorted in ascending
# value order.

That is all fine and dandy, because for an index, the key is "toyota" and the value is in fact a *pointer to the referenced record*, so value will be the *key* of the objectstore record.


Technically there is no problem, however, those sentences up there might easily confuse humans (I always have to read it twice). So I hope we can tweak the wording; In "3.1.6 Index"

# The records in an index are always sorted according to the records key.
# However unlike object stores, a given index can contain multiple records
# with the same key. Such records are additionally sorted according to the
# records value (meaning the key of a record in a referenced object store)

And in the steps for iterating a cursor:

# records is always sorted in ascending key order. In the case of 
# source being an index, records is secondarily sorted in ascending
# value order (value in an index is a key from the referenced object
# store).


Please feel free to make it even better or clearer, I'm not super happy about the fixes.

Yeah, and sorry for making bugs at this time, but I hope we want to fix stuff even after CR. ;-)
Comment 1 Eliot Graff 2013-01-31 17:43:07 UTC
Commit #376

Section 3.1.6 now reads:

The records in an index are always sorted according to the record's key. However unlike object stores, a given index can contain multiple records with the same key. Such records are additionally sorted according to the index's record's value (meaning the key of the record in the referenced object store). 

and

Section 5.7 now contains the following note:

records is always sorted in ascending key order. In the case of source being an index, records is secondarily sorted in ascending value order (where the value in an index is the key of the record in the referenced object store). 

Thanks,

Eliot