slow website
I have downgraded to echo() profiling because non of the more advanced profilers really work on my LTS ubuntu (php 7.0 :s).
It seems that 11 seconds (99% of the request time) are spent in $tagsDao->getWithUnread();
Possibly the SQL does not get optimized. This is the query in question that takes almost the complete 11 seconds of the request:
SELECT tag, color, COUNT(items.id) AS unread
FROM tags AS tags,
sources AS sources
LEFT OUTER JOIN items AS items
ON (items.source=sources.id AND items.unread=1)
WHERE CONCAT(',', sources.tags, ',') LIKE CONCAT('%,', tags.tag, ',%') COLLATE utf8mb4_general_ci
GROUP BY tags.tag, tags.color
ORDER BY LOWER(tags.tag);
I'm wondering why selfoss uses this "WHERE ... CONCAT() LIKE CONCAT()" construction to join the tags to the sources rather than a tags-sources association table. The latter is a common structure in relational databases and probably gets optimized much better by the database system.
Complete thread:
- slow website -
themba,
2019-02-11, 23:14
- slow website -
jtojnar,
2019-02-12, 02:09
- slow website -
themba,
2019-02-12, 09:16
- slow website -
themba,
2019-02-16, 17:31
- slow website -
jtojnar,
2019-02-17, 11:13
- slow website -
themba,
2019-02-17, 11:45
- slow website -
jtojnar,
2019-02-17, 19:21
- slow website - niol, 2019-02-18, 09:59
- slow website -
jtojnar,
2019-02-17, 19:21
- slow website -
themba,
2019-02-17, 11:45
- slow website -
jtojnar,
2019-02-17, 11:13
- slow website -
themba,
2019-02-16, 17:31
- slow website -
themba,
2019-02-12, 09:16
- slow website -
jtojnar,
2019-02-12, 02:09