Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 01-02-2014, 11:00 AM   #1
unboggling
Wizard
unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.
 
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?

  1. format:epub
  2. formats:epub
  3. #formats2:epub

    Note: #formats2 is composite column with template {:'approximate_formats()'}

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.
unboggling is offline   Reply With Quote
Old 01-02-2014, 11:20 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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)
theducks is online now   Reply With Quote
Advert
Old 01-02-2014, 11:46 AM   #3
unboggling
Wizard
unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.
 
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
Quote:
Originally Posted by theducks View Post
You don't have SQLite database browser (or equiv)?
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:
Originally Posted by theducks View Post
the format is stored in the 'data' table. That field is also Indexed (formats_idx)
Before crashing, I noticed formats_idx is based on "format".

The question still is: which search is faster and why?
unboggling is offline   Reply With Quote
Old 01-02-2014, 11:50 AM   #4
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
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.
Adoby is offline   Reply With Quote
Old 01-02-2014, 11:55 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is online now   Reply With Quote
Advert
Old 01-02-2014, 12:26 PM   #6
unboggling
Wizard
unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.
 
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
Quote:
Originally Posted by kovidgoyal View Post
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.
Thank you, Kovid. That answered my questions.

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.
unboggling is offline   Reply With Quote
Old 01-02-2014, 12:35 PM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is online now   Reply With Quote
Old 01-02-2014, 01:03 PM   #8
unboggling
Wizard
unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.
 
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
Quote:
Originally Posted by unboggling View Post
Thank you, Kovid. That answered my questions.

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.
Quote:
Originally Posted by kovidgoyal View Post
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.
So, again to make sure I understand: Whether a field is indexed or not in the backend doesn't matter at all unless user uses very old version of calibre.
unboggling is offline   Reply With Quote
Old 01-02-2014, 09:53 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,851
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
yes .
kovidgoyal is online now   Reply With Quote
Old 01-02-2014, 10:01 PM   #10
unboggling
Wizard
unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.unboggling ought to be getting tired of karma fortunes by now.
 
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
Quote:
Originally Posted by kovidgoyal View Post
yes .
Thank you.
unboggling is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 09:44 PM.


MobileRead.com is a privately owned, operated and funded community.