IMDb downloader: optimize SQLlite database for the common case
authorPhilipp Zabel <philipp.zabel@gmail.com>
Wed, 6 Jan 2010 10:35:03 +0000 (11:35 +0100)
committerPhilipp Zabel <philipp.zabel@gmail.com>
Wed, 6 Jan 2010 16:42:07 +0000 (17:42 +0100)
commite5dbe982430db4ef426666e6212cabff29af2306
tree1331b9a819855203a8731cb39b322bc8554585a6
parent4aef8710580fd981536d90eb57c8aa640fb49287
IMDb downloader: optimize SQLlite database for the common case

The common case being title searches starting at the beginning of the
string without case sensitivity (Title LIKE "Abc%").
To make SQLite use the title index in this case, define the indexed
columns with the NOCASE collation.
Also, let SQLite generate the movie title index automatically by setting
the Title column as PRIMARY KEY. This has the side effect that only
unique titles can be added to the database (and during the import this
will show a few errors that are in the IMDb dataset).
src/imdb/imdb-plaintext-downloader.vala
src/imdb/imdb-sqlite.vala