{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/mysql-5.6/issues/200","repository_url":"https://api.github.com/repos/facebook/mysql-5.6","labels_url":"https://api.github.com/repos/facebook/mysql-5.6/issues/200/labels{/name}","comments_url":"https://api.github.com/repos/facebook/mysql-5.6/issues/200/comments","events_url":"https://api.github.com/repos/facebook/mysql-5.6/issues/200/events","html_url":"https://github.com/facebook/mysql-5.6/issues/200","id":141138749,"number":200,"title":"Make ha_rocksdb::convert_record_from_storage_format and RDBSE_KEYDEF::unpack_record more efficient","user":{"login":"yoshinorim","id":253614,"avatar_url":"https://avatars.githubusercontent.com/u/253614?v=3","gravatar_id":"","url":"https://api.github.com/users/yoshinorim","html_url":"https://github.com/yoshinorim","followers_url":"https://api.github.com/users/yoshinorim/followers","following_url":"https://api.github.com/users/yoshinorim/following{/other_user}","gists_url":"https://api.github.com/users/yoshinorim/gists{/gist_id}","starred_url":"https://api.github.com/users/yoshinorim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoshinorim/subscriptions","organizations_url":"https://api.github.com/users/yoshinorim/orgs","repos_url":"https://api.github.com/users/yoshinorim/repos","events_url":"https://api.github.com/users/yoshinorim/events{/privacy}","received_events_url":"https://api.github.com/users/yoshinorim/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/mysql-5.6/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/facebook/mysql-5.6/labels/high-pri","name":"high-pri","color":"5319e7"},{"url":"https://api.github.com/repos/facebook/mysql-5.6/labels/myrocks","name":"myrocks","color":"fef2c0"}],"state":"open","locked":false,"assignee":{"login":"spetrunia","id":2734550,"avatar_url":"https://avatars.githubusercontent.com/u/2734550?v=3","gravatar_id":"","url":"https://api.github.com/users/spetrunia","html_url":"https://github.com/spetrunia","followers_url":"https://api.github.com/users/spetrunia/followers","following_url":"https://api.github.com/users/spetrunia/following{/other_user}","gists_url":"https://api.github.com/users/spetrunia/gists{/gist_id}","starred_url":"https://api.github.com/users/spetrunia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spetrunia/subscriptions","organizations_url":"https://api.github.com/users/spetrunia/orgs","repos_url":"https://api.github.com/users/spetrunia/repos","events_url":"https://api.github.com/users/spetrunia/events{/privacy}","received_events_url":"https://api.github.com/users/spetrunia/received_events","type":"User","site_admin":false},"milestone":null,"comments":13,"created_at":"2016-03-16T00:47:22Z","updated_at":"2016-03-30T20:16:55Z","closed_at":null,"body":"How to repeat:\r\n```\r\ncreate table t1 (id1 bigint, id2 bigint, c1 bigint, c2 bigint, c3 bigint, c4 bigint, c5 bigint, c6 bigint, c7 bigint, primary key (id1, id2), index i(c1, c2));\r\n\r\nload data local infile '/data/mysql/10m.dat' into table t1 fields terminated by ',';\r\n\r\nset global rocksdb_perf_context_level=0;\r\n(disconnect and reconnect)\r\nselect count(*) from t1 force index(primary);\r\n```\r\nIn MyRocks, the select took 6.71 sec. InnoDB took 3.30 sec.\r\n\r\n10m.dat can be created as follows. You can reduce the number of lines, depending on your machine spec.\r\n```\r\n#!/usr/bin/perl\r\n\r\nfor (my $i = 1; $i <= 10000000; $i++) {\r\n  print \"$i,0,$i,0,0,0,0,0,0\\n\";\r\n}\r\n```\r\n\r\nHere are Perf outputs in MyRocks.\r\n```\r\n-   14.03%  my-oneconnectio  mysqld               [.] myrocks::ha_rocksdb::convert_record_from_storage_format          a\r\n   - myrocks::ha_rocksdb::convert_record_from_storage_format                                                           `\r\n      + myrocks::ha_rocksdb::rnd_next_with_direction                                                                   a\r\n-    8.37%  my-oneconnectio  libc-2.20.so         [.] __memcpy_sse2_unaligned                                          a\r\n   - __memcpy_sse2_unaligned                                                                                           a\r\n      + 52.32% myrocks::ha_rocksdb::rnd_next_with_direction                                                            a\r\n      + 30.75% myrocks::ha_rocksdb::convert_record_from_storage_format                                                 a\r\n      + 13.34% rocksdb::(anonymous namespace)::TwoLevelIterator::Next                                                  a\r\n      + 3.58% rocksdb::DBIter::Next                                                                                    a\r\n-    4.72%  my-oneconnectio  mysqld               [.] myrocks::RDBSE_KEYDEF::unpack_record                             a\r\n   - myrocks::RDBSE_KEYDEF::unpack_record                                                                              a\r\n      + 84.41% myrocks::ha_rocksdb::convert_record_from_storage_format                                                 a\r\n      + 7.71% myrocks::ha_rocksdb::rnd_next_with_direction                                                             a\r\n-    4.39%  my-oneconnectio  mysqld               [.] Field::set_notnull                                               a\r\n   - Field::set_notnull                                                                                                a\r\n      + 55.38% myrocks::ha_rocksdb::convert_record_from_storage_format                                                 a\r\n      + 44.62% myrocks::ha_rocksdb::rnd_next_with_direction                                                            a\r\n+    4.26%  my-oneconnectio  mysqld               [.] rocksdb::StatisticsImpl::recordTick                              a\r\n-    3.70%  my-oneconnectio  mysqld               [.] Field::move_field_offset                                         a\r\n   - Field::move_field_offset                                                                                          a\r\n      + 75.54% myrocks::ha_rocksdb::rnd_next_with_direction                                                            a\r\n      + 24.46% myrocks::ha_rocksdb::convert_record_from_storage_format  \r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/mysql-5.6/issues/comments/203614113","html_url":"https://github.com/facebook/mysql-5.6/issues/200#issuecomment-203614113","issue_url":"https://api.github.com/repos/facebook/mysql-5.6/issues/200","id":203614113,"user":{"login":"spetrunia","id":2734550,"avatar_url":"https://avatars.githubusercontent.com/u/2734550?v=3","gravatar_id":"","url":"https://api.github.com/users/spetrunia","html_url":"https://github.com/spetrunia","followers_url":"https://api.github.com/users/spetrunia/followers","following_url":"https://api.github.com/users/spetrunia/following{/other_user}","gists_url":"https://api.github.com/users/spetrunia/gists{/gist_id}","starred_url":"https://api.github.com/users/spetrunia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spetrunia/subscriptions","organizations_url":"https://api.github.com/users/spetrunia/orgs","repos_url":"https://api.github.com/users/spetrunia/repos","events_url":"https://api.github.com/users/spetrunia/events{/privacy}","received_events_url":"https://api.github.com/users/spetrunia/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T20:16:55Z","updated_at":"2016-03-30T20:16:55Z","body":"@yoshinorim the tests were run with ``rocksdb_perf_context_level=0``. This is the default that I get. \r\n\r\nI am running one the latest where the patch you've posted earlier here \r\nhttps://github.com/facebook/mysql-5.6/issues/200#issuecomment-197536034 is not applicable because the counter increments were already changed to BumpGlobalStats."}}