calculating number of orphans is slow #1575

Closed
opened 2026-10-05 00:48:47 +02:00 by adam · 0 comments
Owner

With more hundreds of thousands photos, calculating the number of orphan photos, performed on each admin page, is slow:

SELECT
    id
  FROM images
    LEFT JOIN image_category ON id = image_id
  WHERE category_id is null
  ORDER BY id ASC
;
(this query time : 1.862 s)

We may not need to calculate this on each page, every second...

With more hundreds of thousands photos, calculating the number of orphan photos, performed on each admin page, is slow: ``` SELECT id FROM images LEFT JOIN image_category ON id = image_id WHERE category_id is null ORDER BY id ASC ; (this query time : 1.862 s) ``` We may not need to calculate this on each page, every second... <!-- github-sync-id:1459556238 -->
adam closed this issue 2026-10-05 00:48:47 +02:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1575