[Guide] SQLite3: Dramatically Improve Entire Phone

Search This thread

p2kmafia

Senior Member
Apr 26, 2012
241
35
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 SQLite Installer from the market

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


As I am a new member here I cannot post links but go to my thread at rootzwiki[dot]com/topic/25072-sqlite3-phone-is-snappier-than-ever/ and read the instructions there and download the easily flashable .zip file with the included detailing script.

happy flashing
p2kmafia
 

HTCluva

Senior Member
Dec 30, 2010
304
17
I just flashed so ill report if results are the same for me

Sent from my SCH-I510 using XDA
 

Cilraaz

Senior Member
Sep 17, 2010
677
265
It would be fairly easy to run before and after database benchmarks in an app such as AnTuTu Benchmark. That would show if there are any real gains to be had.

Looking at the script, it essentially just re-writes all of the databases on the phone (via a VACUUM/REINDEX combo). Logic would state that if you have badly fragmented databases, which would manifest as things like degredation of performance over time, then this should make your phone a bit snappier.

[edit: I ran before and after tests (average of 3 tests). There was no appreciable difference between the tests. Now, the test results may not reflect real world results for two reasons: 1. I have no idea how the database I/O test in AnTuTu actually tests (what database, etc) and 2. I received errors when the script was attempting to vacuum databases ("error: unable to open file"), though the re-indexing worked fine.

End result? The test essentially means nothing and all we can go off of is anecdotal evidence. However, whether it's a placebo effect or not, this process simply can't harmfully impact your phone. As such, results should be anything from no change in response to some response increase.

Yeah, I know. A whole lot of typing that essentially says nothing. Sorry!]
 
Last edited:

p2kmafia

Senior Member
Apr 26, 2012
241
35
RFS or EXT4?

and is this the app: play.google[DOT]com/store/apps/details?id=ptSoft.util.sqlite3forroot

yes that's the app but check out my rootzwiki thread the flashable zip file adds the detailing script to your sd card that you'll need if you feel your device slowing down.

Cilraaz: thanks for testing this out. the error opening files might have to do with a bad install. keep the detailing script and try the app in the playstore for the install or reflash the zip
 

Cilraaz

Senior Member
Sep 17, 2010
677
265
Cilraaz: thanks for testing this out. the error opening files might have to do with a bad install. keep the detailing script and try the app in the playstore for the install or reflash the zip

I re-installed from Play and have tested my copy of sqlite3. It is a working copy. I also didn't flash the zip. I downloaded the zip, extracted the shell script, and manually placed it on my SD card. I've run the vacuum command manually as well, and received the same error.
 

p2kmafia

Senior Member
Apr 26, 2012
241
35
I don't know what to tell you. I just re-ran the detailing script and I don't receive those errors, but if you know it is installed correctly/is vacuuming it shouldn't be a problem. I wish I knew more about this software to help out. I just discovered it helps a lot haha.
 

Endless2232

Senior Member
Sep 2, 2011
219
91
I re-installed from Play and have tested my copy of sqlite3. It is a working copy. I also didn't flash the zip. I downloaded the zip, extracted the shell script, and manually placed it on my SD card. I've run the vacuum command manually as well, and received the same error.

Are you using script manager to run the script? And if so are you running with root privileges?

Sent from my SCH-I510 using xda premium
 

Cilraaz

Senior Member
Sep 17, 2010
677
265
Are you using script manager to run the script? And if so are you running with root privileges?

Sent from my SCH-I510 using xda premium

Script manager as root. Command line as root. The entire script and individual manual vacuums. Same result on all. Maybe I'll boot into CWM and run a fix permissions to see if that does anything.
 

Endless2232

Senior Member
Sep 2, 2011
219
91
Check the permissions of sqlite3 in system/xbin using root explorer. Read and execute should have all three checkboxes checked and write should have owner checked.

Sent from my SCH-I510 using xda premium
 

p2kmafia

Senior Member
Apr 26, 2012
241
35
Check the permissions of sqlite3 in system/xbin using root explorer. Read and execute should have all three checkboxes checked and write should have owner checked.

Sent from my SCH-I510 using xda premium

hey endless I just checked my sqlite3 and it has all 9 checks across the board. should I change them as well even though i'm not experiencing any problems?
 

Crap7126

Member
Apr 1, 2012
44
5
Los Angeles
So i did everything in the instructions and i have one little question. Do i keep the script running in the background?

Sent from my SCH-I510 using xda premium
 

p2kmafia

Senior Member
Apr 26, 2012
241
35
So i did everything in the instructions and i have one little question. Do i keep the script running in the background?

Sent from my SCH-I510 using xda premium

No. Once you've flashed/installed SQLite3 it runs by itself it's not a script. the detailing script is a run once kind of thing that you run if you feel your phone slowing down/lagging. I usually run it anywhere from once every 2 days to once every 3 or 4.

I also have an auto cache clearing app that I use that helps with lag so you don't get the two mixed up.
 

deafptl4ever

Senior Member
Aug 30, 2009
332
44
67
Fort Smith, Arkansas
No. Once you've flashed/installed SQLite3 it runs by itself it's not a script. the detailing script is a run once kind of thing that you run if you feel your phone slowing down/lagging. I usually run it anywhere from once every 2 days to once every 3 or 4.

I also have an auto cache clearing app that I use that helps with lag so you don't get the two mixed up.

Failed for me.

Sent from my SCH-I510 using xda premium
 

Cilraaz

Senior Member
Sep 17, 2010
677
265
Check the permissions of sqlite3 in system/xbin using root explorer. Read and execute should have all three checkboxes checked and write should have owner checked.

If this was in regard to my issue, it's of no consequence. The sqlite3 executable was running fine, as evidenced by the fact that there were no errors in executing sqlite3 (the REINDEX command ran without problem). The permission issue would be with the database files themselves, though root should have no permission issues on r/w partitions like data and dbdata, or wherever sqlite3 is trying to write the temporary database during the VACUUM process. The VACUUM process actually reads data out of the database file, stores it in a temporary file, and then overwrites the original file with data from the temporary file. This eliminates "blank" data and fragmentation within the database files, which is why you see a slight performance increase and smaller database footprint.

Does anyone know where that temporary db file is stored by sqlite3?
 

cnoevl21

Senior Member
Feb 26, 2010
529
22
OnePlus 8T
This def made my phone much snappier. My only question is, when i run the script i get a constant error, "error mountind database". Not really sure whato do (if anything) since it has made the phone quicker regardless.

Sent from my SCH-I510 using XDA
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Mount the root phone directory before running script. That should fix the errors.

    This did resolve my permission issues... and was much easier than tracking down where sqlite3 dumps its temporary databases. Thank you!

    Edit: To avoid anyone else having the problem I had, I've re-written the Detailing.sh script to remount "/" and "/system" as read/write prior to the vacuum and reindex, then remount as read-only afterward. It's attached to this post as "Detailing.txt". Simply download it, place it on your SDCard wherever you'd like to run it from, and rename it to "Detailing.sh" (the forum doesn't allow uploading of shell scripts).

    Note: My version of the script should be used on the Droid Charge ONLY, as it refers directly to /dev/block/stl10 for /system.

    Edit2: I should mention that I did test the script on my own phone and it acted as it should. It properly remounted r/w before, the vacuum/reindex ran fine, and it properly remount r/o after.

    Edit3: I have re-saved the file in notepad++ to try to avoid any issues that wordpad threw into the mix (the below line 63 error). Hopefully this version works better.

    Side-note: Line 63 is:
    for i in `busybox find /d* -iname "*.db"`; do
    so I'm not sure why it's erroring outside of some kind of formatting error.

    Edit4: Rewrote the script to check the /system partition's filesystem and remount using that type specifically. It shouldn't make any difference, but I figured this was safer. This was also a complete copy/paste into a new file. With luck, maybe it will avoid the line 63 errors now.
    1
    Mount the root phone directory before running script. That should fix the errors.

    Sent from my SCH-I510 using xda premium
    1
    I got all of my information from there, and ran as root. Until I moved the detailing.sh script to the sdcard/scripts folder, I was getting a different message (mgmain jni_onload) and locking up.

    Now it will at least run without the mgmain lockup, but every pass at the sqlite3 call throws the error, followed by the echo statement. So I am now wondering if it is a path issue, and how I would set the path to find sqlite3, since it is already in system/xbin. Thanks.

    Just because you have the executable doesn't necessarily mean it's installed properly. I was getting link library errors with it when I was on Eclipse 1.4. I'd just try the sqlite installer from the market, re-install, and see how things work then.