MySQL 9.0.0
Source Code Documentation
|
Implement query profiling as as list of metaphorical fences, with one fence per query, and each fencepost a change of thd->proc_info state (with a snapshot of system statistics). More...
#include "sql/sql_profile.h"
#include "my_config.h"
#include <string.h>
#include <algorithm>
#include "decimal.h"
#include "m_string.h"
#include "my_base.h"
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_sqlcommand.h"
#include "my_sys.h"
#include "my_systime.h"
#include "mysql/strings/m_ctype.h"
#include "nulls.h"
#include "sql-common/my_decimal.h"
#include "sql/field.h"
#include "sql/item.h"
#include "sql/protocol.h"
#include "sql/psi_memory_key.h"
#include "sql/query_options.h"
#include "sql/sql_class.h"
#include "sql/sql_error.h"
#include "sql/sql_lex.h"
#include "sql/sql_list.h"
#include "sql/sql_show.h"
#include "sql/system_variables.h"
#include "sql_string.h"
Macros | |
#define | TIME_FLOAT_DIGITS 9 |
#define | TIME_I_S_DECIMAL_SIZE (TIME_FLOAT_DIGITS * 100) + (TIME_FLOAT_DIGITS - 3) |
two vals encoded: (dec*100)+len More... | |
#define | MAX_QUERY_HISTORY 101U |
#define | RUSAGE_USEC(tv) ((tv).tv_sec * 1000 * 1000 + (tv).tv_usec) |
#define | RUSAGE_DIFF_USEC(tv1, tv2) (RUSAGE_USEC((tv1)) - RUSAGE_USEC((tv2))) |
Functions | |
int | fill_query_profile_statistics_info (THD *thd, Table_ref *tables, Item *) |
Connects Information_Schema and Profiling. More... | |
int | make_profile_table_for_show (THD *thd, ST_SCHEMA_TABLE *schema_table) |
Variables | |
static const size_t | MAX_QUERY_LENGTH = 300 |
ST_FIELD_INFO | query_profile_statistics_info [] |
Implement query profiling as as list of metaphorical fences, with one fence per query, and each fencepost a change of thd->proc_info state (with a snapshot of system statistics).
When asked, we can then iterate over the fenceposts and calculate the distance between them, to inform the user what happened during a particular query or thd->proc_info state.
User variables that inform profiling behavior:
#define MAX_QUERY_HISTORY 101U |
#define RUSAGE_DIFF_USEC | ( | tv1, | |
tv2 | |||
) | (RUSAGE_USEC((tv1)) - RUSAGE_USEC((tv2))) |
#define RUSAGE_USEC | ( | tv | ) | ((tv).tv_sec * 1000 * 1000 + (tv).tv_usec) |
#define TIME_FLOAT_DIGITS 9 |
#define TIME_I_S_DECIMAL_SIZE (TIME_FLOAT_DIGITS * 100) + (TIME_FLOAT_DIGITS - 3) |
two vals encoded: (dec*100)+len
Connects Information_Schema and Profiling.
int make_profile_table_for_show | ( | THD * | thd, |
ST_SCHEMA_TABLE * | schema_table | ||
) |
|
static |
ST_FIELD_INFO query_profile_statistics_info[] |