01-02-2014, 11:00 AM | #1 |
Wizard
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
|
Searching for format- format vs formats vs approximate formats?
I've tested these searches and can't notice a difference in speed of results. Maybe my library isn't large enough for the difference to be significant yet. Which would be the fastest search for epub format in a very large library?
Do #1 and #2 look at the files in the book folders? Is #3 faster because it doesn't, even though it's composite column? Is format or formats indexed? What's the difference between format and formats? Last edited by unboggling; 01-02-2014 at 11:14 AM. |
01-02-2014, 11:20 AM | #2 |
Well trained by Cats
Posts: 29,799
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
You don't have SQLite database browser (or equiv)?
the format is stored in the 'data' table. That field is also Indexed (formats_idx) |
Advert | |
|
01-02-2014, 11:46 AM | #3 | |
Wizard
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
|
I was hoping experts would just know the answers off the top of their heads. I do have a database browser. When I use SQLiteStudio I crash frequently. Before asking the question here I upgraded to newest version of SQLiteStudio then crashed again, twice. So I'm leery of using that now and need to find something that works better on OS X 10.9.1. Anybody have any recommendations?
Quote:
The question still is: which search is faster and why? |
|
01-02-2014, 11:50 AM | #4 |
Handy Elephant
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
|
I think the main difference is that formats isn't stored between runs, but has to be populated by checking the actual files when used the first time, typically whenever calibre is started. That can be very slow. But then it is fast. Approximate_formats are stored in the database and doesn't cause any delay when starting calibre.
Both are fast to use. Last edited by Adoby; 01-02-2014 at 11:55 AM. |
01-02-2014, 11:55 AM | #5 |
creator of calibre
Posts: 43,851
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
1 and 2 are exactly the same and they do not check for files. They will be faster than 3. Though given all the optimization and caching that goes on, the speed difference is not going to be very large.
Searching in calibre does not use sql at all, all searching is done on an in memory data structure that stores all metadata, using custom algorithms. SQLITE does not have powerful enough capabilities to power the search in calibre. The only time actual files are checked is if you use the formats() template function, and even then they are only checked once. Simply searching does not recheck the files. |
Advert | |
|
01-02-2014, 12:26 PM | #6 | |
Wizard
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
|
Quote:
So to make sure I understand this, in other words searches are conducted against data structures read into RAM from metadata.db then specially massaged at library startup. So whether a field is indexed or not in the backend doesn't really matter that much after library startup. |
|
01-02-2014, 12:35 PM | #7 |
creator of calibre
Posts: 43,851
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
yes, that is correct. Indexing is a legacy from older backends. I made a decision to generally avoid changing database on file format as much as possible to allow people to run multiple versions of calibre against the same database file safely, therefore, there is a lot of legacy cruft in the db schema.
|
01-02-2014, 01:03 PM | #8 | ||
Wizard
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
|
Quote:
Quote:
|
||
01-02-2014, 09:53 PM | #9 |
creator of calibre
Posts: 43,851
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
yes .
|
01-02-2014, 10:01 PM | #10 |
Wizard
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kindle dictionary .mobi format conversion to ePub or other formats | cathene | Kindle Formats | 1 | 08-11-2013 08:00 PM |
No supported formats (Available formats: 0) (epub)) | luta | Calibre | 2 | 04-27-2013 10:50 AM |
Merge Formats library into Metadata library? Or, Add Format in bulk? | Sabardeyn | Library Management | 5 | 01-23-2013 06:00 AM |
Searching for 'no' formats | ldolse | Calibre | 7 | 09-17-2010 09:27 PM |
Convert Epub and Msreader formats to Kindle formats | bruc79 | Calibre | 17 | 06-22-2010 04:50 AM |