<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>18329</bug_id>
          
          <creation_ts>2012-07-19 09:55:55 +0000</creation_ts>
          <short_desc>[IndexedDB] [supertrivial] Use more understandable example for indeces</short_desc>
          <delta_ts>2013-04-01 23:10:41 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>Indexed Database API</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>trivial</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Odin Hørthe Omdal">odinho</reporter>
          <assigned_to name="Eliot Graff">eliotgra</assigned_to>
          <cc>eliotgra</cc>
    
    <cc>jsbell</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71146</commentid>
    <comment_count>0</comment_count>
    <who name="Odin Hørthe Omdal">odinho</who>
    <bug_when>2012-07-19 09:55:55 +0000</bug_when>
    <thetext>I&apos;m a lousy computer, and I think stuff is much easier to understand and relate to when it&apos;s all cute and cuddly.

Could we exchange some of the abstract variables with something real? I&apos;m thinking about changing this text in 3.1.6 Index [1]:

# The values in the index&apos;s records are always values of keys in the
# index&apos;s referenced object store. The keys are derived from the
# referenced object store&apos;s values using a key path. If a given record
# with key X in the object store referenced by the index has the value A,
# and evaluating the index&apos;s key path on A yields the result Y, then the
# index will contain a record with key Y and value X. 
# 
# Records in an index are said to have a referenced value. This is the
# value of the record in the index&apos;s referenced object store which has a
# key equal to the index&apos;s record&apos;s value. So in the example above, the
# record in the index whose key is Y and value is X has a referenced value
# of A.


To maybe something like:

# The values in the index&apos;s records are always values of keys in the
# index&apos;s referenced object store. The keys are derived from the
# referenced object store&apos;s values using a key path. If a given record
# with key 1337 in the object store referenced by the index has
# the value {name:&apos;Ceiling cat&apos;, type:&apos;cat&apos;}, and evaluating the index&apos;s
# key path on that value yields the result &apos;cat&apos;, then the index will
# contain a record with key &apos;cat&apos; and value 1337.
# 
# Records in an index are said to have a referenced value. This is the
# value of the record in the index&apos;s referenced object store which has a
# key equal to the index&apos;s record&apos;s value. So in the example above, the
# record in the index whose key is &apos;cat&apos; and value is 1337 has a
# referenced value of {name:&apos;Garfield&apos;, type:&apos;cat&apos;}.


That might be too concrete and tied to javascript and whatnot (although I personally don&apos;t mind), so if we can&apos;t do that, even using different varible names will help:

# The values in the index&apos;s records are always values of keys in the
# index&apos;s referenced object store. The keys are derived from the
# referenced object store&apos;s values using a key path. If a given record
# with key ID in the object store referenced by the index has the
# value CarInfo, and evaluating the index&apos;s key path on CarInfo yields the
# result Toyota, then the index will contain a record with key Toyota
# and value ID. 
# 
# Records in an index are said to have a referenced value. This is the
# value of the record in the index&apos;s referenced object store which has a
# key equal to the index&apos;s record&apos;s value. So in the example above, the
# record in the index whose key is Toyota and value is ID has a referenced value
# of CarInfo.


BTW, this is super duper minor, I won&apos;t shed a tear if it&apos;s WONTFIX&apos;ed.


[1] http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#index-concept</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71162</commentid>
    <comment_count>1</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-07-19 17:09:21 +0000</bug_when>
    <thetext>I think the normative text needs to remain abstract, but a informative note wouldn&apos;t hurt here.

I also find the spec description of indexes, as special cases of object stores that &quot;reference&quot; other stores, rather confusing. It seems more of an implementation detail (but it&apos;s probably some database-theoretic concept or something.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71788</commentid>
    <comment_count>2</comment_count>
    <who name="Eliot Graff">eliotgra</who>
    <bug_when>2012-08-02 21:45:07 +0000</bug_when>
    <thetext>I&apos;ll add a note paraphrasing the Toyota example to follow the spec text.

Thanks,

E</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85344</commentid>
    <comment_count>3</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2013-04-01 23:10:41 +0000</bug_when>
    <thetext>Added simple examples in https://dvcs.w3.org/hg/IndexedDB/rev/c476bb5cd8b9 to clarify some of the terms.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>