Database Index Creation Guide
This document describes the steps for adding the index on conversation manager DB to improve the reporting connector performance
Steps
SSH on the target server
To connect to your database, create a MongoDB® client container. Run following command
CODEkubectl run --namespace ef-external mongo-mongodb-client --rm --tty -i --restart='Never' --env="MONGODB_ROOT_PASSWORD=$MONGODB_ROOT_PASSWORD" --image docker.io/bitnami/mongodb:6.0.2-debian-11-r1 --command -- bash k exec -it mongo-mongodb-client -n ef-external -- bash mongosh admin --host "mongo-mongodb" use conversation-manager_db
Run
use conversation-manager_db
command and add the following indexes onconversations
collection.CODEdb.conversation.createIndex( { "endTime": 1 }) db.CustomerTopicEvents.createIndex( { "customer._id": 1 })
A add the following indexes on
CustomerTopicEvents
collection.CODEdb.CustomerTopicEvents.createIndex( { "cimEvent.name": 1 }) db.CustomerTopicEvents.createIndex( { "cimEvent.type": 1 }) db.CustomerTopicEvents.createIndex( { "customerId": 1 }) db.CustomerTopicEvents.createIndex( { "topicId": 1 }) db.CustomerTopicEvents.createIndex( "recordCreationTime":1}) db.CustomerTopicEvents.createIndex({ "cimEvent.data.channelSession.channel.channelConfig.routingPolicy.routingMode": 1 }) db.CustomerTopicEvents.createIndex("cimEvent.data.body.type: 1 }) db.CustomerTopicEvents.createIndex({"cimEvent.data.body.wrapups": 1 })
Run
use state-events-logger_cx_db
command and add indexes onagentStateChanheEvents
collection.CODEdb.agentStateChangeEvents.createIndex( { "name": 1 }) db.agentStateChangeEvents.createIndex({ "data.agentStateChanged": 1 }) db.agentStateChangeEvents.createIndex({ "data.agentPresence.stateChangeTime": 1 }) db.agentStateChangeEvents.createIndex({ "data.agentPresence.agentMrdStates": 1 }) db.agentStateChangeEvents.createIndex({ "stateChangeTime": 1 }) db.agentStateChangeEvents.createIndex({"data.agentPresence.state.name": 1 })