Obtaining Routes Using HINT to Execute SQL Statements on Segments
Obtain the route based on the SQL statement to calculate the target shard, and then execute the SQL statement on the target shard.
Command format:
/*+sql= <SQL statement for obtaining route information> */ <your query>;
Example:
/*+sql = select * from users where user_id=20*/ select count(*) from orders2_1;
Constraints:
- The SQL statement for obtaining routes supports only the SELECT statement that can be directly pushed down.
- The hint is valid only for SELECT, DML, and TRUNCATE statements.
- The hint works only under the text protocol, rather than the Prepare protocol.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot