09-09-2023, 02:07 PM | #1 |
Chalut o/
Posts: 411
Karma: 145324
Join Date: Dec 2017
Device: Kobo
|
Question about future "Notes"
I saw that a "Note" feature associated to the value of different fields is being developed. I tested it quickly and it looks nice, thanks.
However, I have a purely curious question about the current implementation: Why put them in a separate DB? My understanding of the calibre DB structure is superficial, but there are really "few" new tables in notes.db, "few" enough to be simply added in the main, like the "annotations". So why? Last edited by un_pogaz; 09-09-2023 at 03:56 PM. |
09-09-2023, 10:22 PM | #2 |
creator of calibre
Posts: 43,976
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Because they support full text search which will make the db file very large.
|
09-10-2023, 02:17 AM | #3 |
Chalut o/
Posts: 411
Karma: 145324
Join Date: Dec 2017
Device: Kobo
|
Okay.
So why create this merged DB directly? Why not add the 'main table' to the main DB and create a 'full text search db' separately? Any particular interaction? Or is just a non-final implementation? I'm wondering because I'm synchronizing a backup of my library with exclusion of full-text-search.db One idea that comes to mind is that you're planning to have massive "wikipedia biography" size notes, and so yes, it could be relevant to physically put them apart. Also, is it normal for the 'full text search' annotation tables to be in the main DB, or is this an artifact of my testing with the indev code? Last edited by un_pogaz; 09-10-2023 at 02:39 AM. |
09-10-2023, 02:47 AM | #4 |
null operator (he/him)
Posts: 20,652
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
speculation
The annotations_* tables in metadata.db relate to the Book annotations made in the viewer.
The changes that Kovid and Chaley are working on now appear to be notes pertinent to metadata columns such as Authors, Series, Publishers etc - i.e. an adjunct/alternative to the existing Link fields. They were briefly discussed here ==>> https://www.mobileread.com/forums/sh...46#post4309946 BR |
09-11-2023, 10:17 PM | #5 |
creator of calibre
Posts: 43,976
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Because having so many separate db files is unneccessary clutter and putting tables into separate database files has an overhead in terms of query complexity and performance. Since notes supports FTS and can contain potentially large amounts of text it cannot be in metadata.db so it must be separate. Not to mention I like to develop things incrementally and doing that
wit a separate db file is much easier. And then there are considerations of backup, currently the .calnotes folder is complete including main data and backups. If I were to move some tables into metadata.db there becomes a cross dependence. Splitting it further into a separate fts means you then need to deal with user deleteing only the fts.db and other complications. FTS is optional for the main database not for notes. |
09-12-2023, 07:19 AM | #6 |
Chalut o/
Posts: 411
Karma: 145324
Join Date: Dec 2017
Device: Kobo
|
Okay, I get it.
Thanks. So I imagine that when we do a search for "Plastic demons, Jose Berube" in the notes, it will return results even if the source text is "<strong>Plastic demons</strong>, Jose Berube" right? If true, Great, this will be more handy to do a search. Spoiler:
In the same logic as you presented: Can I say that the table 'annotations' and 'annotations_fts_*' inside the main DB was a "mistake"? I mean, if you did it now, you'd be storing them in a .calannotations folder rather than the current implementation? (probably too late to move them) Oh, and idea: Since there doesn't yet seem to be an implementation for searching notes from the GUI, I'll make the following proposal: In the search bar, use the prefix ":note:" to search inside the notes. So :notes:authors:"search query" will search in the Authors notes, and :notes:"search query" will do in all notes. (Colon at the start is to specified a special sub search type) |
09-12-2023, 07:25 AM | #7 |
creator of calibre
Posts: 43,976
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
yes searching ignores markup.
No not really. Annotations are not large amounts of text, so putting them into the main database is harmless and they are per book so they integrate with the backup schema of OPF files very well. You cant have search via the main bar. The main bar searches for books. Here we are searching for categories such as an author/tag. There will be a dedicated browse notes tool just as there is for annotations that will use the FTS data. |
09-22-2023, 09:30 AM | #8 |
Chalut o/
Posts: 411
Karma: 145324
Join Date: Dec 2017
Device: Kobo
|
Bug report
Little bug report:
Impossible to create/edit new notes. Probably Windows specific. apsw.SQLError: SQLError: unknown function: unixepoch() Spoiler:
|
09-22-2023, 09:41 AM | #9 | |
Grand Sorcerer
Posts: 11,771
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
EDIT: I haven't yet tried 6.27. Doing that now. EDIT 2: 6.27 works, as Kovid said it would. Last edited by chaley; 09-22-2023 at 09:49 AM. |
|
09-22-2023, 09:44 AM | #10 |
creator of calibre
Posts: 43,976
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
6.27 has new enough sqlite for unixepoch()
|
09-29-2023, 02:47 AM | #11 |
Chalut o/
Posts: 411
Karma: 145324
Join Date: Dec 2017
Device: Kobo
|
In sight of some commit, just to be sure: the Category Note will be in a upcoming Calibre 7?
|
09-29-2023, 03:31 AM | #12 |
creator of calibre
Posts: 43,976
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
yes .
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Question: addition of "virtual libraries" (was "base search restriction") | chaley | Library Management | 53 | 04-15-2013 12:52 PM |
"Sharpness" and "Kobo Styling" question? | EldRick | Kobo Reader | 3 | 11-19-2012 09:25 AM |
Daniel Akst asks what about "Apple's iTablet and the future of literature"? | taglines | News | 5 | 01-27-2010 09:00 AM |
Question - Does iLiab have the "search" & "annotation, highlighting" features? | HiSoC8Y | iRex | 5 | 07-01-2009 04:37 PM |