# SQLite3: phone is snappier than ever



## p2kmafia

so I've used the sqlite vacuum/re-index feature of V6 SuperCharger blindly without knowing what it does getting a placebo effect sort of thing, and I started doing some research on it and realized that this feature has started getting stripped out of a lot of stock roms and what not on android devices and that basically it makes it wayyyy easier for the system to index and sort out system/app files a lot of it was over the top for me but I figured there could be no negative effects to this at all.

so long story short I downloaded this https://play.google....e3forroot&hl=en SQLite installer and installed it and ran the script for the hell of it to get a fresh index (if someone wants the script i can snag it off of my phone so you don't have to go through all of the v6 setup to get to that option WHICH BY THE WAY I DO NOT RECOMMEND V6SUPERCHARGER IF YOU ARE ON FP1)

Restarted and everything on my phone has been quick and painless it's been up for 6 hours now since the restart and have yet to have any lag/problems.

here's my set up:
Tweaked 2.0
0504 PBJ Kernel
OC'd to 1.2ghz (SIO i/o and Interactive governor)

don't know if it is placebo affect once again and I'd love to get some more veteran knowledge on this but I LOVE MY PHONE NOW

Edit: thank you endless for compiling all of this into an easily flashable .zip file

[background=rgb(245, 245, 245)]This zip installs sqlite3 in /system/xbin and then places the Detailing script from v6_Supercharger in a folder called scripts on the sdcard.[/background]

[background=rgb(245, 245, 245)]1. boot into CWM.[/background]
[background=rgb(245, 245, 245)]2. mount system and wipe cache. [/background]
[background=rgb(245, 245, 245)]3. install downloaded SqLite.zip.[/background]
[background=rgb(245, 245, 245)]4. Run "Detaling.sh" script in /sdcard/scripts/ using script manager. MAKE SURE TO RUN AS ROOT.[/background]

[background=rgb(245, 245, 245)]*Script Manager can be found [/background]here[background=rgb(245, 245, 245)] . [/background]

[background=rgb(245, 245, 245)]and here is the zip: [/background]https://www.dropbox....u2nc/SqLite.zip

HERE IS THE UPDATED SCRIPT. USE THIS INSTEAD OF THE ONE IN THE .ZIP.
https://www.dropbox.com/s/90t2ag0sywsfpr5/Detailing-1.txt
-credit to cilraaz over at XDA for editing the script.

[background=rgb(245, 245, 245)]happy flashing.[/background]
[background=rgb(245, 245, 245)]-p2kmafia[/background]


----------



## jco23

good info, thanks.... how about battery performance, and what kind of data connection did you have over those 6 hours? wifi, 3G, 4G?


----------



## p2kmafia

No noticible change at all maybe slightly better and I'm always on 4G. Why have a 4G phone if you're not going to use it right? Haha but anyways ya man give it a try idk how to uninstall it but you shouldn't have any problems


----------



## jco23

well, I was using 3G prior to the FP1 update b/c I was getting 67% better battery life when compared to 4G:
3G - 20 hours
4G - 12 hours

after the recent FP1 update, I can get 20 hours on 4G.


----------



## p2kmafia

those are some nice numbers. I use my phone a lot so i quickly drain it but i'm always by a charger so I don't care.I just can't stand 3g speeds


----------



## Endless2232

Check your P.M.


----------



## z.lehocki

Just installed and it does feel snappier. Txs for the post. Z


----------



## craigsouthwick

Probably a dumb question but I am trying it out now. If I like it do I need to run the script each time I reboot?

Thanks,

Edit: Does seem snappier but has been really nice since Tweaked 2.0 + FP1 PBJ (not sure which version of PBJ but it works so I don't mess with it)


----------



## p2kmafia

craigsouthwick said:


> Probably a dumb question but I am trying it out now. If I like it do I need to run the script each time I reboot?
> 
> Thanks,
> 
> Edit: Does seem snappier but has been really nice since Tweaked 2.0 + FP1 PBJ (not sure which version of PBJ but it works so I don't mess with it)


run the script when you feel it slowing down and it cleans the files up


----------



## p2kmafia

just ran a benchmark test using antutu's app and i got a 3332 OC'd at 1.3ghz definitely my highest yet


----------



## squid267

just did this and worked with amazing results


----------



## walt45

p2kmafia said:


> run the script when you feel it slowing down and it cleans the files up


Just curious with SManager you can run on boot would that be overkill you think?

Sent from my SCH-I510 using Tapatalk 2


----------



## p2kmafia

walt45 said:


> Just curious with SManager you can run on boot would that be overkill you think?
> 
> Sent from my SCH-I510 using Tapatalk 2


ya I do, I very rarely run the script. whenever I feel some lag I go to clear all of my app cache first and if that doesn't do the trick then I run the script. I don't know how long it takes for it to bog your phone down but i have mine set to run twice a week and I don't notice any difference.

Also I updated the OP with a new detailing script because some users were given errors due to the system not being mounted properly when the script is ran so swap out your scripts everyone.


----------



## dSlice

It says there are a couple of errors in the code.

Line 8 and Line 64


----------



## p2kmafia

dSlice said:


> It says there are a couple of errors in the code.
> 
> Line 8 and Line 64


are you using the updated script I posted in the OP?


----------



## dSlice

Yeah.


----------



## p2kmafia

could be a bad download or a bad install of SQLite3. Which installation method did you use?


----------



## dSlice

The one from the market.

Sent from my SCH-I510 using RootzWiki


----------



## bksyfer

dSlice said:


> It says there are a couple of errors in the code.
> 
> Line 8 and Line 64


Im getting the same two errors two bro.


----------



## p2kmafia

I think it's a bad upload then, here is the new link uploaded from my phone, it works for me, i'm also updating the OP

https://www.dropbox.com/s/90t2ag0sywsfpr5/Detailing-1.txt


----------



## dSlice

That works, thank you!

Sent from my SCH-I510 using RootzWiki


----------



## p2kmafia

dSlice said:


> That works, thank you!
> 
> Sent from my SCH-I510 using RootzWiki


no problem. don't know why it uploaded a different copy haha but I'm glad it works for you.

I recommend using the script twice a week and if you ever feel your phone slowing down use a cache cleaner app first because that slows your device down faster than the sqlite3 database and when that stops speeding it up/your clearing less cache than usual run the script. i've been playing with these and found this to be the best method for it.


----------



## dSlice

Yeah I use the Flush script from Zep and this. Defiantly helps.

Sent from my SCH-I510 using RootzWiki


----------



## map6386

p2kmafia said:


> no problem. don't know why it uploaded a different copy haha but I'm glad it works for you.
> 
> I recommend using the script twice a week and if you ever feel your phone slowing down use a cache cleaner app first because that slows your device down faster than the sqlite3 database and when that stops speeding it up/your clearing less cache than usual run the script. i've been playing with these and found this to be the best method for it.


which cache cleaner app do you use? and second link also worked for me


----------



## p2kmafia

It's called app cache cleaner. The icon looks like a refresh sign. I'm not on my computer so I can't post a link.


----------



## brianakin

Running the updated script on a rooted Charge with Tweaked 2 rom and PBJ kernel, it hangs on "In mgmain jni_onload". I have already selected SU to run as root so what could be causing this?

EDIT: Never mind, it worked after I moved the script into the sdcard/scripts folder. Silly oversight.


----------



## buhohitr

I used the latest script, still have issue with line 64. error: syntax error, unexpected word (expecting "do").
Also line 8, clear
and 'leep:invalid number '1


----------



## buhohitr

EDIT: Issue resolved.Thanks.


----------



## craigsouthwick

Edit: Nevermind


----------



## gasflorida

When I did this, I got 'permission denied' in the log when sqlite3 did a vacuum or reindex. I checked the permissions on the sqlite3 file in
the /system/xbin and it didn't have full permissions. I changed them to include write and now it runs fine with very few errors - only files that are encrypted
or not really database files give an error in the log. Did I do something wrong or are others just not saying anything???

[background=rgb(245, 245, 245)]This zip installs sqlite3 in /system/xbin and then places the Detailing script from v6_Supercharger in a folder called scripts on the sdcard.[/background]

[background=rgb(245, 245, 245)]1. boot into CWM.[/background]
[background=rgb(245, 245, 245)]2. mount system and wipe cache. [/background]
[background=rgb(245, 245, 245)]3. install downloaded SqLite.zip.[/background]
[background=rgb(245, 245, 245)]4. Run "Detaling.sh" script in /sdcard/scripts/ using script manager. MAKE SURE TO RUN AS ROOT.[/background]

[background=rgb(245, 245, 245)]*Script Manager can be found [/background]here[background=rgb(245, 245, 245)] . [/background]

[background=rgb(245, 245, 245)]and here is the zip: [/background]https://www.dropbox....u2nc/SqLite.zip


----------



## p2kmafia

Some databases can't be re indexed it should only be a few days though if it happens frequently something is wrong


----------



## LoH_Mobius

I'm getting permission denied on everything when it runs. I have changed permissions, run as SU, etc...any ideas? I have no idea how SQLite works so I am probably missing something EXTREMELY obvious.

Sent from my SCH-I510 using RootzWiki

VACUUMED: /data/data/com.google.android.youtube/databases/google_analytics.db
/mnt/sdcard/scripts/Detailing-1.txt: line 69: sqlite3: Permission denied
REINDEXED: /data/data/com.google.android.youtube/databases/google_analytics.db
/mnt/sdcard/scripts/Detailing-1.txt: line 69: sqlite3: Permission denied

EDIT: Now I am getting segmentation faults over 99% of the processes...hmm...


----------



## JihadSquad

This topic is quite confusing now. Can someone tell me the best way to install this? Also when should I be clearing cacche


----------



## p2kmafia

LoH_Mobius said:


> This topic is quite confusing now. Can someone tell me the best way to install this? Also when should I be clearing cacche


Install it from either the zip file or the play store installer (note the zip file has an outdated detailing script) download the new detailing script and follow the steps above and it should work fine. Also, I run cache cleaning on 4 hour intervals and the detailing script once a day at midnight


----------



## JihadSquad

Detailing link in op is deas


----------



## p2kmafia

JihadSquad said:


> Detailing link in op is deas


If you meant to say dead, it is not dead. It is the last link in the OP


----------



## Jborch8

Did you say you set up to have the script run automatically every two weeks? If so, could you please explain how you set that up? I was unable to find a way to set up a schedule through Script Manager. Thanks again for this! Been good so far.


----------



## LoH_Mobius

@Jborch8
Open smanager and press the menu hardkey, select more \/, choose advanced options, the middle one should be scheduler: select it. It's fairly self-explanatory from there.


----------



## p2kmafia

Jborch8 said:


> Did you say you set up to have the script run automatically every two weeks? If so, could you please explain how you set that up? I was unable to find a way to set up a schedule through Script Manager. Thanks again for this! Been good so far.


follow exactly what LoH_Mobius said but I run it once a day at midnight (it's the default)


----------



## Jborch8

LoH_Mobius said:


> @Jborch8
> Open smanager and press the menu hardkey, select more \/, choose advanced options, the middle one should be scheduler: select it. It's fairly self-explanatory from there.


Thank you... very self explanatory.


----------



## cnoevl21

For some reason, every time I try to run this I get error messages saying 'Unable to open database file' and its pretty much for every file. No idea whats wrong. I have the detailing.sh in the scripts folder, i run it through smanager, have su enabled, but always get the same errors.


----------



## dSlice

cnoevl21 said:


> For some reason, every time I try to run this I get error messages saying 'Unable to open database file' and its pretty much for every file. No idea whats wrong. I have the detailing.sh in the scripts folder, i run it through smanager, have su enabled, but always get the same errors.


Did you install SQLite3?

Sent from my SCH-I510 using RootzWiki


----------



## cnoevl21

dSlice said:


> Did you install SQLite3?
> 
> Sent from my SCH-I510 using RootzWiki


Is that different than the free one in google play store?


----------



## LoH_Mobius

From the market is the way to go, install it a few times, get the other script file the .txt one

Sent from my SCH-I510 using RootzWiki

EDIT: It took me 3 attempts at installation...first one had no permissions, second never actually installed, third workes like a charm when installed from the "sqlite3 for root" free application on the market.


----------



## cnoevl21

ok, im just missing something here. I got teh sqlite3 installer, it says it is installed. I go to run the script and it still shows all tehose erros _unable to open database files_. The su box is highlighted so I assume that means it is running as root? In advanced options, should it be mounted as rw or ro? Not that it matters since i get the error both ways. Using the .txt, do u mean the one in the OP? Do i just paste it into the detailing.sh file? deleting the one that i downloaded in the zip file?


----------



## BleedsOrangeandBlue

cnoevl21 said:


> ok, im just missing something here. I got teh sqlite3 installer, it says it is installed. I go to run the script and it still shows all tehose erros _unable to open database files_. The su box is highlighted so I assume that means it is running as root? In advanced options, should it be mounted as rw or ro? Not that it matters since i get the error both ways. Using the .txt, do u mean the one in the OP? Do i just paste it into the detailing.sh file? deleting the one that i downloaded in the zip file?


In order:

I think that when I get the "unable to open" error that I've corrected it by opening my file explorer, which mounts /system as writable. 
Highlighted su box does indeed mean its running as root
I don't think it matters, I've never changed it
Maybe get the .txt one and save as a .sh?


----------



## p2kmafia

cnoevl21 said:


> ok, im just missing something here. I got teh sqlite3 installer, it says it is installed. I go to run the script and it still shows all tehose erros _unable to open database files_. The su box is highlighted so I assume that means it is running as root? In advanced options, should it be mounted as rw or ro? Not that it matters since i get the error both ways. Using the .txt, do u mean the one in the OP? Do i just paste it into the detailing.sh file? deleting the one that i downloaded in the zip file?


the script included in the zip file is not up to date please use the detailing-1 script at the bottom of the OP. Also check the permissions of sqlite located in /system/xbin/ with a file manager check everything.


----------



## Loustsoul

What is this doing?

How many licks does it take to get to the center of your Droid Charge? Stop licking your Droid charge!


----------



## p2kmafia

It's a databasing file that runs with almost no footprint that keeps things neat and organized. Google SQLite on Google for better knowledge. I don't quite remember. It work wonders.


----------



## dSlice

It basically goes through and find empty database files and gets rid of them, and while it does that it reindexes the database to make all of the files newer copies, so everything is fresh. It's a maid basically.

Sent from my SCH-I510 using RootzWiki


----------



## ogilviea

cnoevl21 said:


> For some reason, every time I try to run this I get error messages saying 'Unable to open database file' and its pretty much for every file. No idea whats wrong. I have the detailing.sh in the scripts folder, i run it through smanager, have su enabled, but always get the same errors.


Sorry, I can't help here, but can sympathize! Check out my recent posts to http://forum.xda-developers.com/showthread.php?t=991276&page=1423, where I am getting this problem with when vacuuming with sqlite3 v3.7.11 from inside smanager and also at boot time. Running it from the shell (e.g. via 'adb shell' or terminal emulator) works OK. Using an older version of sqlite3 (v3.7.4) doesn't have this problem, but (for my rom) corrupts some of the databases.

Looks like a bug in sqlite3 v3.7.11 .


----------



## ogilviea

See http://forum.xda-developers.com/showpost.php?p=30859792&postcount=14244 for a fix/workaround to this problem.


----------



## stueycaster

When I run it in Smanager it says I don't have root even though it says I have it when the program starts up. Out of curiosity I opened Root Explorer and found an executable and ran it and it said it worked. It does seem a little quicker now. Should I pursue the not root issue in Smanager or do you think Root Explorer is good enough?

Update: I found that Smanager doesn't like SuperSu. I've seen where it's ok to use SuperSu and Superuser at the same time. How do I get it to use Su instead of S/Su? I'm on Tweaked 3.0 and it uses S/Su. I'm not going to remove it.


----------



## stueycaster

stueycaster said:


> When I run it in Smanager it says I don't have root even though it says I have it when the program starts up. Out of curiosity I opened Root Explorer and found an executable and ran it and it said it worked. It does seem a little quicker now. Should I pursue the not root issue in Smanager or do you think Root Explorer is good enough?
> 
> Update: I found that Smanager doesn't like SuperSu. I've seen where it's ok to use SuperSu and Superuser at the same time. How do I get it to use Su instead of S/Su? I'm on Tweaked 3.0 and it uses S/Su. I'm not going to remove it.


I figured out what I was doing wrong. It's all good now. It does seem to make an improvement.

Sent from my SCH-I510 running Tweaked 3.0 + ICA using Tapatalk 2


----------



## p2kmafia

Glad it works for you now feel free to pm me if you have any other issues


----------

