There are 2 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-f237f852-64f8-49c2-b3fb-67259cd971be XWIKI-16301 Open

Querying the list of xClasses is damn slow on a huge wiki

 
View issue   ·   Add comment
 

2 updates

 
cid:jira-generated-image-avatar-33cab795-bb60-48e1-bfe1-aceab46a0868 Changes by Raphaël Jakse on 23/Jan/26 11:44
 
Description: In order to query the list of all xClass, the XWiki#getClassList() method is always triggering this query on the database: [https://github.com/xwiki/xwiki-platform/blob/354a7ecf4f46935c2e564fc34c0372bd4341bd8c/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java#L2258]
{code:java}
select doc.fullName from XWikiDocument as doc where (doc.xWikiClassXML is not null and doc.xWikiClassXML like '<%') {code}
On a huge wiki, this query could be very slow, and it is triggered by the object editor for example. There is no caching and the query is far from being optimum:
{noformat}
+----+-------------+-------+------+---------------+------+---------+------+---------------+-------------+
| id | select_type | table | type | possible_keys | key  | key_len | ref  | rows          | Extra       |
+----+-------------+-------+------+---------------+------+---------+------+---------------+-------------+
|  1 | SIMPLE      | doc   | ALL  | NULL          | NULL | NULL    | NULL | could be huge | Using where |
+----+-------------+-------+------+---------------+------+---------+------+---------------+-------------+{noformat}
Labels: performance