mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 09:16:38 -04:00
fetch notes in nid order
May reduce the amount of seeking on conventional disks. Chunking and fetching batches of notes at once would improve things further, at the cost of more memory use.
This commit is contained in:
parent
2413f286b1
commit
4c9b6be832
1 changed files with 1 additions and 1 deletions
|
@ -150,7 +150,7 @@ impl SqliteStorage {
|
||||||
) -> Result<Vec<(NoteTypeID, NoteID)>> {
|
) -> Result<Vec<(NoteTypeID, NoteID)>> {
|
||||||
let mut sql = String::from("select mid, id from notes where id in ");
|
let mut sql = String::from("select mid, id from notes where id in ");
|
||||||
ids_to_string(&mut sql, nids);
|
ids_to_string(&mut sql, nids);
|
||||||
sql += " order by mid";
|
sql += " order by mid, id";
|
||||||
self.db
|
self.db
|
||||||
.prepare(&sql)?
|
.prepare(&sql)?
|
||||||
.query_and_then(NO_PARAMS, |r| Ok((r.get(0)?, r.get(1)?)))?
|
.query_and_then(NO_PARAMS, |r| Ok((r.get(0)?, r.get(1)?)))?
|
||||||
|
|
Loading…
Reference in a new issue