ProtonMail / proton-bridge

Proton Mail Bridge application
GNU General Public License v3.0
1.14k stars 152 forks source link

very slow local sync #391

Closed jknockaert closed 1 year ago

jknockaert commented 1 year ago

Am using bridge v3.1.3 on macOS 13.4. On my laptop I use MailMate as IMAP client. With bridge fully synced it takes MailMate between 5 and 10 minutes to do a local sync against bridge even when there aren't any new messages. That's a bit on the slow end of things. There may be a relation with #354. I have about 100 folders. I am somehow suspecting that it may be the gluon database that is missing an index. I have been peeking into the bridge files and managed to open a .db file with sqlite, so I guess that is what is being used as db backend. Browsing through the tables and looking at the indexes I noticed the absence of any index on ui_ds(mailbox_ui_ds) and also message_flags(message_flags), but I may be misunderstanding the database model. Is there any way to log the database queries? That would be helpful to identify potential optimisations.

LBeernaertProton commented 1 year ago

@jknockaert your suspicions are indeed correct. We are currently working on refactoring the code/database to address the issues reported by #354.

I will close this ticket as it is basically a duplicate of #354. Please follow that ticket for further updates.