GNOME Bugzilla – Bug 714061
Don't store attachments in database
Last modified: 2019-06-02 10:09:06 UTC
---- Reported by jim@yorba.org 2013-01-05 10:34:00 -0800 ---- Original Redmine bug id: 6185 Original URL: http://redmine.yorba.org/issues/6185 Searchable id: yorba-bug-6185 Original author: Jim Nelson Original description: Currently Geary stores the entire message in the database. This was a controversial decision but one we made for reasons of expediency. Slicing up the message between the filesystem and the database has its own set of problems. However, if the database begins filling up with large attachments, that could cause all kinds of performance problems. We should attempt to find a way around this issue. ---- Additional Comments From geary-maint@gnome.bugs 2013-04-03 18:30:00 -0700 ---- ### History #### #1 Updated by Jim Nelson 10 months ago * **Tracker** changed from _Bug_ to _Feature_ #### #2 Updated by Jim Nelson 10 months ago * **Target version** changed from _0.3.0_ to _0.4.0_ #### #3 Updated by Jim Nelson 8 months ago * **Target version** changed from _0.4.0_ to _0.5.0_ --- Bug imported by chaz@yorba.org 2013-11-21 20:24 UTC --- This bug was previously known as _bug_ 6185 at http://redmine.yorba.org/show_bug.cgi?id=6185 Unknown milestone "unknown in product geary. Setting to default milestone for this product, "---". Setting qa contact to the default for this product. This bug either had no qa contact or an invalid one. Resolution set on an open status. Dropping resolution
I see that attachments are saved in ~/.local/share/geary/<account>/attachments They are saved _also_ in the database? (probably yes, because I see that my current .db file is 300 MB, which I guess it's a lot for 2 weeks sync).
The database stores the full header and body of each message, which includes the attachments in their encoded forms. The reason they're also stored in the attachments/ directory is to make their decoded form (which is the form that's useful to applications and humans) available for drag-and-drop and saving (which is really a copy operation). That's also how we thumbnail the attachments. The purpose of this ticket is to find a way not to store all that encoded data in the database. In some ways this ticket is related to and at odds with bug #714094, which is to optionally download attachments. Charles' comment in that ticket is to never create the attachment file without the user's explicit permission.
Adding myself to this; in my business mail account, geary.db right now has a size of 13GB and is barely usable (see https://bugzilla.gnome.org/show_bug.cgi?id=713449#c2 too).
This may also help Bug 713956, so adding it as a dependency.
Closing this in favour of https://gitlab.gnome.org/GNOME/geary/issues/453