| The popularity of the Internet and the use of mobile banking have increased the volume of data for financial services,putting great pressure on the database of the financial system.Under the situation that DB2,which is commonly used by banks,is expensive and gradually overburdened,a bank developed Cbase distributed database independently and customized it according to financial business.Based on the bank’s specific needs,the main goal of Cbase development is to further improve its overall performance in terms of query speed,update speed,and transaction processing capability,so that it can easily bear the load even during special peak transaction periods.After analyzing the specific design of the SQL query engine part of Cbase database and comparing the design ideas and overall architecture of the current mainstream database,we found that Cbase is not well optimized for querying and it takes a long time to generate executable plans.Moreover,the internal structure of Cbase is complicated,and it is difficult to prevent SQL injection.The preprocessing function can make the same SQL compiled and used several times,thus reducing the number of times of compiling complex SQL,reducing the time overhead of generating executable plans,and improving the processing speed by reducing the time of SQL parsing by SQL engine to achieve the purpose of reducing response time.This makes up for the temporary lack of query optimization and improves the throughput of Cbase,and the pre-compiled parameterized queries also prevent injection attacks.In order to address Cbase’s need for performance improvement,optimization of the SQL engine as a problem,and prevention of SQL injection,it is necessary to develop preprocessing functionality using precompilation technology for the SQL engine and make preprocessing persistableBased on the in-depth analysis and research of SQL engine in Cbase,the following work has been done:(1)The performance optimization methods have been analyzed,and the interface requirements of the pre-compilation function have been analyzed and designed in detail.(2)According to the development specification of Cbase and the architecture design idea of SQL engine,the interface design,the overall process design and the storage and management mechanism design of the pre-compilation function according to the actual requirements,also analyzed the problem of pre-compilation persistability,designed the corresponding processing method,and designed the parameterized query for the anti-injection problem,and developed according to the design.(3)Finally,the hardware conditions for the operation of the Cbase system are elaborated,the system testing process is introduced using a combination of test cases and test ideas,and conclusions are analyzed and given based on the test results.The test results show that the use of the pre-compilation function not only reduces the impact of the defects of query optimization on the SQL engine,but also improves the processing speed of the SQL engine for all queries and updated SQL,and the pre-compilation function supports parameterized queries,which also provides help to prevent SQL injection and provides an additional layer of protection for the database. |