As big data technology has developed, so have complex applications that require increasing resources. The need for high-performance reading and writing increases the usage of NoSQL (MongoDB) databases. As the number of queries in a given amount of time negatively affects the performance of the database, an automated index selection strategy should be used to improve the database performance. This study proposes an Optimized Deep Deterministic Policy Gradient (ODDPG) to select the optimal index. The Adaptive Crocodile Optimization Algorithm (ACOA) is used to improve DDPG's decision-making performance. The ACOA algorithm is used to receive the best action sequences of a DQN. Simulation results showed that the proposed method achieved better results than the existing DDPG model by 2.3% in Average Time Of Query (ATQ) executed, 10% in Query Per Hour (QPH), and 11% in throughput.