1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Improved speed of optimizer trace

- Added unlikely() to optimize for not having optimizer trace enabled
- Made THD::trace_started() inline
- Added 'if (trace_enabled())' around some potentially expensive code
  (not many found)
- Added ASSERT's to ensure we don't call expensive optimizer trace calls
  if optimizer trace is not enabled
- Added length to Json_writer functions to speed up buffer writes
  when optimizer trace is enabled.
- Changed LEX_CSTRING argument handling to not send full struct to writer
  function on_add_str() functions now trusts length arguments
This commit is contained in:
Monty
2020-03-06 10:33:11 +02:00
parent 1ad8693a6f
commit 940fcbe73b
9 changed files with 176 additions and 102 deletions

View File

@ -3274,7 +3274,10 @@ public:
void reset_for_reuse();
bool store_globals();
void reset_globals();
bool trace_started();
bool trace_started()
{
return opt_trace.is_started();
}
#ifdef SIGNAL_WITH_VIO_CLOSE
inline void set_active_vio(Vio* vio)
{
@ -5003,6 +5006,7 @@ public:
Item *sp_fix_func_item(Item **it_addr);
Item *sp_prepare_func_item(Item **it_addr, uint cols= 1);
bool sp_eval_expr(Field *result_field, Item **expr_item_ptr);
};
/** A short cut for thd->get_stmt_da()->set_ok_status(). */