- Affected version
- 2.3.2
XF\Job\PostEmbedMetadata::getIdsToRebuild
does a select and in the where clause has "attach_count > 0"This causes what is effectively a full-table scan if there is statistically very few attachments. Worse, the batch-size will be reduced, except this makes the performance worse are it means more table-scans to get usable post-ids.
Instead of;
SQL:
SELECT post_id
FROM xf_post
WHERE post_id > 19209
AND attach_count > 0
ORDER BY post_id
LIMIT 293
Explain
Code:
+------+-------------+---------+-------+---------------+---------+---------+------+---------+-------------+
| id |...
- Xon
- Replies: 6
- Forum: Resolved bug reports
This workaround was implemented in 2.1.4 but now removed for 2.3.0.
While full table scans might be unavoidable for content embeds, quotes and images the workaround could still be used if only attachments are rebuild.