Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
e5b67a46
Commit
e5b67a46
authored
Mar 23, 2017
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-12345 Performance : replace calls to clock() inside trx_start_low() by THD::start_utime
parent
09a2107b
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
65 additions
and
4 deletions
+65
-4
sql/sql_class.cc
sql/sql_class.cc
+9
-0
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+9
-0
storage/innobase/handler/ha_innodb.h
storage/innobase/handler/ha_innodb.h
+9
-0
storage/innobase/include/ha_prototypes.h
storage/innobase/include/ha_prototypes.h
+7
-0
storage/innobase/include/trx0trx.h
storage/innobase/include/trx0trx.h
+1
-1
storage/innobase/trx/trx0trx.cc
storage/innobase/trx/trx0trx.cc
+2
-1
storage/xtradb/handler/ha_innodb.cc
storage/xtradb/handler/ha_innodb.cc
+9
-0
storage/xtradb/handler/ha_innodb.h
storage/xtradb/handler/ha_innodb.h
+9
-0
storage/xtradb/include/ha_prototypes.h
storage/xtradb/include/ha_prototypes.h
+7
-0
storage/xtradb/include/trx0trx.h
storage/xtradb/include/trx0trx.h
+1
-1
storage/xtradb/trx/trx0trx.cc
storage/xtradb/trx/trx0trx.cc
+2
-1
No files found.
sql/sql_class.cc
View file @
e5b67a46
...
@@ -4534,6 +4534,15 @@ extern "C" int thd_rpl_is_parallel(const MYSQL_THD thd)
...
@@ -4534,6 +4534,15 @@ extern "C" int thd_rpl_is_parallel(const MYSQL_THD thd)
return
thd
->
rgi_slave
&&
thd
->
rgi_slave
->
is_parallel_exec
;
return
thd
->
rgi_slave
&&
thd
->
rgi_slave
->
is_parallel_exec
;
}
}
/* Returns high resolution timestamp for the start
of the current query. */
extern
"C"
unsigned
long
long
thd_start_utime
(
const
MYSQL_THD
thd
)
{
return
thd
->
start_utime
;
}
/*
/*
This function can optionally be called to check if thd_report_wait_for()
This function can optionally be called to check if thd_report_wait_for()
needs to be called for waits done by a given transaction.
needs to be called for waits done by a given transaction.
...
...
storage/innobase/handler/ha_innodb.cc
View file @
e5b67a46
...
@@ -1705,6 +1705,15 @@ thd_has_edited_nontrans_tables(
...
@@ -1705,6 +1705,15 @@ thd_has_edited_nontrans_tables(
return
((
ibool
)
thd_non_transactional_update
(
thd
));
return
((
ibool
)
thd_non_transactional_update
(
thd
));
}
}
/* Return high resolution timestamp for the start of the current query */
UNIV_INTERN
ib_uint64_t
thd_query_start_micro
(
const
THD
*
thd
)
/*!< in: thread handle */
{
return
thd_start_utime
(
thd
);
}
/******************************************************************//**
/******************************************************************//**
Returns true if the thread is executing a SELECT statement.
Returns true if the thread is executing a SELECT statement.
@return true if thd is executing SELECT */
@return true if thd is executing SELECT */
...
...
storage/innobase/handler/ha_innodb.h
View file @
e5b67a46
...
@@ -420,6 +420,15 @@ int thd_slave_thread(const MYSQL_THD thd);
...
@@ -420,6 +420,15 @@ int thd_slave_thread(const MYSQL_THD thd);
*/
*/
int
thd_non_transactional_update
(
const
MYSQL_THD
thd
);
int
thd_non_transactional_update
(
const
MYSQL_THD
thd
);
/**
Get high resolution timestamp for the current query start time.
The timestamp is not anchored to any specific point in time,
but can be used for comparison.
@retval timestamp in microseconds precision
*/
unsigned
long
long
thd_start_utime
(
const
MYSQL_THD
thd
);
/**
/**
Get the user thread's binary logging format
Get the user thread's binary logging format
@param thd user thread
@param thd user thread
...
...
storage/innobase/include/ha_prototypes.h
View file @
e5b67a46
...
@@ -150,6 +150,13 @@ thd_has_edited_nontrans_tables(
...
@@ -150,6 +150,13 @@ thd_has_edited_nontrans_tables(
/*===========================*/
/*===========================*/
THD
*
thd
);
/*!< in: thread handle */
THD
*
thd
);
/*!< in: thread handle */
/**
Get high resolution timestamp for the current query start time.
@retval timestamp in microseconds precision
*/
unsigned
long
long
thd_query_start_micro
(
const
MYSQL_THD
thd
);
/*************************************************************//**
/*************************************************************//**
Prints info of a THD object (== user session thread) to the given file. */
Prints info of a THD object (== user session thread) to the given file. */
UNIV_INTERN
UNIV_INTERN
...
...
storage/innobase/include/trx0trx.h
View file @
e5b67a46
...
@@ -849,7 +849,7 @@ struct trx_t{
...
@@ -849,7 +849,7 @@ struct trx_t{
time_t
start_time
;
/*!< time the trx state last time became
time_t
start_time
;
/*!< time the trx state last time became
TRX_STATE_ACTIVE */
TRX_STATE_ACTIVE */
clock_t
start_time_micro
;
/*!< start time of transaction in
ib_uint64_t
start_time_micro
;
/*!< start time of transaction in
microseconds */
microseconds */
trx_id_t
id
;
/*!< transaction id */
trx_id_t
id
;
/*!< transaction id */
XID
xid
;
/*!< X/Open XA transaction
XID
xid
;
/*!< X/Open XA transaction
...
...
storage/innobase/trx/trx0trx.cc
View file @
e5b67a46
...
@@ -923,7 +923,8 @@ trx_start_low(
...
@@ -923,7 +923,8 @@ trx_start_low(
trx
->
start_time
=
ut_time
();
trx
->
start_time
=
ut_time
();
trx
->
start_time_micro
=
clock
();
trx
->
start_time_micro
=
trx
->
mysql_thd
?
thd_query_start_micro
(
trx
->
mysql_thd
)
:
0
;
MONITOR_INC
(
MONITOR_TRX_ACTIVE
);
MONITOR_INC
(
MONITOR_TRX_ACTIVE
);
}
}
...
...
storage/xtradb/handler/ha_innodb.cc
View file @
e5b67a46
...
@@ -1981,6 +1981,15 @@ thd_has_edited_nontrans_tables(
...
@@ -1981,6 +1981,15 @@ thd_has_edited_nontrans_tables(
return
((
ibool
)
thd_non_transactional_update
(
thd
));
return
((
ibool
)
thd_non_transactional_update
(
thd
));
}
}
/* Return high resolution timestamp for the start of the current query */
UNIV_INTERN
ib_uint64_t
thd_query_start_micro
(
const
THD
*
thd
)
/*!< in: thread handle */
{
return
thd_start_utime
(
thd
);
}
/******************************************************************//**
/******************************************************************//**
Returns true if the thread is executing a SELECT statement.
Returns true if the thread is executing a SELECT statement.
@return true if thd is executing SELECT */
@return true if thd is executing SELECT */
...
...
storage/xtradb/handler/ha_innodb.h
View file @
e5b67a46
...
@@ -427,6 +427,15 @@ int thd_slave_thread(const MYSQL_THD thd);
...
@@ -427,6 +427,15 @@ int thd_slave_thread(const MYSQL_THD thd);
*/
*/
int
thd_non_transactional_update
(
const
MYSQL_THD
thd
);
int
thd_non_transactional_update
(
const
MYSQL_THD
thd
);
/**
Get high resolution timestamp for the current query start time.
The timestamp is not anchored to any specific point in time,
but can be used for comparison.
@retval timestamp in microseconds precision
*/
unsigned
long
long
thd_start_utime
(
const
MYSQL_THD
thd
);
/**
/**
Get the user thread's binary logging format
Get the user thread's binary logging format
@param thd user thread
@param thd user thread
...
...
storage/xtradb/include/ha_prototypes.h
View file @
e5b67a46
...
@@ -157,6 +157,13 @@ thd_has_edited_nontrans_tables(
...
@@ -157,6 +157,13 @@ thd_has_edited_nontrans_tables(
/*===========================*/
/*===========================*/
THD
*
thd
);
/*!< in: thread handle */
THD
*
thd
);
/*!< in: thread handle */
/**
Get high resolution timestamp for the current query start time.
@retval timestamp in microseconds precision
*/
unsigned
long
long
thd_query_start_micro
(
const
MYSQL_THD
thd
);
/*************************************************************//**
/*************************************************************//**
Prints info of a THD object (== user session thread) to the given file. */
Prints info of a THD object (== user session thread) to the given file. */
UNIV_INTERN
UNIV_INTERN
...
...
storage/xtradb/include/trx0trx.h
View file @
e5b67a46
...
@@ -882,7 +882,7 @@ struct trx_t{
...
@@ -882,7 +882,7 @@ struct trx_t{
time_t
start_time
;
/*!< time the trx state last time became
time_t
start_time
;
/*!< time the trx state last time became
TRX_STATE_ACTIVE */
TRX_STATE_ACTIVE */
clock_t
start_time_micro
;
/*!< start time of transaction in
ib_uint64_t
start_time_micro
;
/*!< start time of transaction in
microseconds */
microseconds */
trx_id_t
id
;
/*!< transaction id */
trx_id_t
id
;
/*!< transaction id */
XID
xid
;
/*!< X/Open XA transaction
XID
xid
;
/*!< X/Open XA transaction
...
...
storage/xtradb/trx/trx0trx.cc
View file @
e5b67a46
...
@@ -1121,7 +1121,8 @@ trx_start_low(
...
@@ -1121,7 +1121,8 @@ trx_start_low(
trx
->
start_time
=
ut_time
();
trx
->
start_time
=
ut_time
();
trx
->
start_time_micro
=
clock
();
trx
->
start_time_micro
=
trx
->
mysql_thd
?
thd_query_start_micro
(
trx
->
mysql_thd
)
:
0
;
MONITOR_INC
(
MONITOR_TRX_ACTIVE
);
MONITOR_INC
(
MONITOR_TRX_ACTIVE
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment