tencent cloud

All product documents
TDSQL-C for MySQL
Correlated Subquery Result Cache
Last updated: 2024-10-09 10:39:26
Correlated Subquery Result Cache
Last updated: 2024-10-09 10:39:26

Feature Overview

Each time when a correlated subquery is executed, it is necessary to recalculate results of the subquery. This may lead to lower performance. TXSQL currently supports the correlated subquery result cache (subquery cache) feature, which enables caching of subquery results to avoid repetitive calculation and improve the query performance.

Supported Versions

The kernel version should be 3.1.15 or later for TXSQL 8.0.

Applicable Scenarios

It is applicable to scenarios where many correlated subqueries are executed and the query performance needs improvement.

Use Instructions

Parameter Name
Dynamic
Type
Default Value
Valid Values/Value Range
Description
txsql_subquery_cache_enabled
yes
Boolean
OFF
ON/OFF
Controls whether to enable the subquery cache feature.
txsql_subquery_cache_cost_threshold
yes
Integer
4000
0-DBL_MAX
Execution cost threshold for the subquery cache feature. The subquery cache feature is used only for correlated subqueries with an estimated execution cost higher than this threshold.

New Status Parameters

New status parameters are used to describe the hit status of the subquery cache, including Txsql_subquery_cache_hit and Txsql_subquery_cache_miss.
You can observe the partial result cache plan using explain format=tree.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon