simple-web-app

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit efeab221d48349d582a360a76abd8e7c5148c607
parent 4ca2f486141cbee0c2365202cb94c9a7e985900e
Author: Silas Brack <silasbrack@gmail.com>
Date:   Thu,  2 Oct 2025 12:40:08 +0200

fix: make category loading much faster

Diffstat:
Msrc/simple_web_app/queries/basic.sql | 9+++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/simple_web_app/queries/basic.sql b/src/simple_web_app/queries/basic.sql @@ -20,11 +20,8 @@ INNER JOIN category AS c WHERE nic.news_item_id = :news_item_id; -- name: get_categories(limit) -SELECT nic.category_id, c.name AS category -FROM news_item_category AS nic -INNER JOIN category AS c - ON c.id = nic.category_id -GROUP BY nic.category_id -ORDER BY COUNT(*) DESC +SELECT id, name AS category +FROM category +ORDER BY id LIMIT :limit;