Bug 165215 - IndexedDB: When doing puts, don't do deletes if there are no indexes
Summary: IndexedDB: When doing puts, don't do deletes if there are no indexes
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords:
Depends on:
Blocks: 160306 165889
  Show dependency treegraph
 
Reported: 2016-11-30 12:55 PST by Brady Eidson
Modified: 2021-08-11 15:22 PDT (History)
6 users (show)

See Also:


Attachments
Patch v1 (4.92 KB, patch)
2016-11-30 12:59 PST, Brady Eidson
beidson: review-
Details | Formatted Diff | Diff
PFL (3.54 KB, patch)
2016-11-30 13:25 PST, Brady Eidson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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