How openfire stores history messages

I can see two tables in openfire ofMucConversationLog and ofMessageArchive. So if we query for message history from which table history will be loaded?. And how chat history works for one to one and muc messages. I am trying to customize ofMucConversationLog table. So , wanted to know how history and text search works in the muc and one to one messaging.

Depending on configuration, both tables could be used for MUC messages. There are also Lucene indices added by the Monitoring plugin, that is used to perform keyword searches.

Be very careful when interacting with Openfire’s database tables directly: I do not consider those to be valid extension points of the Openfire API. Their structure might change without warning, and their content won’t always be up-to-date (eg: we batch database writes for performance).