Anki/rslib/src/storage/revlog/studied_today_by_deck.sql
Jarrett Ye 93351bfb50 Feat/support load balance and easy days in rescheduling (#3815)
* Feat/support load balance and easy days in rescheduling

* ./ninja fix:minilints

* apply clippy

* reuse calculate_easy_days_modifiers()

* consider LoadBalancerEnabled

* move calculate_easy_days_modifiers out of struct

* improve naming & add comments

* apply clippy

* reschedule if easy days settings are changed

* Minor simplification

* refactor to share code between load balancer and rescheduler

* intervals_and_params -> intervals_and_weights

* find_best_interval -> select_weighted_interval

* cargo clippy

* add warning about easyDaysChanged

* compare arrays directly

* Don't show warning if fsrs+rescehdule is already enabled

---------

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
Co-authored-by: Jake Probst <jake.probst@gmail.com>
2025-02-18 13:44:00 +07:00

14 lines
No EOL
266 B
SQL

SELECT CASE
WHEN c.odid == 0 THEN c.did
ELSE c.odid
END AS original_did,
COUNT(DISTINCT r.cid) AS cnt
FROM revlog AS r
JOIN cards AS c ON r.cid = c.id
WHERE r.id > ?
AND r.ease > 0
AND (
r.type < 3
OR r.factor != 0
)
GROUP BY original_did