W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2011

Re: [Bug 12321] New: Add compound keys to IndexedDB

From: Aryeh Gregor <Simetrical+w3c@gmail.com>
Date: Fri, 18 Mar 2011 12:27:54 -0400
Message-ID: <AANLkTi=Wck=3juEWm6u=yo6LMQwi9=cBYAi-Ek9RaWOt@mail.gmail.com>
To: Jeremy Orlow <jorlow@chromium.org>
Cc: public-webapps@w3.org
On Thu, Mar 17, 2011 at 10:03 PM, Jeremy Orlow <jorlow@chromium.org> wrote:
> Here's one ugliness with A: There's no way to specify ascending
> or descending for the individual components of the key.  So there's no way
> for me to open a cursor that looks at one field ascending and the other
> field descending.  In addition, I can't think of any easy/good ways to hack
> around this.
> Any thoughts on how we could address this use case?

For what it's worth, the way MySQL does it is it doesn't.  If you have
an index on (a, b), then it can be used for ORDER BY a, b or ORDER BY
a DESC, b DESC, but not ORDER BY a DESC, b or ORDER BY a, b DESC.  In
practice this usually works fine -- it's pretty rare that you really
want to sort different columns in a different order.
Received on Friday, 18 March 2011 16:28:48 GMT

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