calculating number of orphans is (still) slow #1600

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

Following #1801 I can still see this kind of query on admin dashboard

SELECT
    id
  FROM images
    LEFT JOIN image_category ON id = image_id
  WHERE category_id is null
  ORDER BY id ASC
;
(this query time : 7.399 s)
(total SQL time  : 7.450 s)
(total time      : 7.524 s)
(num rows        : 10 )

7.399 seconds is huge. This gallery may have 500k photos, there must be a way to find the number of orphans faster.

Following #1801 I can still see this kind of query on admin dashboard ``` SELECT id FROM images LEFT JOIN image_category ON id = image_id WHERE category_id is null ORDER BY id ASC ; (this query time : 7.399 s) (total SQL time : 7.450 s) (total time : 7.524 s) (num rows : 10 ) ``` 7.399 seconds is huge. This gallery may have 500k photos, there must be a way to find the number of orphans faster. <!-- github-sync-id:1499923037 -->
adam closed this issue 2026-10-05 00:49:56 +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#1600