- From: ArnaudBienner <notifications@github.com>
- Date: Thu, 21 May 2026 07:55:38 -0700
- To: w3c/IndexedDB <IndexedDB@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 21 May 2026 14:55:42 UTC
ArnaudBienner created an issue (w3c/IndexedDB#496) Follow up of #494. This could be an opportunity for optimization. The spec mandates that IDBRecord's key and primarKey [shall be the same value when being retrieved from an IDBObjectStore](https://w3c.github.io/IndexedDB/#retrieve-multiple-items-from-an-object-store): * "Let recordSnapshot be a new [record snapshot](https://w3c.github.io/IndexedDB/#record-snapshot) with its [key](https://w3c.github.io/IndexedDB/#record-snapshot-key) set to key, ... , and [primary key](https://w3c.github.io/IndexedDB/#record-snapshot-primary-key) set to key." For cases where the key is not a primitive type (arrays, ...) it could be nice to state in the spec that the IDBRecord getters shall return the same JS object. i.e. be aliased. Our the implementation side, even if data can be optimized to share underlying data in some cases, it would be even more efficient to not create a different JS object at all: this would save processing time and memory. The observable effect is: `record.key === record.primaryKey` would return true, while it returns false currently. This could apply to IDBCursor too. -- Reply to this email directly or view it on GitHub: https://github.com/w3c/IndexedDB/issues/496 You are receiving this because you are subscribed to this thread. Message ID: <w3c/IndexedDB/issues/496@github.com>
Received on Thursday, 21 May 2026 14:55:42 UTC