The invention relates to a
database connection
sequence optimization method and device based on a
bloom filter. The method comprises the following steps: in response to multi-table connection query, constructing a weighted connection graph which takes data tables as nodes and connection conditions as edges, and calculating filtering potential weights of the edges based on cardinal numbers and selectivity of each table; generating a maximum
spanning tree, determining a root node, forming a directed filtering scheduling tree, and further generating a multi-stage
bloom filter scheduling plan; the execution engine constructs a
Bloom filter stage by stage from bottom to top according to the plan and detects and filters a downstream table connection key to realize global data
pruning; and finally, performing connection operation on the filtered
data set according to an original connection sequence. According to the method, through a pre-filtering mechanism independent of a connection sequence, the performance
cliff caused by a cardinal number
estimation error is eliminated, the scale of intermediate results is greatly reduced, memory overflow and sudden performance drop are avoided, the robustness and
resource efficiency of complex query are remarkably improved, and the execution stability is guaranteed.