The invention relates to a self-
adaptive management method and
system for a
database plan cache, and the method comprises the steps: firstly judging whether the plan cache is hit or not after a
database receives an
SQL statement, and triggering a hard analysis generation plan and caching the plan when the plan cache is not hit; if the cache is hit, further judging whether a corresponding multi-
execution plan exists or not; and when only a single
execution plan exists, analyzing the relationship between the number distribution of execution tuples and the number of execution times by adopting an execution efficiency
algorithm to dynamically judge whether the data is inclined. And when a plurality of execution plans exist, entering a multi-plan
cache management stage, selecting the execution plans according to a matching result of the current binding variable predicate selection rate and the cache plan historical selection rate, and generating and caching a new plan when the matching fails. According to the method, the data
skew is accurately identified by executing the efficiency
algorithm, intelligent matching and
multiplexing of plans are realized by means of a multi-plan
cache management mechanism, and the overall performance of the
database in a data
skew scene is improved.