Application practice of high-speed caching technology for INFORMIX database SQL statements

Source: Internet
Author: User
Tags data structures informix

As we know, the Informix database optimizer is based on "cost" optimization, and when a user-issued SQL statement is received, the Informix Optimizer compiles the SQL statement to generate the final execution plan based on the lowest cost principle. For each SQL statement, the compilation is done, in order to improve the performance of the system, especially for systems with a large number of identical SQL statements, Informix starts with the 9.2 version, providing SQL statement caching mechanism SQL Statement cache (SSC), Cache parsed and optimized SQL statements into memory so that multiple users executing the same SQL statement can achieve the following performance improvements:

The response time is shortened because of bypassing the analysis and optimization steps

The amount of memory consumed is reduced because the database server shares query data structures among users

By using the SQL statement caching mechanism, the performance of a large number of identical SQL statement systems can be greatly improved.

The following figure shows how the database server accesses SQL statement caching for multiple users.

Figure 1. Database server operations when using SQL statement caching

When the database server executes the SQL statement for User 1 for the first time, the database server checks whether the exact same SQL statement is in the SQL statement cache. If it is not in the cache, then the database server analyzes the statement, determines the optimal query plan, and executes the statement.

When user 2 executes the exact same SQL statement, the database server looks for the statement in the SQL statement cache without parsing and optimizing the statement.

Similarly, if user 3 and User 4 execute exactly the same SQL statement, the database server does not have to parse and optimize the statement. Instead, it uses the parsing information and the query plan in an in-memory SQL statement cache.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.