Hi Sergei, On Tue, Mar 04, 2014 at 01:10:19PM +0100, Sergei Golubchik wrote:
Hi, Sergey!
On Feb 14, Sergey Vojtovich wrote:
At lp:maria/10.0
------------------------------------------------------------ revno: 4006 revision-id: svoj@mariadb.org-20140214122541-tenvcllk760deai8 parent: svoj@mariadb.org-20140213071355-psk0jpsarx2u7myc committer: Sergey Vojtovich <svoj@mariadb.org> branch nick: 10.0 timestamp: Fri 2014-02-14 16:25:41 +0400 message: MDEV-5674 - Performance: my_hash_sort_bin is called too often
- reduced number of my_hash_sort_bin() calls from 4 to 2 per query. Let MDL subsystem use pre-calculated hash value for hash inserts and deletes.
Is this necessary? One of the reasons why I didn't review this your first patch, because I believed that the second one obsoletes it.
Why do you need my_hash_insert_using_hash_value() when you achieve the same effect with your calc_hash callback in the second patch Currently yes, because in one case key is char string (no MDL_key is available) and in another case MDL_key is available by offset juggling. But I think I can avoid it. I'll try and get back to you with updated patch.
- reduced number of memory accesses done by my_hash_sort_bin()
I'd expect the compiler to handle it automatically, but feel free to change it, if it doesn't. It was tested and unfortunately compiler didn't handle it.
Thanks, Sergey