mirror of
https://github.com/ankitects/anki.git
synced 2025-11-08 21:57:12 -05:00
- approx 3x faster on a large test deck - counts are no longer capped to 1000 in the tree
39 lines
No EOL
596 B
SQL
39 lines
No EOL
596 B
SQL
select
|
|
did,
|
|
-- new
|
|
sum(queue = ?1),
|
|
-- reviews
|
|
sum(
|
|
queue = ?2
|
|
and due <= ?3
|
|
),
|
|
-- learning
|
|
sum(
|
|
(
|
|
case
|
|
-- v2 scheduler
|
|
?4
|
|
when 2 then (
|
|
queue = ?5
|
|
and due < ?6
|
|
)
|
|
or (
|
|
queue = ?7
|
|
and due <= ?3
|
|
)
|
|
else (
|
|
-- v1 scheduler
|
|
case
|
|
when queue = ?5
|
|
and due < ?6 then left / 1000
|
|
when queue = ?7
|
|
and due <= ?3 then 1
|
|
else 0
|
|
end
|
|
)
|
|
end
|
|
)
|
|
)
|
|
from cards
|
|
where
|
|
queue >= 0 |