Bug 85288 - IndexedDB: Optimize single-key get()
Summary: IndexedDB: Optimize single-key get()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alec Flett
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-01 09:16 PDT by Alec Flett
Modified: 2012-06-06 20:39 PDT (History)
2 users (show)

See Also:


Attachments
Patch (6.30 KB, patch)
2012-05-30 12:14 PDT, Alec Flett
no flags Details | Formatted Diff | Diff
Patch (6.27 KB, patch)
2012-05-30 13:36 PDT, Alec Flett
no flags Details | Formatted Diff | Diff
Patch (6.31 KB, patch)
2012-06-06 15:10 PDT, Alec Flett
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alec Flett 2012-05-01 09:16:18 PDT
We recently refactored get() to take a key range, and simplified the IDBObjectStore/IDBIndex.get(key) to just call IDBKeyRange.only(), which means when we get to the backend we are always iterating, even if the original intent from the user was just a get(key). We should optimize the backend to recognize when the upper and lower bounds of an IDBKeyRange are identical, and transform that into an actual LevelDBDatabase->get()

One nice thing about this is that we'll get the benefit of bloom filters, and provide a nice optimized path for get(IDBKeyRange.bound(foo, foo, true, true)
Comment 1 Alec Flett 2012-05-30 12:14:08 PDT
Created attachment 144891 [details]
Patch
Comment 2 Alec Flett 2012-05-30 12:15:05 PDT
tony@ - r? cq? A pretty quick one.
Comment 3 Tony Chang 2012-05-30 13:32:48 PDT
Comment on attachment 144891 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=144891&action=review

> Source/WebCore/Modules/indexeddb/IDBKeyRange.h:90
> +        return m_lower == m_upper
> +                && m_lowerType == LowerBoundOpen
> +                && m_upperType == UpperBoundClosed;

Nit: I would just keep this on one line.
Comment 4 Alec Flett 2012-05-30 13:36:15 PDT
Created attachment 144912 [details]
Patch
Comment 5 Alec Flett 2012-05-30 13:37:17 PDT
Comment on attachment 144912 [details]
Patch

tony@ - thanks - still waiting on commit paperwork, mind another r/cq?
Comment 6 WebKit Review Bot 2012-05-30 19:25:49 PDT
Comment on attachment 144912 [details]
Patch

Rejecting attachment 144912 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2

Last 500 characters of output:

Hunk #1 succeeded at 149 with fuzz 2 (offset -11 lines).
patching file Source/WebCore/Modules/indexeddb/IDBKeyRange.h
patching file Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp
Hunk #1 FAILED at 108.
1 out of 1 hunk FAILED -- saving rejects to file Source/WebCore/Modules/indexeddb/IDBObjectStoreBackendImpl.cpp.rej

Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'Tony Chang']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue/

Full output: http://queues.webkit.org/results/12866058
Comment 7 Alec Flett 2012-06-06 15:10:43 PDT
Created attachment 146121 [details]
Patch
Comment 8 Alec Flett 2012-06-06 15:11:34 PDT
Comment on attachment 146121 [details]
Patch

tony@ - r? cq? 

one more pass at this? I collided with myself in the commit queue...
Comment 9 WebKit Review Bot 2012-06-06 20:39:52 PDT
Comment on attachment 146121 [details]
Patch

Clearing flags on attachment: 146121

Committed r119671: <http://trac.webkit.org/changeset/119671>
Comment 10 WebKit Review Bot 2012-06-06 20:39:56 PDT
All reviewed patches have been landed.  Closing bug.