Anki/rslib/src/search/template_order.sql
Damien Elmes 8d17edc1e6 rework aux table sorting
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.
2020-05-12 21:13:33 +10:00

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