September 28, 2008

What is stored InnoDB buffer pool

Posted by Vadim |

Ever wonder what is stored in InnoDB buffer pool at the moment ?

It is not so hard actually - we made a short patch for MySQL 5.0 which show innodb buffer pool content

SQL:
  1. mysql> SELECT * FROM information_schema.INNODB_BUFFER_POOL_CONTENT; 
  2. +-----------+-------+--------+---------+----------+------------+-----------+--------------+--------------+----------------+-----------------+--------------+------------------+
  3. | BLOCK_NUM | SPACE | OFFSET | RECORDS | DATASIZE | FLUSH_TYPE | FIX_COUNT | LRU_POSITION | PAGE_TYPE_ID | PAGE_TYPE      | INDEX_NAME      | TABLE_SCHEMA | TABLE_NAME       |
  4. +-----------+-------+--------+---------+----------+------------+-----------+--------------+--------------+----------------+-----------------+--------------+------------------+
  5. |         0 |     0 |      7 |       0 |        0 |          0 |         0 |            2 |            6 | unknown        |                 |              |                  |
  6. |         1 |     0 |      1 |       0 |        0 |          0 |         0 |            3 |            5 | unknown        |                 |              |                  |
  7. |         2 |     0 |      3 |       0 |        0 |          0 |         0 |            4 |            6 | unknown        |                 |              |                  |
  8. |         3 |     0 |      2 |       0 |        0 |          0 |         0 |            5 |            3 | inode          |                 |              |                  |
  9. |         4 |     0 |      4 |       0 |        0 |          0 |         0 |            6 |        17855 | INDEX          | CLUST_IND       |              | SYS_IBUF_TABLE_0 |
  10. |         5 |     0 |     11 |      23 |     1560 |          0 |         0 |            7 |        17855 | INDEX          | CLUST_IND       |              | SYS_INDEXES      |
  11. |         6 |     0 |      5 |     242 |        0 |          3 |         0 |            8 |            7 | unknown        |                 |              |                  |
  12. |         7 |     0 |      6 |    3006 |        0 |          0 |         0 |            9 |            6 | unknown        |                 |              |                  |
  13. |         8 |     0 |     45 |       0 |        0 |          0 |         0 |           10 |            2 | undo_log       |                 |              |                  |
  14. |         9 |     0 |     50 |       0 |        0 |          0 |         0 |           11 |            2 | undo_log       |                 |              |                  |
  15. |        10 |     0 |      8 |      12 |      894 |          0 |         0 |           12 |        17855 | INDEX          | CLUST_IND       |              | SYS_TABLES       |
  16. |        11 |     0 |      0 |       0 |        0 |          0 |         0 |           13 |            8 | unknown        |                 |              |                  |
  17. |        12 |     0 |     10 |      93 |     5864 |          0 |         0 |           14 |        17855 | INDEX          | CLUST_IND       |              | SYS_COLUMNS      |
  18. |        13 |     0 |      9 |      12 |      354 |          0 |         0 |           15 |        17855 | INDEX          | ID_IND          |              | SYS_TABLES       |
  19. |        14 |     0 |     12 |      32 |     1313 |          0 |         0 |           16 |        17855 | INDEX          | CLUST_IND       |              | SYS_FIELDS       |
  20. |        47 |     0 |     46 |       0 |        0 |          0 |         0 |           49 |        17855 | INDEX          | ID_IND          |              | SYS_FOREIGN      |
  21. |        48 |     0 |     47 |       0 |        0 |          0 |         0 |           50 |        17855 | INDEX          | FOR_IND         |              | SYS_FOREIGN      |
  22. |        49 |     0 |     48 |       0 |        0 |          0 |         0 |           51 |        17855 | INDEX          | REF_IND         |              | SYS_FOREIGN      |
  23. |        50 |     0 |     49 |       0 |        0 |          0 |         0 |           52 |        17855 | INDEX          | ID_IND          |              | SYS_FOREIGN_COLS |
  24. |        51 |     0 |     51 |      14 |     1589 |          0 |         0 |           53 |        17855 | INDEX          | CLUST_IND       |              | SYS_IBUF_TABLE_0 |
  25. |        52 |     0 |     52 |     138 |    16037 |          0 |         0 |           54 |        17855 | INDEX          | CLUST_IND       |              | SYS_IBUF_TABLE_0 |
  26. |        53 |     0 |     53 |      72 |     8148 |          0 |         0 |           55 |        17855 | INDEX          | CLUST_IND       |              | SYS_IBUF_TABLE_0 |
  27. |        54 |     0 |     54 |      55 |     6313 |          0 |         0 |           56 |        17855 | INDEX          | CLUST_IND       |              | SYS_IBUF_TABLE_0 |
  28. |        55 |     0 |     55 |      39 |     3959 |          0 |         0 |           57 |        17855 | INDEX          | CLUST_IND       |              | SYS_IBUF_TABLE_0 |
  29. |        56 |     0 |     56 |      24 |     2816 |          0 |         0 |           58 |        17855 | INDEX          | CLUST_IND       |              | SYS_IBUF_TABLE_0 |
  30. |        57 |     0 |     57 |     286 |        0 |          0 |         0 |           59 |            4 | ibuf_free_list |                 |              |                  |
  31. |        58 |     0 |     58 |     928 |        0 |          0 |         0 |           60 |            4 | ibuf_free_list |                 |              |                  |
  32. |        59 |     0 |     59 |      64 |        0 |          0 |         0 |           61 |            4 | ibuf_free_list |                 |              |                  |
  33. |        60 |     0 |     60 |     132 |        0 |          0 |         0 |           62 |            4 | ibuf_free_list |                 |              |                  |
  34. |        61 |     0 |     61 |      69 |        0 |          0 |         0 |           63 |            4 | ibuf_free_list |                 |              |                  |
  35. |        62 |     0 |     62 |      44 |        0 |          0 |         0 |           64 |            4 | ibuf_free_list |                 |              |                  |
  36. |        63 |     0 |     63 |      44 |        0 |          0 |         0 |           65 |            2 | undo_log       |                 |              |                  |
  37. |        64 |    17 |      3 |       4 |       60 |          0 |         0 |           66 |        17855 | INDEX          | GEN_CLUST_INDEX | art          | a87              |
  38. |        66 |    17 |      2 |       0 |        0 |          0 |         0 |           68 |            3 | inode          |                 |              |                  |
  39. |        67 |    17 |     38 |    1048 |    15720 |          0 |         0 |           69 |        17855 | INDEX          | GEN_CLUST_INDEX | art          | a87              |
  40. |        68 |    17 |   1715 |     128 |    15077 |          0 |         0 |           70 |        17855 | INDEX          | GEN_CLUST_INDEX | art          | a87              |
  41. |        69 |    17 |     37 |    1048 |    15720 |          0 |         0 |           71 |        17855 | INDEX          | GEN_CLUST_INDEX | art          | a87              |
  42. |        70 |    17 |    886 |     134 |    15147 |          0 |         0 |           72 |        17855 | INDEX          | GEN_CLUST_INDEX | art          | a87              |
  43. |        71 |    17 |     36 |     524 |     7860 |          0 |         0 |           73 |        17855 | INDEX          | GEN_CLUST_INDEX | art          | a87              |
  44. |        72 |    17 |     29 |     137 |    15085 |          0 |         0 |           74 |        17855 | INDEX          | GEN_CLUST_INDEX | art          | a87              |
  45. |        73 |    17 |     39 |     155 |     2325 |          0 |         0 |           75 |        17855 | INDEX          | GEN_CLUST_INDEX | art          | a87              |
  46. |        74 |    17 |   2670 |     130 |    15114 |          0 |         0 |           76 |        17855 | INDEX          | GEN_CLUST_INDEX | art          | a87              |
  47. |        75 |    17 |   2591 |     117 |    15112 |          0 |         0 |           77 |        17855 | INDEX          | GEN_CLUST_INDEX | art          | a87              |
  48. |        76 |    17 |    714 |     146 |    15067 |          0 |         0 |           78 |        17855 | INDEX          | GEN_CLUST_INDEX | art          | a87              |
  49. |        77 |    17 |    409 |     142 |    15110 |          0 |         0 |           79 |        17855 | INDEX          | GEN_CLUST_INDEX | art          | a87              |
  50. |        78 |    17 |   2739 |     133 |    15110 |          0 |         0 |           80 |        17855 | INDEX          | GEN_CLUST_INDEX | art          | a87              |
  51. |        79 |     1 |      3 |       3 |       39 |          0 |         0 |           81 |        17855 | INDEX          | PRIMARY         | art          | author87         |
  52. |        80 |     1 |      1 |       0 |        0 |          0 |         0 |           51 |            5 | unknown        |                 |              |                  |
  53. |        81 |     1 |      2 |       0 |        0 |          0 |         0 |           51 |            3 | inode          |                 |              |                  |
  54. |        82 |     1 |    137 |     807 |    10491 |          0 |         0 |           51 |        17855 | INDEX          | PRIMARY         | art          | author87         |
  55. |        83 |     1 |   3491 |     140 |    15095 |          0 |         0 |           51 |        17855 | INDEX          | PRIMARY         | art          | author87         |
  56. |        84 |     1 |   3799 |     139 |    15144 |          0 |         0 |           51 |        17855 | INDEX          | PRIMARY         | art          | author87         |
  57. |        85 |     1 |   2852 |     173 |    15070 |          0 |         0 |           51 |        17855 | INDEX          | PRIMARY         | art          | author87         |
  58. |        86 |     1 |   3096 |     167 |    15054 |          0 |         0 |           51 |        17855 | INDEX          | PRIMARY         | art          | author87         |
  59. |        87 |     1 |   3340 |     286 |    15082 |          0 |         0 |           51 |        17855 | INDEX          | PRIMARY         | art          | author87         |
  60. |        88 |     1 |   3648 |     138 |    15127 |          0 |         0 |           51 |        17855 | INDEX          | PRIMARY         | art          | author87         |
  61. |        89 |     1 |   3892 |     151 |    15088 |          0 |         0 |           51 |        17855 | INDEX          | PRIMARY         | art          | author87         |
  62. |        90 |     1 |   3009 |     187 |    15119 |          0 |         0 |           51 |        17855 | INDEX          | PRIMARY         | art          | author87         |
  63. |        91 |     1 |      4 |       3 |      102 |          0 |         0 |           51 |        17855 | INDEX          | site_id         | art          | author87         |
  64. |        92 |     1 |    138 |     360 |    11649 |          0 |         0 |           51 |        17855 | INDEX          | site_id         | art          | author87         |
  65. |        93 |     1 |   3255 |     354 |     9201 |          0 |         0 |           51 |        17855 | INDEX          | site_id         | art          | author87         |
  66. |        94 |     1 |   1534 |     309 |    10506 |          0 |         0 |           51 |        17855 | INDEX          | site_id         | art          | author87         |
  67. |        95 |     1 |   3440 |     328 |     8198 |          0 |         0 |           51 |        17855 | INDEX          | site_id         | art          | author87         |
  68. |        96 |     1 |    479 |     498 |    11689 |          0 |         0 |           51 |        17855 | INDEX          | site_id         | art          | author87         |
  69. |        97 |     1 |   3246 |     346 |     8981 |          0 |         0 |           51 |        17855 | INDEX          | site_id         | art          | author87         |
  70. |        98 |     1 |   2518 |     427 |    11450 |          0 |         0 |           51 |        17855 | INDEX          | site_id         | art          | author87         |
  71. |        99 |     1 |   2070 |     316 |     8273 |          0 |         0 |           51 |        17855 | INDEX          | site_id         | art          | author87         |
  72. |       100 |     1 |   3259 |     324 |     8988 |          0 |         0 |           51 |        17855 | INDEX          | site_id         | art          | author87         |
  73. |       101 |     1 |    135 |     601 |     7813 |          0 |         0 |           51 |        17855 | INDEX          | PRIMARY         | art          | author87         |
  74. |       102 |     1 |      5 |     140 |     7812 |          0 |         0 |           51 |        17855 | INDEX          | PRIMARY         | art          | author87         |
  75. |       103 |     1 |      6 |     286 |    15067 |          0 |         0 |           51 |        17855 | INDEX          | PRIMARY         | art          | author87         |
  76. |       122 |     1 |     32 |      94 |    15024 |          0 |         0 |           51 |        17855 | INDEX          | PRIMARY         | art          | author87         |
  77. +-----------+-------+--------+---------+----------+------------+-----------+--------------+--------------+----------------+-----------------+--------------+------------------+
  78. 90 rows IN SET (0.01 sec

The binaries, RPMS (RedHat/Centos) and full source code also available to download

P.S. There is Jeremy Cole's patch for InnoDB plugin MySQL 5.1, and main idea was taken from there.

Related posts: :Quickly preloading Innodb tables in the buffer pool::Few more ideas for InnoDB features::More Gotchas with MySQL 5.0:
 

6 Comments »

  1. This is great! Can we expect to see this coming out in the Percona 5.1 binaries as well?

    Comment :: September 29, 2008 @ 5:16 am

  2. 2. Nils

    Is this patch also for the 5.0.68 Percona release available?

    Comment :: September 29, 2008 @ 9:01 am

  3. 3. Vadim

    Gregory:

    I think in 5.1 we will include Jeremey Cole’s patch

    Comment :: September 29, 2008 @ 9:14 am

  4. 4. Vadim

    Nils,

    It is only for 5.0.67, will release for 5.0.68 later

    Comment :: September 29, 2008 @ 9:15 am

  5. I am looking for a similar tool for the ibdata and ibd files – somethings that dumps page numbers and for each page tells me what the page is and does.

    Comment :: March 16, 2009 @ 1:56 am

  6. 6. Vadim

    Isotopp,

    It is on our todo, will implement it when we can :)

    Comment :: March 16, 2009 @ 10:24 am

 

Subscribe without commenting

Trackbacks/Pingbacks