Thread: Word Count
View Single Post
Old 04-19-2011, 06:17 AM   #21
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,489
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
@idolse: yes, that is what I mean by precomputed. If the plugin populates a integer (or float?) custom column, then the performance penalty during search & sort is close to zero.

As for how often things are computed: certainly doing a word count on thousands of books will take a while. You might consider storing the date the format was last changed (database2.format_last_modified) in plugin storage (use the per-book persistent data feature). You could then provide an 'update' function that compares the stored date with the format's current date, and recompute the count only if the format has changed.

You might also consider working through the formats in some order until you find one that is not DRM infested.
chaley is offline   Reply With Quote