<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>lunatechian (lunatech-ian)  - mysql</title>
    <link>http://www.rajshekhar.net/blog/</link>
    <description>one relating to, belonging to, or resembling lunatech</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 2.4.0 - http://www.s9y.org/</generator>
    <pubDate>Thu, 22 Sep 2011 22:21:32 GMT</pubDate>

    <image>
    <url>http://www.rajshekhar.net/blog/templates/2k11/img/s9y_banner_small.png</url>
    <title>RSS: lunatechian (lunatech-ian)  - mysql - one relating to, belonging to, or resembling lunatech</title>
    <link>http://www.rajshekhar.net/blog/</link>
    <width>100</width>
    <height>21</height>
</image>

<item>
    <title>audit for incorrect engine</title>
    <link>http://www.rajshekhar.net/blog/archives/412-audit-for-incorrect-engine.html</link>
            <category>geek stuff</category>
            <category>mysql</category>
    
    <comments>http://www.rajshekhar.net/blog/archives/412-audit-for-incorrect-engine.html#comments</comments>
    <wfw:comment>http://www.rajshekhar.net/blog/wfwcomment.php?cid=412</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.rajshekhar.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=412</wfw:commentRss>
    

    <author>nospam@example.com (Raj Shekhar)</author>
    <content:encoded>
    &lt;p&gt;

If you use innodb engine exclusively, and want to audit your databases for any tables that might have an incorrect engine, use the command below -  

&lt;pre&gt;
mysql -u root -p  information_schema -e \
&quot;select TABLE_SCHEMA,TABLE_NAME, ENGINE from TABLES where\
 ENGINE != &#039;Innodb&#039; \
 and TABLE_SCHEMA not in (&#039;mysql&#039;,&#039;information_schema&#039;);&quot;
&lt;/pre&gt;

&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 22 Sep 2011 22:21:32 +0000</pubDate>
    <guid isPermaLink="false">http://www.rajshekhar.net/blog/archives/412-guid.html</guid>
    
</item>
<item>
    <title>mysql startup debugging tip</title>
    <link>http://www.rajshekhar.net/blog/archives/407-mysql-startup-debugging-tip.html</link>
            <category>geek stuff</category>
            <category>mysql</category>
    
    <comments>http://www.rajshekhar.net/blog/archives/407-mysql-startup-debugging-tip.html#comments</comments>
    <wfw:comment>http://www.rajshekhar.net/blog/wfwcomment.php?cid=407</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.rajshekhar.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=407</wfw:commentRss>
    

    <author>nospam@example.com (Raj Shekhar)</author>
    <content:encoded>
    &lt;p&gt;If you are not able to start the mysql daemon repeatedly using your
linux distribution init scripts and you are ready to pull out your
hair in frustration, here is a tip that might help you in finding the
problem.&lt;/p&gt;

&lt;p&gt;Try running the mysqld_safe from the command line (without using the
init scripts).  Try running &lt;code&gt;/usr/bin/mysqld_safe -v&lt;/code&gt;, which should spit
out some debugging information.&lt;/p&gt;


&lt;p&gt;If that fails, try calling the &lt;code&gt;mysqld&lt;/code&gt; daemon directly from the command
line, with the &amp;quot;-v&amp;quot; option .  &lt;code&gt;mysqld&lt;/code&gt; is usually present under
&lt;code&gt;/usr/sbin/mysqld&lt;/code&gt;.  &lt;code&gt;mysqld&lt;/code&gt; can be called with &lt;code&gt;--print-defaults&lt;/code&gt; to get
the command line options it would be run with.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;
/usr/sbin/mysqld would have been started with the following arguments:
--user=mysql --pid-file=/var/run/mysqld/mysqld.pid .....
--max_binlog_size=100M
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Try adding the &lt;code&gt;-v&lt;/code&gt; option to these options to get more verbose details.
When run from command line, mysqld will not detach from console and
will print debugging info that might be useful in finding the cause of
the error.&lt;/p&gt;


&lt;p&gt;I suggest using 3 terminals to figure out what is going on

&lt;ul&gt;
&lt;li&gt;one terminal with tail -f /var/log/mysql/mysqld.err&lt;/li&gt;
&lt;li&gt;one terminal with tail -f /var/log/messages&lt;/li&gt;
&lt;li&gt;one terminal where I ran the &lt;code&gt;mysqld_safe&lt;/code&gt; / &lt;code&gt;mysqld&lt;/code&gt; command&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;

&lt;p&gt;The init scripts are usually good for day to day work.  However,
sometimes the init scripts can impede a innodb crash recovery process
on a large database.  Some init scripts have timeout built into them
and they can kill mysql while the innodb is still trying to recover
its tables.&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Wed, 08 Jun 2011 07:19:03 +0000</pubDate>
    <guid isPermaLink="false">http://www.rajshekhar.net/blog/archives/407-guid.html</guid>
    <category>geek</category>
<category>geek stuff</category>
<category>mysql</category>

</item>
<item>
    <title>optmizing ORDER BY in MySQL</title>
    <link>http://www.rajshekhar.net/blog/archives/340-optmizing-ORDER-BY-in-MySQL.html</link>
            <category>geek stuff</category>
            <category>mysql</category>
    
    <comments>http://www.rajshekhar.net/blog/archives/340-optmizing-ORDER-BY-in-MySQL.html#comments</comments>
    <wfw:comment>http://www.rajshekhar.net/blog/wfwcomment.php?cid=340</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.rajshekhar.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=340</wfw:commentRss>
    

    <author>nospam@example.com (Raj Shekhar)</author>
    <content:encoded>
    &lt;p&gt;A few days back we were trying to optimize a sql query that was using an &lt;em&gt;ORDER BY&lt;/em&gt; clause.  When we ran an &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/using-explain.html&quot;&gt;EXPLAIN&lt;/a&gt; on the query, we saw that the query was  &lt;em&gt;Using filesort&lt;/em&gt; and &lt;em&gt;Using temporary&lt;/em&gt;.  Since this query was run quite frequently, there was a benefit in optimizing this.&lt;/p&gt;
&lt;p&gt;I had been under the impression that if your query uses filesort and then has to use temp tables for sorting, you cannot do much to save the query.  However, that is not the case. If you have an index on the column being used to do the &lt;em&gt;order by&lt;/em&gt; , mysql will use that &lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/order-by-optimization.html&quot;&gt;index for sorting&lt;/a&gt;.  Of course, there are caveats to this, the most important one being
&lt;blockquote&gt;
&lt;p class=&quot;quoted&quot;&gt;The key used to fetch the rows is not the same as the one used in the ORDER BY:
&lt;code&gt;
SELECT * FROM t1 WHERE key2=constant ORDER BY key1;
&lt;/blockquote&gt;
&lt;/p&gt;
&lt;/code&gt;
&lt;p&gt;Hence, if you have a query which requires to be sorted, and it is being run quite frequently, it makes sense to add an index on the column on which you are doing the sort.&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Tue, 24 Mar 2009 14:36:16 +0000</pubDate>
    <guid isPermaLink="false">http://www.rajshekhar.net/blog/archives/340-guid.html</guid>
    <category>geek stuff</category>
<category>mysql</category>

</item>
<item>
    <title>Replication</title>
    <link>http://www.rajshekhar.net/blog/archives/327-Replication.html</link>
            <category>geek stuff</category>
            <category>mysql</category>
    
    <comments>http://www.rajshekhar.net/blog/archives/327-Replication.html#comments</comments>
    <wfw:comment>http://www.rajshekhar.net/blog/wfwcomment.php?cid=327</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.rajshekhar.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=327</wfw:commentRss>
    

    <author>nospam@example.com (Raj Shekhar)</author>
    <content:encoded>
    &lt;p&gt;Check the slides at scribd,
&lt;a href=&quot;http://www.scribd.com/doc/7116565/Getting-Smart-about-the-New-World-of-PostgreSQL-Replication&quot;&gt;Getting Smart about the New World of PostgreSQL Replication&lt;/a&gt;.  The
first few slides are not specific to PostgreSQL and they define some
common replication jargon very nicely.&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Sun, 26 Oct 2008 06:21:52 +0000</pubDate>
    <guid isPermaLink="false">http://www.rajshekhar.net/blog/archives/327-guid.html</guid>
    <category>geek stuff</category>
<category>mysql</category>

</item>
<item>
    <title>innodb and blobs</title>
    <link>http://www.rajshekhar.net/blog/archives/321-innodb-and-blobs.html</link>
            <category>mysql</category>
    
    <comments>http://www.rajshekhar.net/blog/archives/321-innodb-and-blobs.html#comments</comments>
    <wfw:comment>http://www.rajshekhar.net/blog/wfwcomment.php?cid=321</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.rajshekhar.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=321</wfw:commentRss>
    

    <author>nospam@example.com (Raj Shekhar)</author>
    <content:encoded>
    
&lt;p&gt;Are you planning on storing blobs in Innodb tables?  If yes, think again.  According to the &lt;a href=&quot;http://dev.mysql.com/doc/refman/4.1/en/innodb-restrictions.html&quot;&gt;manual&lt;/a&gt;,
&lt;blockquote&gt;
&lt;p class=&quot;quoted&quot;&gt;InnoDB stores the first 768 bytes of a VARBINARY, VARCHAR, BLOB, or
TEXT column in the row, and the rest into separate pages.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This translates into slower retrieval for blobs.  However, InnoDB can
skip reading blobs if they are not in select column list.&lt;/p&gt;
&lt;p&gt;One solution for this is to keep blobs in a separate myisam table and
do a join when you need the blob column.&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Mon, 29 Sep 2008 17:41:55 +0000</pubDate>
    <guid isPermaLink="false">http://www.rajshekhar.net/blog/archives/321-guid.html</guid>
    <category>mysql</category>

</item>
<item>
    <title>mysql bugs</title>
    <link>http://www.rajshekhar.net/blog/archives/320-mysql-bugs.html</link>
            <category>mysql</category>
    
    <comments>http://www.rajshekhar.net/blog/archives/320-mysql-bugs.html#comments</comments>
    <wfw:comment>http://www.rajshekhar.net/blog/wfwcomment.php?cid=320</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://www.rajshekhar.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=320</wfw:commentRss>
    

    <author>nospam@example.com (Raj Shekhar)</author>
    <content:encoded>
    &lt;p&gt;If you are a heavy user of MySQL, I think you will appreciate this
list of &lt;a href=&quot;http://bugs.mysql.com/search-saved.php&quot;&gt;saved bug searches&lt;/a&gt;.  For example, check out &amp;quot;p1_bugs_in_5.1&amp;quot;
or &amp;quot;ActiveInnoDBBugs&amp;quot; These saved searches are also available as rss
feeds.&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Mon, 29 Sep 2008 17:36:53 +0000</pubDate>
    <guid isPermaLink="false">http://www.rajshekhar.net/blog/archives/320-guid.html</guid>
    <category>mysql</category>

</item>
<item>
    <title>precise explanation of Seconds_Behind_Master value</title>
    <link>http://www.rajshekhar.net/blog/archives/315-precise-explanation-of-Seconds_Behind_Master-value.html</link>
            <category>mysql</category>
    
    <comments>http://www.rajshekhar.net/blog/archives/315-precise-explanation-of-Seconds_Behind_Master-value.html#comments</comments>
    <wfw:comment>http://www.rajshekhar.net/blog/wfwcomment.php?cid=315</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.rajshekhar.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=315</wfw:commentRss>
    

    <author>nospam@example.com (Raj Shekhar)</author>
    <content:encoded>
    &lt;p&gt;Thanks to Artem Russakovskii for this nice explanation of what Seconds_Behind_Master means
&lt;blockquote&gt;
&lt;p class=&quot;quoted&quot;&gt;In order to see if a slave is lagging, execute the &#039;show slave
status&#039; command and look for the Seconds_Behind_Master value. The
way this value is calculated can be slightly ambiguous and unclear,
so I&#039;ll explain. It is simply a difference between the 2 timestamps the time of the last received (and queued up in the relay log)
query that already executed on the master and the time of the
currently executing query on the slave.
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As he says in the post, this value is not a precise indication of the
replication delay.&lt;/p&gt;
&lt;p&gt;Links:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://beerpla.net/2008/09/05/mysql-slave-delay-explained-and-7-ways-to-battle-it/&quot;&gt;MySQL Slave Delay Explained And 7 Ways To Battle It&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://dev.mysql.com/doc/refman/5.0/en/show-slave-status.html&quot;&gt;Other variables in Show Slave Status&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
 
    </content:encoded>

    <pubDate>Thu, 11 Sep 2008 01:51:26 +0000</pubDate>
    <guid isPermaLink="false">http://www.rajshekhar.net/blog/archives/315-guid.html</guid>
    <category>mysql</category>

</item>

</channel>
</rss>
