View Single Post
Old 04-29-2011, 12:10 PM   #209
drMerry
Addict
drMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmosdrMerry has become one with the cosmos
 
drMerry's Avatar
 
Posts: 293
Karma: 21022
Join Date: Mar 2011
Location: NL
Device: Sony PRS-650
Quote:
Originally Posted by kovidgoyal View Post
I would suggest minimizing writes to the db. i.e. keep your lists in memory until the end of the search and only then write to the database, preferably with a single executemany call.You probably need to add another API method to database2 for that.
I even think plugins should not have info in the Calibre db.
Maybe a second db that is accessible by the Calibre API.
Reason: (other topic but related to your remark)
Spoiler:
At this moment there are just 'a few' plugins. If you get more and they store info in a db, there would be a point that a large ammount of the db is used by plugin data, no real book data.
The db gets slow by that.
Also possible left overs in db would cause problems.

At the other hand, a lot of plugins would benefit by store data into a db. Like exempted books in this plugin or for example a 'similar author' field. If calibre offers a second db (second file) this could be done without performance-loss. Corruption of db by plugins would cause the second db to be problematic, the main db would stay ok.
drMerry is offline   Reply With Quote