1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 10.11 into 11.0

This commit is contained in:
Sergei Petrunia
2023-04-14 17:40:41 +03:00
376 changed files with 13245 additions and 7395 deletions

View File

@@ -63,14 +63,19 @@ protected:
if (my_gap_tracker)
attach_gap_time_tracker(thd, my_gap_tracker, end);
}
/*
The time spent after stop_tracking() call on this object and any
subsequent time tracking call will be billed to this tracker.
*/
Gap_time_tracker *my_gap_tracker;
public:
Exec_time_tracker() : count(0), cycles(0), my_gap_tracker(NULL) {}
/*
The time spent between stop_tracking() call on this object and any
other time measurement will be billed to this tracker.
*/
Gap_time_tracker *my_gap_tracker;
void set_gap_tracker(Gap_time_tracker *gap_tracker)
{
my_gap_tracker= gap_tracker;
}
// interface for collecting time
void start_tracking(THD *thd)
@@ -160,6 +165,25 @@ public:
if (unlikely((tracker)->timed)) \
{ (tracker)->stop_tracking(thd); }
/*
Just a counter to increment one value. Wrapped in a class to be uniform
with other counters used by ANALYZE.
*/
class Counter_tracker
{
public:
Counter_tracker() : r_scans(0) {}
ha_rows r_scans;
inline void on_scan_init() { r_scans++; }
bool has_scans() const { return (r_scans != 0); }
ha_rows get_loops() const { return r_scans; }
};
/*
A class for collecting read statistics.
@@ -170,20 +194,16 @@ public:
It can be used to track reading from files, buffers, etc).
*/
class Table_access_tracker
class Table_access_tracker
{
public:
Table_access_tracker() :
r_scans(0), r_rows(0), /*r_rows_after_table_cond(0),*/
r_rows_after_where(0)
Table_access_tracker() : r_scans(0), r_rows(0), r_rows_after_where(0)
{}
ha_rows r_scans; /* How many scans were ran on this join_tab */
ha_rows r_scans; /* how many scans were ran on this join_tab */
ha_rows r_rows; /* How many rows we've got after that */
ha_rows r_rows_after_where; /* Rows after applying attached part of WHERE */
bool has_scans() const { return (r_scans != 0); }
ha_rows get_loops() const { return r_scans; }
double get_avg_rows() const
{
return r_scans
@@ -202,6 +222,9 @@ public:
inline void on_scan_init() { r_scans++; }
inline void on_record_read() { r_rows++; }
inline void on_record_after_where() { r_rows_after_where++; }
bool has_scans() const { return (r_scans != 0); }
ha_rows get_loops() const { return r_scans; }
};