Code review comment for lp:~vthompson/mediascanner2/add-case-insensitive-sorting

Revision history for this message
James Henstridge (jamesh) wrote :

I remember discussing this with Victor at the time on IRC, and I think the main issues were:

(a) SQLite's "nocase" collation only helped with characters in the 7-bit ASCII range.

(b) The change means we're no longer taking advantage of the indexes to sort results.

And just looking at the diff now, I can see a third problem:

(c) the "COLLATE $collation" modifier binds to the individual terms of the ORDER BY clause rather than being an independent clause itself. This means that for the places where we sort by multiple columns, we're only doing a nocase collation on the last term.

For the sorting issue, it is possible to create indexes like "CREATE INDEX idx_name ON table (column COLLATE nocase)" which can be used for a nocase sorted result set. But I can't seem to avoid the sort when combined with an indexed WHERE filter.

review: Needs Fixing

« Back to merge proposal