akonadi - old files in .local/share/akonadi/file_db_data?

Just wondering, about the following. After migrating to openSUSE leap 15, I encountered some difficulties with kmail / akonadi.

Hence, I started to look around and found the following:

~/.local/share/akonadi/file_db_data> find -type f | wc -l
9056

There are a lot of files in this directory. Are these all needed?

Diving a bit deeper:
~/.local/share/akonadi/file_db_data> ls -l $( find -type f ) | grep " 201[1234567] " | wc -l
8874

The first ones are from 2015.

On the other hand, since I migrated to openSUSE Leap 15 and thus to a newer akonadi; instead of files directories seem to be created:

-rw-r--r-- 1 user1 users    61011 11 jul 18:33 661229_r0
-rw-r--r-- 1 user1 users     5192 11 jul 22:22 661256_r0
-rw-r--r-- 1 user1 users    99838 11 jul 22:22 661258_r0
-rw-r--r-- 1 user1 users     5615 15 jul 08:03 661424_r0
-rw-r--r-- 1 user1 users    21969 15 jul 10:49 661437_r0
--- migrated somewhere here ---
drwxr-xr-x 2 user1 users     4096 22 jul 11:35 31
drwxr-xr-x 2 user1 users     4096 22 jul 11:35 26
drwxr-xr-x 2 user1 users     4096 22 jul 11:35 16

The files in the directory ~/.local/share/akonadi/file_db_data (not the (new) sub directories) consume 500MB of disk space. Quite a lot, especially when they are not used.

So now what? Are these (old) files necessary, can that be determined, is there tool or script that can be used to investigate this?

Related to this, the same question for:

~/.local/share/akonadi/db_data> ls -ltr | sed 's/richard/user1/'
-rw-rw---- 1 user1 users  91147733 10 dec  2009 mysql.slow
-rw-rw---- 1 user1 users     32504  6 sep  2010 mysql-bin.000622
-rw-rw---- 1 user1 users        38  7 sep  2010 mysql-bin.index
-rw-rw---- 1 user1 users     40575  7 sep  2010 mysql-bin.000623
-rw-rw---- 1 user1 users         0 22 dec  2015 multi-master.info
drwx------ 2 user1 users      4096 22 jul 11:35 akonadi
-rw-rw---- 1 user1 users        52 25 jul 13:17 aria_log_control
-rw-rw---- 1 user1 users     73728 25 jul 13:17 aria_log.00000001
-rw-rw---- 1 user1 users     17152 25 jul 13:17 ib_buffer_pool
-rw-r--r-- 1 user1 users  19417071 25 jul 13:25 mysql.err.old

Are the files from 2015 and 2010 and 2009 necessary???

Yet another directory with the same issue:

~/.local/share/akonadi/db_data/akonadi> ls -ltr | sed 's/richard/user1/'
totaal 186364
-rw-rw---- 1 user1 users        65  3 jan  2009 db.opt
-rw-rw---- 1 user1 users      2699 27 dec  2015 resourcetable.frm
-rw-rw---- 1 user1 users     39279 27 dec  2015 collectiontable.frm
-rw-rw---- 1 user1 users      2671 27 dec  2015 mimetypetable.frm
-rw-rw---- 1 user1 users      2671 27 dec  2015 flagtable.frm
-rw-rw---- 1 user1 users      1968 27 dec  2015 parttypetable.frm
-rw-rw---- 1 user1 users      2011 27 dec  2015 collectionattributetable.frm
-rw-rw---- 1 user1 users      1692 27 dec  2015 tagtypetable.frm
-rw-rw---- 1 user1 users      2247 27 dec  2015 tagtable.frm
-rw-rw---- 1 user1 users      1515 27 dec  2015 tagattributetable.frm
-rw-rw---- 1 user1 users      1735 27 dec  2015 tagremoteidresourcerelationtable.frm
-rw-rw---- 1 user1 users      1455 27 dec  2015 pimitemtagrelation.frm
-rw-rw---- 1 user1 users      1463 27 dec  2015 collectionmimetyperelation.frm
-rw-rw---- 1 user1 users      1462 27 dec  2015 collectionpimitemrelation.frm
-rw-rw---- 1 user1 users    114688 27 dec  2015 tagtypetable.ibd
-rw-rw---- 1 user1 users    114688 27 dec  2015 tagremoteidresourcerelationtable.ibd
-rw-rw---- 1 user1 users    114688 27 dec  2015 pimitemtagrelation.ibd
-rw-rw---- 1 user1 users    147456 17 jan  2016 mimetypetable.ibd
-rw-rw---- 1 user1 users    131072  7 mrt  2017 tagtable.ibd
-rw-rw---- 1 user1 users    114688  7 mrt  2017 tagattributetable.ibd
-rw-rw---- 1 user1 users    147456  1 sep  2017 resourcetable.ibd
-rw-rw---- 1 user1 users       470 22 jul 11:34 schemaversiontable.frm
-rw-rw---- 1 user1 users      1692 22 jul 11:34 relationtypetable.frm
-rw-rw---- 1 user1 users    114688 22 jul 11:35 relationtypetable.ibd
-rw-rw---- 1 user1 users      4917 22 jul 11:35 pimitemtable.frm
-rw-rw---- 1 user1 users     98304 22 jul 11:35 schemaversiontable.ibd
-rw-rw---- 1 user1 users      2587 22 jul 11:35 parttable.frm
-rw-rw---- 1 user1 users      2255 22 jul 11:35 relationtable.frm
-rw-rw---- 1 user1 users      1945 22 jul 11:35 pimitemflagrelation.frm
-rw-rw---- 1 user1 users    163840 22 jul 11:35 relationtable.ibd
-rw-rw---- 1 user1 users    114688 22 jul 11:36 parttypetable.ibd
-rw-rw---- 1 user1 users    147456 22 jul 18:22 flagtable.ibd
-rw-rw---- 1 user1 users    147456 22 jul 18:23 collectionmimetyperelation.ibd
-rw-rw---- 1 user1 users    131072 23 jul 15:41 collectionattributetable.ibd
-rw-rw---- 1 user1 users    245760 25 jul 15:23 collectiontable.ibd
-rw-rw---- 1 user1 users    950272 25 jul 15:24 collectionpimitemrelation.ibd
-rw-rw---- 1 user1 users  15728640 25 jul 15:25 pimitemflagrelation.ibd
-rw-rw---- 1 user1 users  37748736 25 jul 15:33 pimitemtable.ibd
-rw-rw---- 1 user1 users 134217728 25 jul 15:37 parttable.ibd

Are the files before 22 jul needed?

I had noticed that change too. The files are mail messages.

As far as I know, it should be safe to remove them. If they are needed, then they will be recreated. Or you could remove the entire “.local/share/akonadi” content, but best to do that when not logged into Plasma (you could login to Icewm just to do that).