<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Stratus - Database Guides on Webscale Product Documentation</title><link>https://docs.webscale.com/docs/reference/stratus/guides/database/</link><description>Recent content in Stratus - Database Guides on Webscale Product Documentation</description><generator>Hugo</generator><language>en</language><atom:link href="https://docs.webscale.com/docs/reference/stratus/guides/database/index.xml" rel="self" type="application/rss+xml"/><item><title>Stratus Guides - MySQL Queries Gone Wild</title><link>https://docs.webscale.com/docs/reference/stratus/guides/database/mysql-queries-gone-wild/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.webscale.com/docs/reference/stratus/guides/database/mysql-queries-gone-wild/</guid><description>&lt;h2 id="accessing-mysql-on-webscale-stratus"&gt;Accessing MySQL on Webscale STRATUS&lt;/h2&gt;
&lt;p&gt;To access your Magento MySQL instance on Webscale STRATUS:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Access your Magento install via SSH.&lt;/li&gt;
&lt;li&gt;Navigate to the Magento web root (typically, &lt;code&gt;public-html/&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;n98-magerun db:console&lt;/code&gt; (Magento 1) or &lt;code&gt;n98-magerun2 db:console&lt;/code&gt; (Magento 2).&lt;/li&gt;
&lt;li&gt;Run the query you desire.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="to-get-table-sizes"&gt;To Get Table Sizes&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;SELECT CONCAT(table_schema, '.', table_name),
 CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
 CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,
 CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,
 CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
 ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
ORDER BY data_length + index_length DESC
LIMIT 10;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="to-blackhole-magento-1-log-tables"&gt;To &amp;ldquo;Blackhole&amp;rdquo; Magento 1 Log Tables&lt;/h2&gt;
&lt;p&gt;There are a number of log-related tables that get bloated very quickly. These tables are rarely referred to by Magento store owners. If you don&amp;rsquo;t anticipate needing the data from these tables, then you should empty and &amp;ldquo;blackhole&amp;rdquo; them.&lt;/p&gt;</description></item></channel></rss>