Not the answer you need?
Register and ask your own question!
Many Forum changes were implemented on Tue 22 Sep. Read about new Ranks, Scoring, and Reactions.
Email [email protected] for any comments or concerns.

What does Handler_commit counter mean?

krteqkrteq ContributorInactive User Role Beginner
Does anyone know, what exactly is the Handler_commit item in SHOW SESSION STATUS and in which occasions is incremented?

I haven't found any details in mysql manual, it is mentioned very briefly:
<table border="0" align="center" width="90%" cellpadding="3" cellspacing="1"><tr><td class="SmallText">Quote:</td></tr><tr><td class="quote">
The number of internal COMMIT statements.
</td></tr></table>

For example, this statment increments the counter (innodb table):

SELECT COUNT(*) FROM `MyTable`;</pre>


Thank you, Vojtech

Comments

  • xaprbxaprb Mentor Inactive User Role Beginner
    That statement should not increment Handler_commit. If you examine what is REALLY happening I think you will probably find that whatever you're using to run that query is running a COMMIT right afterwards.
  • krteqkrteq Contributor Inactive User Role Beginner
    Baron, I'm using new connection:


    mysql> select version();+
    +| version() |+
    +| 5.1.42-percona-log |+
    +1 row in set (0.00 sec)mysql> use tempDatabase changedmysql> create table test_innodb (col int primary key) engine=innodb;Query OK, 0 rows affected (0.05 sec)mysql> flush status; select count(*) from test_innodb; show status like 'Handler_commit';Query OK, 0 rows affected (0.00 sec)+
    +| count(*) |+
    +| 0 |+
    +1 row in set (0.01 sec)+
    +
    +| Variable_name | Value |+
    +
    +| Handler_commit | 1 |+
    +
    +1 row in set (0.00 sec)</pre>
  • xaprbxaprb Mentor Inactive User Role Beginner
    I'm not seeing the same behavior on 5.0, so this might be something that changed in 5.1, or in the plugin version of InnoDB. It could have to do with changes in the storage engine API. I'm not sure what to think about this. It *ought* to be a no-op anyway, but I'd like to understand this more.
  • krteqkrteq Contributor Inactive User Role Beginner
    You are right, I see zero on 5.0.77-community.

    I'll stay tuned, thank you Baron )
  • xaprbxaprb Mentor Inactive User Role Beginner
    I'll put it into my TODO list, but don't hold your breath )
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.