Details
-
Task
-
Status: In Progress (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
Q1/2026 Server Development
Description
Hook records_in_range call
in opt_range.cc in ror_intersect_add() -> ror_scan_selectivity()
, there is a handler->records_in_range() call.
We need to hook it: save and return back its value.
Note that ha_something::multi_range_read_info_const() as well as handler::multi_range_read_info_const() also make calls to handler->records_in_range() and we do NOT need to intercept them.
Example query that uses index_merge/intersection and depends on records_in_range() value:
INDEX i1(a, b) |
INDEX i2(a, c)Â |
select * from t1 where a=1 and b=1 and c=1; |
or try INDEX(c,a), INDEX(b, a).
Constant tables
We need to save the rows we've read from constant tables.
For the moment, let's take the path of least effort:
We write {{CREATE TABLE ... }} statements into captured context.
For constant tables, also write {{INSERT INTO tbl VALUES(...) }} statement.
That way, we won't need any special replay code.
Use this function for dumping table rows:
String dbug_format_row(TABLE *table, const uchar *rec, bool print_names)
|
Just make it do quoting.
Attachments
Issue Links
- split from
-
MDEV-36523 Optimizer Trace replay step #3: load basic statistics back
-
- In Progress
-