Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.6
Description
(Filing based on discussion with monty )
When analyzing the trace MDEV-30877, noted this:
The derived table has
"table_scan": {
|
"rows": 13304563,
|
"cost": 1.33e7
|
}
|
Compare to the non-derived table in the same query:
"table": "es",
|
"table_scan": {
|
"rows": 12840562,
|
"cost": 103969
|
}
|
The numbers of rows are similar but there's 128x difference in costs.
The number comes from here:
double JOIN_TAB::scan_time() |
{
|
if (table->is_created()) |
...
|
else |
{
|
found_records= records=table->stat_records();
|
read_time= found_records ? (double)found_records: 10.0;// TODO:fix this stub |
res= read_time;
|
}
|
Note the read_time= found_records assignment...