Details
-
Task
-
Status: In Testing (View Workflow)
-
Major
-
Resolution: Unresolved
-
Q1/2026 Server Development, Q2/2026 Server Maintenance
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
- is duplicated by
-
MDEV-27189 Optimizer Trace: save all info needed for replay
-
- Closed
-
- relates to
-
MDEV-36511 Optimizer Trace replay step #2: dump basic statistics
-
- Closed
-
-
MDEV-36523 Optimizer Trace replay step #3: load basic statistics back
-
- Closed
-
-
MDEV-38781 Optimizer Trace Replay: Q1 2026 Dev Sprint Work 3
-
- Closed
-
-
MDEV-38923 context capture should work for stored procedures
-
- Open
-
-
MDEV-39042 Bypass exact count optimization when in context replay mode
-
- Open
-
- split from
-
MDEV-36523 Optimizer Trace replay step #3: load basic statistics back
-
- Closed
-