]> git.pld-linux.org Git - packages/mysql.git/blobdiff - innodb_adaptive_hash_index_partitions.patch
- more mysqld.conf changes: skip-locking, default-character-set
[packages/mysql.git] / innodb_adaptive_hash_index_partitions.patch
index a171106328927a572d375ecbac08cc885796f921..943435316587a091a97c8a4c94dd44ad6dd441c2 100644 (file)
@@ -110,7 +110,7 @@ diff -ruN a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c
        }
  }
  
-@@ -2059,7 +2059,7 @@
+@@ -2060,7 +2060,7 @@
                        btr_search_update_hash_on_delete(cursor);
                }
  
@@ -119,7 +119,7 @@ diff -ruN a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c
        }
  
        if (!(flags & BTR_KEEP_SYS_FLAG)) {
-@@ -2073,7 +2073,7 @@
+@@ -2074,7 +2074,7 @@
        row_upd_rec_in_place(rec, index, offsets, update, page_zip);
  
        if (block->is_hashed) {
@@ -128,8 +128,8 @@ diff -ruN a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c
        }
  
        if (page_zip && !dict_index_is_clust(index)
-@@ -2857,7 +2857,7 @@
-       block = btr_cur_get_block(cursor);
+@@ -2852,7 +2852,7 @@
+       }
  
        if (block->is_hashed) {
 -              rw_lock_x_lock(&btr_search_latch);
@@ -137,7 +137,7 @@ diff -ruN a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c
        }
  
        page_zip = buf_block_get_page_zip(block);
-@@ -2872,7 +2872,7 @@
+@@ -2867,7 +2867,7 @@
        }
  
        if (block->is_hashed) {
@@ -146,7 +146,7 @@ diff -ruN a/storage/innobase/btr/btr0cur.c b/storage/innobase/btr/btr0cur.c
        }
  
        btr_cur_del_mark_set_clust_rec_log(flags, rec, index, val, trx,
-@@ -3003,13 +3003,13 @@
+@@ -2994,13 +2994,13 @@
              == dict_table_is_comp(cursor->index->table));
  
        if (block->is_hashed) {
@@ -606,37 +606,82 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
  #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
  
        mem_free(folds);
-@@ -1215,10 +1281,10 @@
-       mem_heap_t*     heap    = NULL;
+@@ -1216,9 +1282,9 @@
        ulint*          offsets;
+       ibool           released_search_latch;
  
--      rw_lock_x_lock(&btr_search_latch);
-+      rw_lock_x_lock(btr_search_get_latch(index->id));
-       //buf_pool_mutex_enter_all();
+-      rw_lock_s_lock(&btr_search_latch);
++      rw_lock_s_lock(btr_search_get_latch(index->id));
  
 -      table = btr_search_sys->hash_index;
 +      table = btr_search_get_hash_index(index->id);
  
        for (j = 0; j < srv_buf_pool_instances; j++) {
                buf_pool_t*     buf_pool;
-@@ -1291,6 +1357,7 @@
+@@ -1252,7 +1318,7 @@
  
-                               block->is_hashed = FALSE;
-                               block->index = NULL;
-+                              block->btr_search_latch = NULL;
-       
+                                       /* keeping latch order */
+-                                      rw_lock_s_unlock(&btr_search_latch);
++                                      rw_lock_s_unlock(btr_search_get_latch(index->id));
+                                       released_search_latch = TRUE;
+                                       rw_lock_x_lock(&block->lock);
+@@ -1304,7 +1370,7 @@
+                                               mem_heap_empty(heap);
+                                       }
+-                                      rw_lock_x_lock(&btr_search_latch);
++                                      rw_lock_x_lock(btr_search_get_latch(index->id));
+                                       if (UNIV_UNLIKELY(!block->is_hashed)) {
+                                               goto cleanup;
+@@ -1314,12 +1380,12 @@
+                                       if (UNIV_UNLIKELY(block->curr_n_fields != n_fields)
+                                           || UNIV_UNLIKELY(block->curr_n_bytes != n_bytes)) {
+-                                              rw_lock_x_unlock(&btr_search_latch);
++                                              rw_lock_x_unlock(btr_search_get_latch(index->id));
+                                               rw_lock_x_unlock(&block->lock);
+                                               mem_free(folds);
+-                                              rw_lock_s_lock(&btr_search_latch);
++                                              rw_lock_s_lock(btr_search_get_latch(index->id));
+                                               goto retry;
+                                       }
+@@ -1333,6 +1399,7 @@
+                                       block->is_hashed = FALSE;
+                                       block->index = NULL;
++                                      block->btr_search_latch = NULL;
+ cleanup:
  #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
-                               if (UNIV_UNLIKELY(block->n_pointers)) {
-@@ -1313,7 +1380,7 @@
+@@ -1345,18 +1412,18 @@
+                                                       index->name, (ulong) block->n_pointers);
+                                       }
+ #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
+-                                      rw_lock_x_unlock(&btr_search_latch);
++                                      rw_lock_x_unlock(btr_search_get_latch(index->id));
+                                       rw_lock_x_unlock(&block->lock);
+                                       mem_free(folds);
+-                                      rw_lock_s_lock(&btr_search_latch);
++                                      rw_lock_s_lock(btr_search_get_latch(index->id));
+                               }
+                       }
+               } while (released_search_latch);
        }
  
-       //buf_pool_mutex_exit_all();
--      rw_lock_x_unlock(&btr_search_latch);
-+      rw_lock_x_unlock(btr_search_get_latch(index->id));
+-      rw_lock_s_unlock(&btr_search_latch);
++      rw_lock_s_unlock(btr_search_get_latch(index->id));
  
        if (UNIV_LIKELY_NULL(heap)) {
                mem_heap_free(heap);
-@@ -1360,7 +1427,7 @@
+@@ -1403,7 +1470,7 @@
  
                buf_block_dbg_add_level(block, SYNC_TREE_NODE_FROM_HASH);
  
@@ -645,7 +690,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
        }
  
        mtr_commit(&mtr);
-@@ -1402,26 +1469,26 @@
+@@ -1445,26 +1512,26 @@
        ut_ad(index);
        ut_a(!dict_index_is_ibuf(index));
  
@@ -678,7 +723,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
        }
  
        n_recs = page_get_n_recs(page);
-@@ -1515,9 +1582,9 @@
+@@ -1558,9 +1625,9 @@
                fold = next_fold;
        }
  
@@ -690,7 +735,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
  
        if (UNIV_UNLIKELY(btr_search_fully_disabled)) {
                goto exit_func;
-@@ -1545,6 +1612,7 @@
+@@ -1588,6 +1655,7 @@
        block->curr_n_bytes = n_bytes;
        block->curr_left_side = left_side;
        block->index = index;
@@ -698,7 +743,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
  
        for (i = 0; i < n_cached; i++) {
  
-@@ -1552,7 +1620,7 @@
+@@ -1595,7 +1663,7 @@
        }
  
  exit_func:
@@ -707,7 +752,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
  
        mem_free(folds);
        mem_free(recs);
-@@ -1591,13 +1659,13 @@
+@@ -1634,13 +1702,13 @@
        ut_a(!(new_block->is_hashed || block->is_hashed)
             || !dict_index_is_ibuf(index));
  
@@ -724,7 +769,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
  
                return;
        }
-@@ -1612,7 +1680,7 @@
+@@ -1655,7 +1723,7 @@
                new_block->n_bytes = block->curr_n_bytes;
                new_block->left_side = left_side;
  
@@ -733,7 +778,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
  
                ut_a(n_fields + n_bytes > 0);
  
-@@ -1624,7 +1692,7 @@
+@@ -1667,7 +1735,7 @@
                return;
        }
  
@@ -742,7 +787,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
  }
  
  /********************************************************************//**
-@@ -1663,7 +1731,7 @@
+@@ -1706,7 +1774,7 @@
        ut_a(block->curr_n_fields + block->curr_n_bytes > 0);
        ut_a(!dict_index_is_ibuf(cursor->index));
  
@@ -751,7 +796,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
  
        index_id = cursor->index->id;
        fold = rec_fold(rec, rec_get_offsets(rec, cursor->index, offsets_,
-@@ -1672,11 +1740,11 @@
+@@ -1715,11 +1783,11 @@
        if (UNIV_LIKELY_NULL(heap)) {
                mem_heap_free(heap);
        }
@@ -765,7 +810,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
  }
  
  /********************************************************************//**
-@@ -1710,21 +1778,21 @@
+@@ -1753,21 +1821,21 @@
        ut_a(block->index == cursor->index);
        ut_a(!dict_index_is_ibuf(cursor->index));
  
@@ -791,7 +836,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
  
                btr_search_update_hash_on_insert(cursor);
        }
-@@ -1759,9 +1827,9 @@
+@@ -1802,9 +1870,9 @@
        ulint*          offsets         = offsets_;
        rec_offs_init(offsets_);
  
@@ -803,7 +848,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
  
        rec = btr_cur_get_rec(cursor);
  
-@@ -1806,7 +1874,7 @@
+@@ -1849,7 +1917,7 @@
        } else {
                if (left_side) {
  
@@ -812,7 +857,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
  
                        locked = TRUE;
  
-@@ -1820,7 +1888,7 @@
+@@ -1863,7 +1931,7 @@
  
                if (!locked) {
  
@@ -821,7 +866,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
  
                        locked = TRUE;
                }
-@@ -1838,7 +1906,7 @@
+@@ -1881,7 +1949,7 @@
                if (!left_side) {
  
                        if (!locked) {
@@ -830,7 +875,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
  
                                locked = TRUE;
                        }
-@@ -1853,7 +1921,7 @@
+@@ -1896,7 +1964,7 @@
  
                if (!locked) {
  
@@ -839,7 +884,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
  
                        locked = TRUE;
                }
-@@ -1876,7 +1944,7 @@
+@@ -1919,7 +1987,7 @@
                mem_heap_free(heap);
        }
        if (locked) {
@@ -848,7 +893,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
        }
  }
  
-@@ -1892,7 +1960,7 @@
+@@ -1935,7 +2003,7 @@
        ha_node_t*      node;
        ulint           n_page_dumps    = 0;
        ibool           ok              = TRUE;
@@ -857,7 +902,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
        ulint           cell_count;
        mem_heap_t*     heap            = NULL;
        ulint           offsets_[REC_OFFS_NORMAL_SIZE];
-@@ -1904,23 +1972,25 @@
+@@ -1947,23 +2015,25 @@
  
        rec_offs_init(offsets_);
  
@@ -888,7 +933,7 @@ diff -ruN a/storage/innobase/btr/btr0sea.c b/storage/innobase/btr/btr0sea.c
  
                for (; node != NULL; node = node->next) {
                        const buf_block_t*      block
-@@ -2029,19 +2099,21 @@
+@@ -2072,19 +2142,21 @@
                give other queries a chance to run. */
                if (i != 0) {
                        buf_pool_page_hash_x_unlock_all();
@@ -984,7 +1029,7 @@ diff -ruN a/storage/innobase/buf/buf0lru.c b/storage/innobase/buf/buf0lru.c
 diff -ruN a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
 --- a/storage/innobase/dict/dict0dict.c        2010-12-04 15:52:23.398513916 +0900
 +++ b/storage/innobase/dict/dict0dict.c        2010-12-04 16:12:48.662550715 +0900
-@@ -1802,7 +1802,7 @@
+@@ -1806,7 +1806,7 @@
        zero. */
  
        for (;;) {
@@ -1009,7 +1054,7 @@ diff -ruN a/storage/innobase/ha/ha0ha.c b/storage/innobase/ha/ha0ha.c
 diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
 --- a/storage/innobase/handler/ha_innodb.cc    2010-12-04 16:12:20.185850734 +0900
 +++ b/storage/innobase/handler/ha_innodb.cc    2010-12-04 16:12:48.674552412 +0900
-@@ -11611,6 +11611,11 @@
+@@ -11617,6 +11617,11 @@
    "Disable with --skip-innodb-adaptive-hash-index.",
    NULL, innodb_adaptive_hash_index_update, TRUE);
  
@@ -1021,7 +1066,7 @@ diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_
  static MYSQL_SYSVAR_ULONG(replication_delay, srv_replication_delay,
    PLUGIN_VAR_RQCMDARG,
    "Replication thread delay (ms) on the slave server if "
-@@ -11963,6 +11968,7 @@
+@@ -11964,6 +11969,7 @@
    MYSQL_SYSVAR(use_sys_stats_table),
    MYSQL_SYSVAR(stats_sample_pages),
    MYSQL_SYSVAR(adaptive_hash_index),
@@ -1217,7 +1262,7 @@ diff -ruN a/storage/innobase/include/btr0sea.ic b/storage/innobase/include/btr0s
 diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
 --- a/storage/innobase/include/buf0buf.h       2010-12-15 19:00:07.713604580 +0900
 +++ b/storage/innobase/include/buf0buf.h       2010-12-15 20:58:03.546839883 +0900
-@@ -1473,7 +1473,7 @@
+@@ -1544,7 +1544,7 @@
                                        pointers in the adaptive hash index
                                        pointing to this frame */
  #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
@@ -1226,7 +1271,7 @@ diff -ruN a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0bu
                                        already been built on this
                                        page; note that it does not
                                        guarantee that the index is
-@@ -1487,6 +1487,7 @@
+@@ -1558,6 +1558,7 @@
        unsigned        curr_left_side:1;/*!< TRUE or FALSE in hash indexing */
        dict_index_t*   index;          /*!< Index for which the adaptive
                                        hash index has been created. */
@@ -1424,7 +1469,7 @@ diff -ruN a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
 diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
 --- a/storage/innobase/srv/srv0srv.c   2010-12-04 16:12:20.231484679 +0900
 +++ b/storage/innobase/srv/srv0srv.c   2010-12-04 16:12:48.726551018 +0900
-@@ -2008,7 +2008,9 @@
+@@ -2042,7 +2042,9 @@
              "-------------------------------------\n", file);
        ibuf_print(file);
  
@@ -1435,7 +1480,7 @@ diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
  
        fprintf(file,
                "%.2f hash searches/s, %.2f non-hash searches/s\n",
-@@ -2033,14 +2035,15 @@
+@@ -2067,14 +2069,15 @@
                        ut_total_allocated_memory,
                        mem_pool_get_reserved(mem_comm_pool));
        /* Calcurate reserved memories */
@@ -1455,7 +1500,7 @@ diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
  
        lock_sys_subtotal = 0;
        if (trx_sys) {
-@@ -2067,10 +2070,10 @@
+@@ -2101,10 +2104,10 @@
                        "    Threads             %lu \t(%lu + %lu)\n",
  
                        (ulong) (btr_search_sys
This page took 0.103341 seconds and 4 git commands to generate.