diff --git a/backend-lehrer/vocabulary/api.py b/backend-lehrer/vocabulary/api.py index d09763f..1b670a5 100644 --- a/backend-lehrer/vocabulary/api.py +++ b/backend-lehrer/vocabulary/api.py @@ -146,24 +146,13 @@ async def api_get_filters(): tags = await get_all_tags() pos_list = await get_all_pos() total = await count_words() - # Kaikki stats - kaikki_total = 0 - kaikki_langs = 0 - try: - from vocabulary.db import get_pool - pool = await get_pool() - async with pool.acquire() as conn: - kaikki_total = await conn.fetchval("SELECT COUNT(*) FROM vocabulary_kaikki") - kaikki_langs = await conn.fetchval("SELECT COUNT(DISTINCT lang) FROM vocabulary_kaikki") - except Exception: - pass - + # Kaikki stats (hardcoded to avoid slow COUNT on 6M rows) return { "tags": tags, "parts_of_speech": pos_list, "total_words": total, - "kaikki_total": kaikki_total, - "kaikki_languages": kaikki_langs, + "kaikki_total": 6271749, + "kaikki_languages": 24, }