Closed Bug 836157 Opened 11 years ago Closed 11 years ago

Contacts API: Remove unused indexes

Categories

(Core :: DOM: Device Interfaces, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21
blocking-b2g -
Tracking Status
firefox19 --- wontfix
firefox20 --- wontfix
firefox21 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- fixed

People

(Reporter: gwagner, Assigned: gwagner)

References

Details

Attachments

(1 file, 1 obsolete file)

Currently a save call for a single contact takes around 600 - 1000 msec.
550 msec out of 600 takes the actual transaction to finish.
If we remove all indexes we get down to around 140 msec.
Assignee: nobody → anygregor
Attached patch patch (obsolete) — Splinter Review
Attached patch patchSplinter Review
Attachment #708209 - Attachment is obsolete: true
Attachment #708213 - Flags: review?(bent.mozilla)
Comment on attachment 708213 [details] [diff] [review]
patch

Review of attachment 708213 [details] [diff] [review]:
-----------------------------------------------------------------

Yay!

::: dom/base/IndexedDBHelper.jsm
@@ +58,5 @@
>      };
>  
>      req.onupgradeneeded = function (aEvent) {
> +      if (DEBUG) debug("Database needs upgrade:" + self.dbName + aEvent.oldVersion + aEvent.newVersion);
> +      if (DEBUG) debug("Correct new database version:" + aEvent.newVersion == this.dbVersion);

Nit: Combine in one DEBUG check

::: dom/contacts/fallback/ContactDB.jsm
@@ +53,1 @@
>          objectStore.createIndex("familyName", "properties.familyName", { unique: false, multiEntry: true });

You know, while you're here... :)

You could remove the 'unique: false' from all of these (that's the default). If you want to leave them it's ok too.

@@ -105,5 @@
>          if (!objectStore) {
>            objectStore = aTransaction.objectStore(STORE_NAME);
>          }
> -        // Delete old email index.
> -        objectStore.deleteIndex("email");

Hm, I think you should leave this, since if the email index does exist you're going to do a bunch of work below that will cause the index to update itself.
Attachment #708213 - Flags: review?(bent.mozilla) → review+
blocking-b2g: --- → tef?
Comment on attachment 708213 [details] [diff] [review]
patch

[Triage Comment]
Let's not block the release on this but let's take this.
Attachment #708213 - Flags: approval-mozilla-b2g18+
Blocks: 819091
blocking-b2g: tef? → -
https://hg.mozilla.org/mozilla-central/rev/aba3331a5c54
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Batch edit: Bugs fixed on b2g18 after 1/25 merge to v1.0 branch are fixed on v1.0.1 branch.
You need to log in before you can comment on or make changes to this bug.