Bug 165215

Summary: IndexedDB: When doing puts, don't do deletes if there are no indexes
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebCore Misc.Assignee: Brady Eidson <beidson>
Status: REOPENED ---    
Severity: Normal CC: achristensen, alecflett, bfulgham, commit-queue, jsbell, sihui_liu
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 160306, 165889    
Attachments:
Description Flags
Patch v1
beidson: review-
PFL none

Description Brady Eidson 2016-11-30 12:55:50 PST
IndexedDB: When doing puts, don't do deletes if there are no indexes

It's important to "delete before put" to make sure indexes are in a consistent state.

But if an object store has no indexes, we shouldn't bother doing the deletes first.

This saves between 1% and 2% on a tight-insert loop.
Comment 1 Brady Eidson 2016-11-30 12:59:31 PST
Created attachment 295745 [details]
Patch v1
Comment 2 Brady Eidson 2016-11-30 13:12:59 PST
Well, this patch goes ahead and fails tests, so, never mind.
Comment 3 Brady Eidson 2016-11-30 13:22:25 PST
I see the issue with half of this patch.

RecordIDs in the table.

There's also an issue of orphaned blobs.

This might be worth revisiting in the future, but probably not now.

I'll land the "good half" now, as it's still worthwhile.
Comment 4 Brady Eidson 2016-11-30 13:25:31 PST
Created attachment 295749 [details]
PFL
Comment 5 WebKit Commit Bot 2016-11-30 14:46:10 PST
Comment on attachment 295749 [details]
PFL

Rejecting attachment 295749 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-01', 'land-attachment', '--force-clean', '--non-interactive', '--parent-command=commit-queue', 295749, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
/git.webkit.org/WebKit
   0bc77eff..ec707a9 master     -> origin/master
Partial-rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc ...
Currently at 209154 = 0bc77effebf4a1d87caf78b287e1348281916fc8
r209155 = ec707a9b4ab967b1a1b232f888e58a4d3dbab0fb
Done rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc
First, rewinding head to replay your work on top of it...
Fast-forwarded master to refs/remotes/origin/master.

Full output: http://webkit-queues.webkit.org/results/2597527
Comment 6 WebKit Commit Bot 2016-11-30 18:42:49 PST
Comment on attachment 295749 [details]
PFL

Clearing flags on attachment: 295749

Committed r209168: <http://trac.webkit.org/changeset/209168>
Comment 7 WebKit Commit Bot 2016-11-30 18:42:52 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Brady Eidson 2016-11-30 23:06:07 PST
Reverted r209168 for reason:

Caused 2 API tests to fail

Committed r209176: <http://trac.webkit.org/changeset/209176>
Comment 9 Brady Eidson 2016-11-30 23:07:28 PST
(In reply to comment #8)
> Reverted r209168 for reason:
> 
> Caused 2 API tests to fail
> 
> Committed r209176: <http://trac.webkit.org/changeset/209176>

In case we want to revisit this (some day...) exploration on the two failing tests is here:
https://bugs.webkit.org/show_bug.cgi?id=165242