Slow database query #2059

Closed
opened 2026-10-05 01:05:04 +02:00 by adam · 1 comment
Owner

All queries when loading a picture every query is pretty fast. Run time is then 0.001 second, only the following is slow.
[10]

SELECT id
FROM piwigo_images i
INNER JOIN piwigo_image_category ic ON id=ic.image_id
INNER JOIN piwigo_image_tag it ON id=it.image_id
WHERE tag_id IN (321)
AND (category_id NOT IN (5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696,5697,5698,5699,5700,5701,5702,5703,5706,5707,5708,5709,5710,5711,5712,5713,5714,5715,5716,5717,5718,5719,5720,5721,5722,5723))
GROUP BY id
ORDER BY file ASC
(this query time : 8.530 s)
(total SQL time : 8.537 s)
(total time : 8.549 s)
(num rows : 107953 )

Why is it querieng almost all picture id's while i only open one picture?

All queries when loading a picture every query is pretty fast. Run time is then 0.001 second, only the following is slow. [10] SELECT id FROM piwigo_images i INNER JOIN piwigo_image_category ic ON id=ic.image_id INNER JOIN piwigo_image_tag it ON id=it.image_id WHERE tag_id IN (321) AND (category_id NOT IN (5679,5680,5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696,5697,5698,5699,5700,5701,5702,5703,5706,5707,5708,5709,5710,5711,5712,5713,5714,5715,5716,5717,5718,5719,5720,5721,5722,5723)) GROUP BY id ORDER BY file ASC (this query time : 8.530 s) (total SQL time : 8.537 s) (total time : 8.549 s) (num rows : 107953 ) Why is it querieng almost all picture id's while i only open one picture? <!-- github-sync-id:3098672896 -->
adam closed this issue 2026-10-05 01:05:04 +02:00
Author
Owner

It's fixed! It wasn't really a Piwigo or database engine. Instead (although the specs were great) iot was a hardware issue.

It's fixed! It wasn't really a Piwigo or database engine. Instead (although the specs were great) iot was a hardware issue. <!-- github-comment-id:3328493505 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#2059