<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.rixort.com/index.php?action=history&amp;feed=atom&amp;title=MySQL_Performance</id>
	<title>MySQL Performance - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.rixort.com/index.php?action=history&amp;feed=atom&amp;title=MySQL_Performance"/>
	<link rel="alternate" type="text/html" href="https://wiki.rixort.com/index.php?title=MySQL_Performance&amp;action=history"/>
	<updated>2026-06-04T15:44:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.rixort.com/index.php?title=MySQL_Performance&amp;diff=1222&amp;oldid=prev</id>
		<title>Paul: /* Database dumps */</title>
		<link rel="alternate" type="text/html" href="https://wiki.rixort.com/index.php?title=MySQL_Performance&amp;diff=1222&amp;oldid=prev"/>
		<updated>2021-11-08T10:56:21Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Database dumps&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:56, 8 November 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l101&quot;&gt;Line 101:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 101:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Database dumps ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Database dumps ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Fastest way to create a database dump is to pass &amp;lt;code&amp;gt;--quick&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--single-transaction&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt;. This will only work if all your tables are InnoDB (which they should be, unless you have very specific use cases).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Fastest way to create a database dump is to pass &amp;lt;code&amp;gt;--quick&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--single-transaction&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt;. This will only work if all your tables are InnoDB (which they should be, unless you have very specific use cases)&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. In theory you should also pass &amp;lt;code&amp;gt;--opt&amp;lt;/code&amp;gt;, but in practice this is enabled by default&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:MySQL]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:MySQL]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Paul</name></author>
	</entry>
	<entry>
		<id>https://wiki.rixort.com/index.php?title=MySQL_Performance&amp;diff=1221&amp;oldid=prev</id>
		<title>Paul at 10:55, 8 November 2021</title>
		<link rel="alternate" type="text/html" href="https://wiki.rixort.com/index.php?title=MySQL_Performance&amp;diff=1221&amp;oldid=prev"/>
		<updated>2021-11-08T10:55:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 10:55, 8 November 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l98&quot;&gt;Line 98:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 98:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ALTER TABLE my_table ADD KEY (my_column)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ALTER TABLE my_table ADD KEY (my_column)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== Database dumps ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Fastest way to create a database dump is to pass &amp;lt;code&amp;gt;--quick&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--single-transaction&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;mysqldump&amp;lt;/code&amp;gt;. This will only work if all your tables are InnoDB (which they should be, unless you have very specific use cases).&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:MySQL]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:MySQL]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Paul</name></author>
	</entry>
	<entry>
		<id>https://wiki.rixort.com/index.php?title=MySQL_Performance&amp;diff=9&amp;oldid=prev</id>
		<title>Paul at 14:59, 4 March 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.rixort.com/index.php?title=MySQL_Performance&amp;diff=9&amp;oldid=prev"/>
		<updated>2018-03-04T14:59:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:59, 4 March 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l99&quot;&gt;Line 99:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 99:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ALTER TABLE my_table ADD KEY (my_column)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ALTER TABLE my_table ADD KEY (my_column)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:&lt;/del&gt;:MySQL]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:MySQL]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Paul</name></author>
	</entry>
	<entry>
		<id>https://wiki.rixort.com/index.php?title=MySQL_Performance&amp;diff=8&amp;oldid=prev</id>
		<title>Paul at 14:59, 4 March 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.rixort.com/index.php?title=MySQL_Performance&amp;diff=8&amp;oldid=prev"/>
		<updated>2018-03-04T14:59:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:59, 4 March 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l98&quot;&gt;Line 98:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 98:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ALTER TABLE my_table ADD KEY (my_column)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ALTER TABLE my_table ADD KEY (my_column)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category::MySQL]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Paul</name></author>
	</entry>
	<entry>
		<id>https://wiki.rixort.com/index.php?title=MySQL_Performance&amp;diff=7&amp;oldid=prev</id>
		<title>Paul: Created page with &quot;== Connections ==  The MySQL protocol is half-duplex, which means that it can send or receive messages, but not both at the same time.  == Query cache ==  Looking up an item i...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.rixort.com/index.php?title=MySQL_Performance&amp;diff=7&amp;oldid=prev"/>
		<updated>2018-03-04T14:58:09Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Connections ==  The MySQL protocol is half-duplex, which means that it can send or receive messages, but not both at the same time.  == Query cache ==  Looking up an item i...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Connections ==&lt;br /&gt;
&lt;br /&gt;
The MySQL protocol is half-duplex, which means that it can send or receive&lt;br /&gt;
messages, but not both at the same time.&lt;br /&gt;
&lt;br /&gt;
== Query cache ==&lt;br /&gt;
&lt;br /&gt;
Looking up an item in the query cache is a hash operation.&lt;br /&gt;
&lt;br /&gt;
== Profiling queries ==&lt;br /&gt;
&lt;br /&gt;
Enable the profiler for this session (note this method is deprecated in later versions of Percona):&lt;br /&gt;
&lt;br /&gt;
 SET PROFILING = 1&lt;br /&gt;
&lt;br /&gt;
Run query:&lt;br /&gt;
&lt;br /&gt;
 SELECT * FROM table&lt;br /&gt;
&lt;br /&gt;
Show the profiles (summary of query and time taken):&lt;br /&gt;
&lt;br /&gt;
 SHOW PROFILES&lt;br /&gt;
&lt;br /&gt;
Show detailed information for a specific query:&lt;br /&gt;
&lt;br /&gt;
 SHOW PROFILE FOR QUERY 1&lt;br /&gt;
&lt;br /&gt;
To clear out the query cache:&lt;br /&gt;
&lt;br /&gt;
 RESET QUERY CACHE&lt;br /&gt;
&lt;br /&gt;
== Using EXPLAIN ==&lt;br /&gt;
&lt;br /&gt;
A simple test to see if indexes are being used:&lt;br /&gt;
&lt;br /&gt;
 EXPLAIN SELECT * FROM table WHERE column = ?&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;code&amp;gt;rows&amp;lt;/code&amp;gt; value returned is significantly higher than the number of rows fetched by the query and the &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; value is &amp;lt;code&amp;gt;ALL&amp;lt;/code&amp;gt; then it is likely that MySQL is performing a full table scan. Adding an index can significantly reduce the number of rows scanned  (though not always down to 1:1 scanned:fetched).&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;code&amp;gt;extra&amp;lt;/code&amp;gt; value is &amp;lt;code&amp;gt;Using where&amp;lt;/code&amp;gt; then this also suggests that MySQL is discarding rows after scanning them, which may have performance implications.&lt;br /&gt;
&lt;br /&gt;
== Locking ==&lt;br /&gt;
&lt;br /&gt;
Locking has a trade-off effect on performance. On the one hand, a high-level lock (e.g. table lock) is cheap to obtain, but prevents reads and writes. A row-level lock is more expensive to obtain, but allows reads and writes to other&lt;br /&gt;
rows.&lt;br /&gt;
&lt;br /&gt;
In some circumstances, the locking strategy is fixed. For example, &amp;lt;code&amp;gt;ALTER TABLE&amp;lt;/code&amp;gt; commands will always require a table lock.&lt;br /&gt;
&lt;br /&gt;
== Transactions ==&lt;br /&gt;
&lt;br /&gt;
Transactions help to ensure that a collection of statements are executed as one atomic commit. There is a cost to this, and it may not be required for all applications.&lt;br /&gt;
&lt;br /&gt;
== Storage engines ==&lt;br /&gt;
&lt;br /&gt;
To find the storage engine for a given table:&lt;br /&gt;
&lt;br /&gt;
 SELECT engine FROM information_schema.tables&lt;br /&gt;
 WHERE&lt;br /&gt;
   table_schema = &amp;#039;database&amp;#039;&lt;br /&gt;
   AND table_name = &amp;#039;table&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Storage engines for all tables in a given database:&lt;br /&gt;
&lt;br /&gt;
 SELECT table_name, engine FROM information_schema.tables&lt;br /&gt;
 WHERE&lt;br /&gt;
   table_schema = &amp;#039;database&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=== MyISAM ===&lt;br /&gt;
&lt;br /&gt;
MyISAM supports compressed tables using &amp;lt;code&amp;gt;myisampack&amp;lt;/code&amp;gt;. Compressed tables use up less disk space and therefore require fewer seeks to load. They may be a good choice for read-only data, e.g. lookup tables.&lt;br /&gt;
&lt;br /&gt;
The major downside to MyISAM is that it uses table locking, and therefore it is not suitable for data which is regularly updated (e.g. sessions, logs).&lt;br /&gt;
&lt;br /&gt;
=== Converting between storage engines ===&lt;br /&gt;
&lt;br /&gt;
The simplest and easiest way to convert a table to another storage engine is with the &amp;lt;code&amp;gt;ALTER TABLE&amp;lt;/code&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
 ALTER TABLE mytable ENGINE = &amp;#039;InnoDB&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
However, this performs a copy of each row in the table, and therefore is unlikely to be suitable for live data.&lt;br /&gt;
&lt;br /&gt;
== Data types ==&lt;br /&gt;
&lt;br /&gt;
Some broad advice:&lt;br /&gt;
&lt;br /&gt;
* Simpler data types are easier to process.&lt;br /&gt;
* Integers are cheaper to compare than strings.&lt;br /&gt;
* Use integers for IP addresses.&lt;br /&gt;
* Avoid NULL where possible as it is harder for MySQL to optimise queries which may involve NULL values.&lt;br /&gt;
&lt;br /&gt;
== Joins ==&lt;br /&gt;
&lt;br /&gt;
MySQL has a limit of 61 tables per join.&lt;br /&gt;
&lt;br /&gt;
== Indexes ==&lt;br /&gt;
&lt;br /&gt;
Adding a b-tree index to an InnoDB table:&lt;br /&gt;
&lt;br /&gt;
 ALTER TABLE my_table ADD KEY (my_column)&lt;/div&gt;</summary>
		<author><name>Paul</name></author>
	</entry>
</feed>