Merge lp:~hrvojem/percona-server/bug898333_5.1 into lp:percona-server/5.1

Proposed by Hrvoje Matijakovic
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 422
Proposed branch: lp:~hrvojem/percona-server/bug898333_5.1
Merge into: lp:percona-server/5.1
Diff against target: 256 lines (+148/-20)
6 files modified
doc/source/conf.py (+4/-0)
doc/source/development.rst (+1/-8)
doc/source/glossary.rst (+22/-12)
doc/source/index.rst (+2/-0)
doc/source/management/innodb_extended_fast_index_creation.rst (+83/-0)
doc/source/performance/innodb_lazy_drop_table.rst (+36/-0)
To merge this branch: bzr merge lp:~hrvojem/percona-server/bug898333_5.1
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+90412@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :

OK to merge.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'doc/source/conf.py'
--- doc/source/conf.py 2011-10-07 00:55:06 +0000
+++ doc/source/conf.py 2012-01-30 16:52:26 +0000
@@ -104,8 +104,12 @@
104104
105.. |LSN| replace:: *LSN*105.. |LSN| replace:: *LSN*
106106
107.. |Jenkins| replace:: :term:`Jenkins`
108
107.. |XtraBackup| replace:: *XtraBackup*109.. |XtraBackup| replace:: *XtraBackup*
108110
111.. |myisamchk| replace:: *myisamchk*
112
109.. |Percona Server| replace:: *Percona Server*113.. |Percona Server| replace:: *Percona Server*
110114
111.. |Percona| replace:: *Percona*115.. |Percona| replace:: *Percona*
112116
=== modified file 'doc/source/development.rst'
--- doc/source/development.rst 2011-10-14 01:06:16 +0000
+++ doc/source/development.rst 2012-01-30 16:52:26 +0000
@@ -15,7 +15,7 @@
15(allowing for a release at any time) and minimizing wasted time by15(allowing for a release at any time) and minimizing wasted time by
16developers due to broken code from somebody else interfering with their day.16developers due to broken code from somebody else interfering with their day.
1717
18You should also be familiar with our :ref:`Jenkins` setup.18You should also be familiar with our |Jenkins| setup.
1919
20Overview20Overview
21~~~~~~~~21~~~~~~~~
@@ -166,13 +166,6 @@
166Jenkins166Jenkins
167=======167=======
168168
169`Jenkins <http://www.jenkins-ci.org>`_ is a continuous integration
170system that we use to help ensure the continued quality of the
171software we produce. It helps us achieve the aims of:
172* no failed tests in trunk on any platform
173* aid developers in ensuring merge requests build and test on all platforms
174* no known performance regressions (without a damn good explanation)
175
176Our Jenkins instance uses a mixture of VMs on physical hosts that169Our Jenkins instance uses a mixture of VMs on physical hosts that
177Percona runs and Virtual Machines in Amazon EC2 that are launched on170Percona runs and Virtual Machines in Amazon EC2 that are launched on
178demand.171demand.
179172
=== modified file 'doc/source/glossary.rst'
--- doc/source/glossary.rst 2011-09-26 18:40:15 +0000
+++ doc/source/glossary.rst 2012-01-30 16:52:26 +0000
@@ -5,8 +5,9 @@
5.. glossary::5.. glossary::
66
7 ACID7 ACID
8 :term:`Atomicity` :term:`Consistency` :term:`Isolation`8 Set of properties that guarantee database transactions are
9 :term:`Durability`9 processed reliably. Stands for: :term:`Atomicity`,
10 :term:`Consistency`, :term:`Isolation`, :term:`Durability`.
1011
11 Atomicity12 Atomicity
12 Atomicity means that database operations are applied following a13 Atomicity means that database operations are applied following a
@@ -20,21 +21,21 @@
20 Drizzle21 Drizzle
21 Drizzle: a database for the cloud.22 Drizzle: a database for the cloud.
2223
23 Drizzle is a community-driven open source project that is forked24 `Drizzle <http://www.drizzle.org/>`_ is a community-driven open source project that is forked
24 from the popular MySQL database. The Drizzle team has removed25 from the popular MySQL database. The Drizzle team has removed
25 non-essential code, re-factored the remaining code into a26 non-essential code, re-factored the remaining code into a
26 plugin-based architecture and modernized the code base moving to27 plugin-based architecture and modernized the code base moving to
27 C++.28 C++.
2829
29 Drizzle Charter30 Drizzle Charter:
30 * A database optimized for Cloud infrastructure and Web applications.31
31 * Design for massive concurrency on modern multi-cpu architecture32 * A database optimized for Cloud infrastructure and Web applications.
32 * Optimize memory for increased performance and parallelism33 * Design for massive concurrency on modern multi-cpu architecture
33 * Open source, open community, open design34 * Optimize memory for increased performance and parallelism
34 Scope35 * Open source, open community, open design Scope
35 * Re-designed modular architecture providing plugins with defined APIs36 * Re-designed modular architecture providing plugins with defined APIs
36 * Simple design for ease of use and administration37 * Simple design for ease of use and administration
37 * Reliable, ACID transactional38 * Reliable, ACID transactional
3839
39 Durability40 Durability
40 Once a transaction is committed, it will remain so.41 Once a transaction is committed, it will remain so.
@@ -56,6 +57,15 @@
56 :term:`MySQL` version 5.5, InnoDB became the default storage engine57 :term:`MySQL` version 5.5, InnoDB became the default storage engine
57 on all platforms.58 on all platforms.
5859
60 Jenkins
61 `Jenkins <http://www.jenkins-ci.org>`_ is a continuous integration
62 system that we use to help ensure the continued quality of the
63 software we produce. It helps us achieve the aims of:
64
65 * no failed tests in trunk on any platform,
66 * aid developers in ensuring merge requests build and test on all platforms,
67 * no known performance regressions (without a damn good explanation).
68
59 LSN69 LSN
60 Log Serial Number. A term used in relation to the :term:`InnoDB` or70 Log Serial Number. A term used in relation to the :term:`InnoDB` or
61 :term:`XtraDB` storage engines.71 :term:`XtraDB` storage engines.
6272
=== modified file 'doc/source/index.rst'
--- doc/source/index.rst 2011-10-19 22:40:57 +0000
+++ doc/source/index.rst 2012-01-30 16:52:26 +0000
@@ -69,6 +69,7 @@
69 :glob:69 :glob:
7070
71 performance/innodb_purge_thread71 performance/innodb_purge_thread
72 performance/innodb_lazy_drop_table
72 performance/innodb_doublewrite_path73 performance/innodb_doublewrite_path
73 performance/query_cache_enhance74 performance/query_cache_enhance
74 performance/innodb_fast_checksum75 performance/innodb_fast_checksum
@@ -116,6 +117,7 @@
116 management/innodb_buffer_pool_shm117 management/innodb_buffer_pool_shm
117 management/innodb_lru_dump_restore118 management/innodb_lru_dump_restore
118 management/innodb_fast_index_creation119 management/innodb_fast_index_creation
120 management/innodb_extended_fast_index_creation
119 management/innodb_fast_index_renaming121 management/innodb_fast_index_renaming
120 management/sql_no_fcache122 management/sql_no_fcache
121 management/udf_maatkit123 management/udf_maatkit
122124
=== added file 'doc/source/management/innodb_extended_fast_index_creation.rst'
--- doc/source/management/innodb_extended_fast_index_creation.rst 1970-01-01 00:00:00 +0000
+++ doc/source/management/innodb_extended_fast_index_creation.rst 2012-01-30 16:52:26 +0000
@@ -0,0 +1,83 @@
1.. _extended_innodb_fast_index_creation:
2
3============================
4Extended Fast Index Creation
5============================
6
7Percona has implemented several changes related to |MySQL|'s fast index creation feature. This feature extends the ``ALTER TABLE`` command by adding a new clause that provides online index renaming capability, that is renaming indexes without rebuilding the whole table.
8
9Enabling Extended Fast Index Creation
10=====================================
11
12Fast index creation was implemented in |MySQL| as a way to speed up the process of adding or dropping indexes on tables with many rows. However, cases have been found in which fast index creation creates an inconsistency between |MySQL| and |InnoDB| data dictionaries.
13
14This feature implements a session variable that enables extended fast index creation. Besides optimizing DDL directly, :variable:`expand_fast_index_creation` may also optimize index access for subsequent DML statements because using it results in much less fragmented indexes.
15
16
17:command:`mysqldump`
18--------------------
19
20A new option, ``--innodb-optimize-keys``, was implemented in :command:`mysqldump`. It changes the way |InnoDB| tables are dumped, so that secondary and foreign keys are created after loading the data, thus taking advantage of fast index creation. More specifically:
21
22 * ``KEY``, ``UNIQUE KEY``, and ``CONSTRAINT`` clauses are omitted from ``CREATE TABLE`` statements corresponding to |InnoDB| tables.
23
24 * An additional ``ALTER TABLE`` is issued after dumping the data, in order to create the previously omitted keys.
25
26
27``ALTER TABLE``
28---------------
29
30When ``ALTER TABLE`` requires a table copy, secondary keys are now dropped and recreated later, after copying the data. The following restrictions apply:
31
32 * Only non-unique keys can be involved in this optimization.
33
34 * If the table contains foreign keys, or a foreign key is being added as a part of the current ``ALTER TABLE`` statement, the optimization is disabled for all keys.
35
36``OPTIMIZE TABLE``
37------------------
38
39Internally, ``OPTIMIZE TABLE`` is mapped to ``ALTER TABLE ... ENGINE=innodb`` for |InnoDB| tables. As a consequence, it now also benefits from fast index creation, with the same restrictions as for ``ALTER TABLE``.
40
41
42Caveats
43-------
44
45|InnoDB| fast index creation uses temporary files in tmpdir for all indexes being created. So make sure you have enough tmpdir space when using :variable:`expand_fast_index_creation`. It is a session variable, so you can temporarily switch it off if you are short on tmpdir space and/or don’t want this optimization to be used for a specific table.
46
47There’s also a number of cases when this optimization is not applicable:
48 * ``UNIQUE`` indexes in ``ALTER TABLE`` are ignored to enforce uniqueness where necessary when copying the data to a temporary table;
49
50 * ``ALTER TABLE`` and ``OPTIMIZE TABLE`` always process tables containing foreign keys as if :variable:`expand_fast_index_creation` is OFF to avoid dropping keys that are part of a FOREIGN KEY constraint;
51
52 * :command:`mysqldump --innodb-optimize-keys` ignores foreign keys because |InnoDB| requires a full table rebuild on foreign key changes. So adding them back with a separate ``ALTER TABLE`` after restoring the data from a dump would actually make the restore slower;
53
54 * :command:`mysqldump --innodb-optimize-keys` ignores indexes on ``AUTO_INCREMENT`` columns, because they must be indexed, so it is impossible to temporarily drop the corresponding index;
55
56 * :command:`mysqldump --innodb-optimize-keys` ignores the first UNIQUE index on non-nullable columns when the table has no ``PRIMARY KEY`` defined, because in this case |InnoDB| picks such an index as the clustered one.
57
58Version Specific Information
59============================
60
61 * 5.1.59-13.0
62 Variable :variable:`expand_fast_index_creation` implemented.
63 This variable controls whether fast index creation optimizations made by Perocna are used.
64
65System Variables
66================
67
68.. variable:: expand_fast_index_creation
69
70 :cli: Yes
71 :conf: No
72 :scope: Local/Global
73 :dyn: Yes
74 :vartype: Boolean
75 :default: OFF
76 :range: ON/OFF
77
78Other Reading
79=============
80
81 * `Improved InnoDB fast index creation <http://www.mysqlperformanceblog.com/2011/11/06/improved-innodb-fast-index-creation/>`_
82 * `Thinking about running OPTIMIZE on your InnoDB Table? Stop! <http://www.mysqlperformanceblog.com/2010/12/09/thinking-about-running-optimize-on-your-innodb-table-stop/>`_
83
084
=== added file 'doc/source/performance/innodb_lazy_drop_table.rst'
--- doc/source/performance/innodb_lazy_drop_table.rst 1970-01-01 00:00:00 +0000
+++ doc/source/performance/innodb_lazy_drop_table.rst 2012-01-30 16:52:26 +0000
@@ -0,0 +1,36 @@
1.. _innodb_lazy_drop_table_page:
2
3======================
4Drop table performance
5======================
6
7When *innodb_file_per_table* is set to 1, doing a DROP TABLE can take a long time on servers with a large buffer pool, even on an empty |InnoDB| table. This is because InnoDB has to scan through the buffer pool to purge pages that belong to the corresponding tablespace. Furthermore, no other queries can start while that scan is in progress.
8
9This feature allows you to do "background table drop".
10
11Version Specific Information
12============================
13
14 * 5.1.56-12-7 Feature added.
15
16System Variables
17================
18
19.. variable:: innodb_lazy_drop_table
20
21 :cli: Yes
22 :conf: Yes
23 :scope: Global
24 :dyn: Yes
25 :vartype: BOOL
26 :default: FALSE
27 :range: TRUE/FALSE
28
29When this option is ON, XtraDB optimizes that process by only marking the pages corresponding to the tablespace being deleted. It defers the actual work of evicting those pages until it needs to find some free pages in the buffer pool.
30
31When this option is OFF, the usual behavior for dropping tables is in effect.
32
33Related Reading
34===============
35
36 * Drop table performance `blog post <http://www.mysqlperformanceblog.com/2011/04/20/drop-table-performance/>`_.

Subscribers

People subscribed via source and target branches