Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
Honusnap
Old
(Last edited by Honusnap; 26th March 2012 at 12:00 PM.)
#1  
Honusnap's Avatar
Senior Member - OP
Thanks Meter 352
Posts: 1,024
Join Date: Feb 2010
Lightbulb [MMS][SMS] Debugging / Optimisation of mmssms.db

Hi all,

SMS and MMS are stored in an Sqlite database named mmssms.db, this database contain tables, triggers (34) and some indexes.

I was having "Ghost" threads in my MMS application, threads that can't be removed while they were empty, sometimes dated in 1970... so i dig in the mmssms.db. I found mistakes, bugs, errors in some triggers ... !

Here the result of two days work, this script will update the original build in MMS/SMS database, gaining speed and avoid some bugs.
I've recreated all trigger, corrected some big mistakes and optimise queries for speed. I've also recreated some indexes (added fields).

Some importants queries are now five times faster than before !

=> I've tried it in my phone with no side effect

- Do a titanium backup on "[SMS/MMS/APN] Dialer storage"
- Download the "update.zip" file
- Uncompress it on your sdcard => this will create an "update folder"
- copy your mmssms.db from /data/data/com.android.providers.telephony/databases/ to the "update folder"
- in terminal navigate to the "update folder"
- run the script : "sh update.sh"

=> There are now two files :
- a backup : mmssms.db.bck
- the updated db : mmssms.db

- Copy the mmssms.db back to your /data/data/com.android.providers.telephony/databases/ folder, erasing the old one
- Put the rights back on the mmssms.db (copying to the fat32 sd card should have removed the initial rights)
- Reboot

=> You can now delete "Ghost" threads, they should never come back again... depending if you've got a lot of messages or not you will experience performance gain, faster display .. etc. (got more than 8000 sms/mms)

------ Updates ------

20120227 - Update - 1.1.zip => Seems that id do not works for ICS... wait for clearance

20120307 - Here are the differences i have detected between Gingerbread / ICS in the mmssms.db
- Bad Queries that where here... are always here...
- Two tables have dissapeared : mychannels and wpm
- Some triggers has been reorganised but not completely
- On 7 indexes ... only 2 remains .. !!!
- update.ICS - 1.0 Added
- update.GingerBread - 1.2 Added (mistake corrected) => can be launched on top of 1.1

20120311 - Mistake, the ICS script was the Gingerbread one and vice versa ... :) - Corrected
- update.ICS - 1.1 created
- update.GingerBread - 1.3 created

20120318 - Added a debug log in GingerBread script
- update.GingerBread - 1.4 created

20120325 - Added sqlite3 for people who need it, put it in /system/xbin/ (Do not forget eXecute rights)
Attached Files
File Type: rar update.ICS.1.1.rar - [Click for QR Code] (3.8 KB, 380 views)
File Type: rar update.GingerBread.1.4.rar - [Click for QR Code] (3.7 KB, 305 views)
File Type: rar sqlite3.rar - [Click for QR Code] (14.2 KB, 247 views)
SHSII : ParanoidAndroid 2.54 - RomLightened
Desire HD : AOSP-4.2.2 JDQ39 - RomLightened
Iconia A510 : Stock JB 4.1.2
Iconia A510Bis : NoThrill JB 4.1.2
The Following 14 Users Say Thank You to Honusnap For This Useful Post: [ Click to Expand ]
 
KcDaRookie
Old
#2  
KcDaRookie's Avatar
Senior Member
Thanks Meter 179
Posts: 288
Join Date: Oct 2011
Location: City of Sin

 
DONATE TO ME
oh my gosh i just tried this and this works like a charm, have a thread with about 8500 sms and opening it is so much faster!
incredible work, thank you very much!
The Following User Says Thank You to KcDaRookie For This Useful Post: [ Click to Expand ]
 
seandk
Old
#3  
Senior Member
Thanks Meter 11
Posts: 101
Join Date: Jan 2010
Is it working for all devices ? With all Roms ?

Envoyé depuis mon HTC Sensation XE with Beats Audio avec Tapatalk
 
Honusnap
Old
#4  
Honusnap's Avatar
Senior Member - OP
Thanks Meter 352
Posts: 1,024
Join Date: Feb 2010
Quote:
Originally Posted by KcDaRookie View Post
oh my gosh i just tried this and this works like a charm, have a thread with about 8500 sms and opening it is so much faster!
incredible work, thank you very much!
You're welcome, happy that it help you like it does for me..
SHSII : ParanoidAndroid 2.54 - RomLightened
Desire HD : AOSP-4.2.2 JDQ39 - RomLightened
Iconia A510 : Stock JB 4.1.2
Iconia A510Bis : NoThrill JB 4.1.2
 
Honusnap
Old
#5  
Honusnap's Avatar
Senior Member - OP
Thanks Meter 352
Posts: 1,024
Join Date: Feb 2010
Quote:
Originally Posted by seandk View Post
Is it working for all devices ? With all Roms ?
Well, i've not done extensive tests... but it should work with all roms/device as the mmssms.db is an "Android" database, its format does not often change.

The best things to do is :
1 - Backup
2 - Test
SHSII : ParanoidAndroid 2.54 - RomLightened
Desire HD : AOSP-4.2.2 JDQ39 - RomLightened
Iconia A510 : Stock JB 4.1.2
Iconia A510Bis : NoThrill JB 4.1.2
 
iandol
Old
#6  
iandol's Avatar
Senior Member
Thanks Meter 183
Posts: 384
Join Date: Jan 2012
Location: London
Hi, would it be possible to scan for duplicate messages and remove them; that would be an additional useful optimisation

Thanks, will give this a go...
The Following User Says Thank You to iandol For This Useful Post: [ Click to Expand ]
 
skythunder83
Old
#7  
Member
Thanks Meter 5
Posts: 39
Join Date: Dec 2008
Default as

humm.............................
 
Honusnap
Old
#8  
Honusnap's Avatar
Senior Member - OP
Thanks Meter 352
Posts: 1,024
Join Date: Feb 2010
Quote:
Originally Posted by iandol View Post
Hi, would it be possible to scan for duplicate messages and remove them; that would be an additional useful optimisation
Hi, this should be pretty easy... but what is for you, a "duplicate" ?
It can be a combination of :

- Same text / same date / same time / same recipient / same thread

What kind of problem do you really have ?
SHSII : ParanoidAndroid 2.54 - RomLightened
Desire HD : AOSP-4.2.2 JDQ39 - RomLightened
Iconia A510 : Stock JB 4.1.2
Iconia A510Bis : NoThrill JB 4.1.2
 
UnitedOceanic
Old
#9  
UnitedOceanic's Avatar
Senior Member
Thanks Meter 17
Posts: 153
Join Date: Nov 2010
$ export PATH=/data/local/bin:$PATH
$ sh /sdcard/Download/mms/update/Update.sh
mmssms Update - 1.1
- mmssms.db found
- patch file found
.. backuping mmssms.db
.. Applying Update
Error: near line 448: no such table: main.wpm
Error: near line 479: no such table: main.wpm
Error: near line 489: no such table: main.wpm
$

something wrong there?
 
mykos5
Old
#10  
mykos5's Avatar
Member
Thanks Meter 10
Posts: 46
Join Date: Jul 2010
Location: Apl

 
DONATE TO ME
Quote:
Originally Posted by UnitedOceanic View Post
$ export PATH=/data/local/bin:$PATH
$ sh /sdcard/Download/mms/update/Update.sh
mmssms Update - 1.1
- mmssms.db found
- patch file found
.. backuping mmssms.db
.. Applying Update
Error: near line 448: no such table: main.wpm
Error: near line 479: no such table: main.wpm
Error: near line 489: no such table: main.wpm
$

something wrong there?
same here with ics mms.apk
Sorry for my bad english!

 
Post Reply+
Tags
mmssms.db sms mms optimisation
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...