Skip to content
This repository was archived by the owner on Mar 1, 2026. It is now read-only.
This repository was archived by the owner on Mar 1, 2026. It is now read-only.

CPU overhead from JOIN::join_free is about 2X larger with MyRocks than with InnoDB #1485

Description

@mdcallag

I am looking at flamegraphs from sysbench with a cached database and 1 client. A common problem I see is that the percentage of samples that JOIN::join_free and its callees accounts for is ~2X larger in MyRocks than in InnoDB with simple microbenchmarks.

From the range-covered-pk.range100 microbenchmark (covered range query of PK index) the percentage of samples is 0.90% for InnoDB and 2.18% for MyRocks

JOIN::join_free from InnoDB:

0.90%  JOIN::join_free
  0.72%  mysql_unlock_read_tables
    0.70%  unlock_external
      0.68%  handler::ha_external_lock
        0.62% ha_innobase::external_lock
          0.50% innobase_commit

And from MyRocks

2.18%  JOIN::join_free
  1.22%  JOIN::cleanup
    1.15%  cleanup_table
      1.09%  ha_rocksdb::index_end
        ... destructors - some MyRocks and many more RocksDB class instances
  0.88%  mysql_unlock_read_tables
    0.85%  unlock_external
      0.81%  handler::ha_external_lock
        0.75%  ha_rocksdb::external_lock
          0.70%  Rdb_transaction::commit
            0.66%  Rdb_transaction_impl::rollback
               ...

Flamegraphs
sb perf g range-covered-pk range100 pk1 all

sb perf g range-covered-pk range100 pk1 all

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions