The invention discloses an
SQL execution efficiency optimization method in a
data warehouse, and relates to the technical field of
database management and
data processing. Comprising the following steps: based on a
database protocol, according to rule configuration, identifying a
data source, carrying out
data source adaptation, sequentially carrying out
SQL grammar analysis,
SQL routing identification and SQL
rewriting, forming an
execution plan, caching the
execution plan for repeated execution and calling, mapping data to a plurality of data storage partitions during write operation, and avoiding data inclination during write; during reading operation, a data scanning
algorithm is utilized to automatically adapt to a
data source, fragment query is rewritten, and empty scanning is reduced; submitting the
execution plan to an SQL (Structured
Query Language) execution engine, performing standard grammar execution and complex grammar analysis by the execution engine, generating a secondary execution plan, and if write operation is performed, performing partition storage of hot data and regularly performing cold data archiving by the execution plan; if the read operation is carried out, partition
pruning optimization is carried out, and data merging and assembling are carried out through an SQL execution engine: returned data is merged, and if the read operation is carried out, an execution plan is dynamically analyzed, memory distribution of index data is adjusted, and high-
frequency data is cached; and if the operation is the write operation, compressing and storing the data, and adjusting the index.