WL#2653: Federated - Getting federated records_in_range and read_range_first completed
Affects: Server-7.1 — Status: Assigned — Priority: Medium
Implement records_in_range and read_range_first. These methods are required for the handler not to depend upon using full table scans (in the case of Federated, select * from...) to implement ranges, but instead create intelligent SQL to be run on the foreign server for the particular records that should be returned from an SQL query specifying a range. Also, records_in_range will supply useful information that the handler uses, of how many records a particular query will return (for the optimiser).
records_in_range will compose the query that will be run in the range operation (create the SQL statement like 'SELECT col1,col2,colN from foo where col1 > 2 and col1 < 8', and call that query with EXPLAIN, which then gives how many records will be returned in the results of that explain, set records to that value, which the handler will then use that value. read_range_first will compose the query that will be run in the range operation, just as described for records_in_range, and use that query to obtain the desired records. Additionally, create_where_from_key, which is called by both records_in_range and read_range_first, will have to be enhanced to be intelligent to enough to be able to set the correct operator based on the range flag supplied from records_in_range or read_range_first which called it (two times - once for the minimum range, and once for the maximum range). Also, since index_read_idx uses create_where_from_key, but only once (since there is no range), logic has to be there to deal with the differences in what each calling method expects as a return WHERE clause.
Copyright (c) 2000, 2018, Oracle Corporation and/or its affiliates. All rights reserved.