Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
6.4-rc-1
-
None
-
Unknown
-
Description
In XWIKI-6685 we modified our HBM files to automatically create DB indexes. However, we still ask users to create some indexes that we though couldn't be created automatically (See http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Database+Administration)
Namely:
create index xwl_value on xwikilargestrings (xwl_value(50)); create index xwd_parent on xwikidoc (xwd_parent(50)); create index xwd_class_xml on xwikidoc (xwd_class_xml(20)); create index xws_number on xwikistatsdoc (XWS_NUMBER); create index xws_classname on xwikistatsdoc (XWS_CLASSNAME); create index xwr_number on xwikistatsreferer (XWR_NUMBER); create index xwr_classname on xwikistatsreferer (XWR_CLASSNAME); create index xwr_referer on xwikistatsreferer (XWR_REFERER(50)); create index xwv_user_agent on xwikistatsvisit (XWV_USER_AGENT(255)); create index xwv_cookie on xwikistatsvisit (XWV_COOKIE(255)); create index xwv_classname on xwikistatsvisit (XWV_CLASSNAME); create index xwv_number on xwikistatsvisit (XWV_NUMBER); create index ase_page_date on activitystream_events (ase_page, ase_date); create index xda_docid1 on xwikiattrecyclebin (xda_docid); create index ase_param1 on activitystream_events (ase_param1(200)); create index ase_param2 on activitystream_events (ase_param2(200)); create index ase_param3 on activitystream_events (ase_param3(200)); create index ase_param4 on activitystream_events (ase_param4(200)); create index ase_param5 on activitystream_events (ase_param5(200));
It seems there's a solution for that which is to use Auxiliary Database Objects in our HBM, see https://docs.jboss.org/hibernate/stable/core.old/reference/en/html/mapping-database-object.html See also https://steveswinsburg.wordpress.com/2009/06/16/adding-database-indexes-with-hibernate/ which demonstrates how to use it.
This will allow us to create all indexes automatically. We might want to scope them with the proper dialect so that the HBM won't fail on DBs having a different index syntax for example.
Attachments
Issue Links
- is related to
-
XWIKI-7125 Missing indexes in 3.2 index auto creation system
- Open
-
XWIKI-7126 Index cleanup in migration tool
- Open
-
XWIKI-7497 Auto-create indexes for the data gathered by the feed plugin
- Open
-
XWIKI-6685 Configure extra indexes in the hibernate mapping file for improved performance
- Closed
- relates to
-
XWIKI-18817 Missing database indexes for the query used by Solr indexing to get all documents
- Open