The invention discloses a
database query acceleration optimization method and
system based on
artificial intelligence, and the method comprises the steps: capturing and recording a slow
query log in real time, collecting comprehensive
database performance indexes, and carrying out the data cleaning and
standardization; columns related to keywords in the slow
query statement are automatically identified, single-column to multi-column candidate index combinations are generated, and the leftmost prefix principle is followed when the multi-column candidate index combinations are generated; constructing a
feature vector containing statement features and statistical features; an XGBoost
algorithm is utilized to construct a dichotomy model, and model training is carried out; automatically detecting a new slow query, instantly generating a
feature vector of the candidate index, and predicting the potential of each candidate index for improving the query performance by utilizing a pre-trained model; verifying a prediction result of the model in a safe sampling
library environment; and when the sampling
library passes
verification, applying the recommended index to the production environment. According to the method and the
system, the efficiency problem of traditional
database index optimization is solved.