Disk data usage doesn't decrease when I delete some records. Is it possible? #391
-
|
As I reported in the title, when I delete a record in the IndexedDB, the previously reserved disk space is not released. I discovered this behaviour using JsStore in a PWA app for Android. When I check the app data disk space usage it doesn't decrease even when I delete some records. I need help to understand two things.
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
|
Have you tried removing entire database or clearing all tables data. Few rows of data is not that much to reflect the changes. |
Beta Was this translation helpful? Give feedback.
-
|
Well if you remember my previous issue with the connection.update() command (#388) every row is big and heavy in my app. So the deletion of a single row does make the difference. Anyway, in the application there's an option to clear all the tables and I just use it.... well the storage occupation has increased... a lot (???). I'm coming from relational DB servers like Oracle and SQL Server and in those worlds the disk occupation is actually used in an exclusive way by the DB engine. When a DB reserves a disk space you can delete whatever you want but that disk remains reserved until you explicitly shrink the DB. You can even retrieve deleted data because the deletion of a record is only a logical operation. Instead I'm quite new to indexed DB but seeing the same behaviour as a relational DB server in a noSQL DB is a non sense for me. That's the reason for which I asked if the responsible is indexed DB/JsStore or Android System WebView. When I know who is responsible for this waste of occupation, I can do something to fix it. |
Beta Was this translation helpful? Give feedback.
-
|
Ok Ujjwal, I successfully tested the data size through a browser. I used Google Chrome because Android WebView is based on Chromium too. So I realized that Chromium reserves an entire folder to IndexedDB that is called IndexedDB located in %LocalAppData%\Google\Chrome\User Data\Default.
Regardless of what I really do with the data managed with IndexedDB, the second folder, https_[website]_0.indexeddb.leveldb, grows and grows. What is growing inside the folder is precisely a file called MANIFEST-xxxxxx where xxxxxx is an increasing number. With this test, that you can easily reproduce, the responsibility is clear now. What do you think about that? |
Beta Was this translation helpful? Give feedback.
-
|
Hi @ujjwalguptaofficial, Thank you |
Beta Was this translation helpful? Give feedback.
-
|
Hi @ujjwalguptaofficial, IMHO the doubt on what the heck is happening using text fields remains. I'm surprised how much IndexedDB is similar to a server DB. I always underestimated it and I was wrong. Bye and thank you. |
Beta Was this translation helpful? Give feedback.
Hey @epikgit nope, didn't find anything around this. But i was thinking may be its because of large string size of your image, so one suggestion - could you try storing image as blob.
Let's see what happens.
I feel storing blob is binary file, so if writing data in logs they will write just blob, or binary or object.