mirror of
https://github.com/ankitects/anki.git
synced 2025-11-30 00:17:12 -05:00
Instead of inserting text into the aux table and sorting on the fly (which does a binary sort), we insert the ids in unicase-sorted order, and then sort based on the automatically assigned rowids - giving us faster sorts, and proper unicase folding.
14 lines
No EOL
254 B
SQL
14 lines
No EOL
254 B
SQL
drop table if exists sort_order;
|
|
create temporary table sort_order (
|
|
pos integer primary key,
|
|
ntid integer not null,
|
|
ord integer not null,
|
|
unique(ntid, ord)
|
|
);
|
|
insert into sort_order (ntid, ord)
|
|
select
|
|
ntid,
|
|
ord
|
|
from templates
|
|
order by
|
|
name |