This topic describes the suggestions on weak consistency read in OceanBase Database for the best performance.
To avoid the impact on the leader replica, you can set weak consistency read for applications that are not time-sensitive such as batch processing or statistical analysis. You can set session-level system variables or specify hints for weak consistency reads to execute data reads on follower replicas.
Add a hint to the SELECT statement:
SELECT /*+read_consistency(weak)*/ * FROM test WHERE c1=1;Set the session-level system variable. Valid values:
1(indicates FROZEN),2(indicates WEAK), and3(indicates STRONG).SET @@ob_read_consistency= 2;