Increasing the size of default memory cache makes search spectacularly quicker
Posted: Mon Apr 01, 2019 4:14 pm
I just solved (partially) an irritating problem I have had since my database grew to a certain size (currently, around 10 000 notes under the same tab, with no attachments).
Search got painfully slow, and especially typing search keywords, as I described in that post : http://cintanotes.com/forum/viewtopic.php?f=4&t=2501. CN would stop responding as soon as a single character was typed, so a search for word would look like : w (wait...) o (wait...), and so on for anything you would type (or delete) in the search field.
I just discovered by chance that increasing the value of sqlite.pragma.cache_size, in the cintanotes.settings file, from the default 4 000 to 8 000, greatly reduced that pause between characters, to the point that it's now tolerable (just). It has not disappeared, but it's manageable.
Increasing it from 8 000 to 16 000 did not produce obvious advantages.
I also changed the sqlite.pragma.synchronous value from NORMAL to OFF. The help advises to set it to NORMAL or FULL if experiencing database corruption, and warns that so doing will slow down CN, since it will wait after each modification till the data is written to disk before returning control to the user. However, on my system, the default was NORMAL.
Previously, my CN occupied around 15 MB of private memory. Now it takes from 70 MB to 130 MB. I have 4 GB RAM, and mechanical hard disks.
Speed increased as a result on other CN operations, too.
While what I wrote in that post about search is still valid, I would suggest the sqlite.pragma.cache_size default value might be too low. Also, the default for sqlite.pragma.synchronous seems inconsistent with what's written in the help. Since those settings are completely hidden, correct default values are critical.
Search got painfully slow, and especially typing search keywords, as I described in that post : http://cintanotes.com/forum/viewtopic.php?f=4&t=2501. CN would stop responding as soon as a single character was typed, so a search for word would look like : w (wait...) o (wait...), and so on for anything you would type (or delete) in the search field.
I just discovered by chance that increasing the value of sqlite.pragma.cache_size, in the cintanotes.settings file, from the default 4 000 to 8 000, greatly reduced that pause between characters, to the point that it's now tolerable (just). It has not disappeared, but it's manageable.
Increasing it from 8 000 to 16 000 did not produce obvious advantages.
I also changed the sqlite.pragma.synchronous value from NORMAL to OFF. The help advises to set it to NORMAL or FULL if experiencing database corruption, and warns that so doing will slow down CN, since it will wait after each modification till the data is written to disk before returning control to the user. However, on my system, the default was NORMAL.
Previously, my CN occupied around 15 MB of private memory. Now it takes from 70 MB to 130 MB. I have 4 GB RAM, and mechanical hard disks.
Speed increased as a result on other CN operations, too.
While what I wrote in that post about search is still valid, I would suggest the sqlite.pragma.cache_size default value might be too low. Also, the default for sqlite.pragma.synchronous seems inconsistent with what's written in the help. Since those settings are completely hidden, correct default values are critical.