<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP Trivandrum &#187; mysql</title>
	<atom:link href="http://www.php-trivandrum.org/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.php-trivandrum.org</link>
	<description>Get addicted to PHP</description>
	<lastBuildDate>Tue, 22 Jun 2010 02:56:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MySQL: Optimize all tables; Run using cron</title>
		<link>http://www.php-trivandrum.org/mysql/mysql-optimize-all-tables-run-using-cron/</link>
		<comments>http://www.php-trivandrum.org/mysql/mysql-optimize-all-tables-run-using-cron/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 17:31:17 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[Linux Shell]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[cron]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/?p=1040</guid>
		<description><![CDATA[I was looking for a optimize table script and finally stumbled upon some code which could be salvaged into a shell script. The full code is reproduced here for future reference.

#!/bin/bash&#160;
#-- I usually add the root username and password to the ~/.my.cnf
MYSQL_CMD='/usr/bin/mysql ' &#160;
$MYSQL_CMD -e "SELECT concat('OPTIMIZE TABLE ',TABLE_SCHEMA,'.',TABLE_NAME,';') as cmd FROM information_schema.TABLES WHERE TABLE_SCHEMA [...]]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/mysql/mysql-optimize-all-tables-run-using-cron/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Bash to take incremental backups on MySQL database</title>
		<link>http://www.php-trivandrum.org/general-articles/using-bash-to-take-incremental-backups-on-mysql-database/</link>
		<comments>http://www.php-trivandrum.org/general-articles/using-bash-to-take-incremental-backups-on-mysql-database/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 16:43:22 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[General Articles]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/?p=1015</guid>
		<description><![CDATA[The backup plan was to have a full backup of data and structure every Sunday and then difference of the database from last sunday to every other day, rotate the backups every fourth week.]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/general-articles/using-bash-to-take-incremental-backups-on-mysql-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting datetime type into JavaScript as Date object</title>
		<link>http://www.php-trivandrum.org/javascript/getting-datetime-type-into-javascript-as-date-object/</link>
		<comments>http://www.php-trivandrum.org/javascript/getting-datetime-type-into-javascript-as-date-object/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 02:49:58 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[MSSQL]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/?p=1010</guid>
		<description><![CDATA[When selecting datetime to be displayed in a JavaScript ui library, select the unix_timestamp * 1000 from the sql]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/javascript/getting-datetime-type-into-javascript-as-date-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Session TimeZones and DateTime fields</title>
		<link>http://www.php-trivandrum.org/general-articles/session-timezones-and-datetime-fields/</link>
		<comments>http://www.php-trivandrum.org/general-articles/session-timezones-and-datetime-fields/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 18:20:36 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[General Articles]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[MSSQL]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/?p=1007</guid>
		<description><![CDATA[I was pondering over how to coax mysql (and mssql) to automagically select local time if a session variable was set with the required timezone]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/general-articles/session-timezones-and-datetime-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migration from MySQL to MSSQL &#8211; Quick Tip</title>
		<link>http://www.php-trivandrum.org/tips/migration-from-mysql-to-mssql-quick-tip/</link>
		<comments>http://www.php-trivandrum.org/tips/migration-from-mysql-to-mssql-quick-tip/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 02:25:26 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[MSSQL]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/tips/migration-from-mysql-to-mssql-quick-tip/</guid>
		<description><![CDATA[With the help of some colleagues, I could export all the indexes and primary keys, which we were using from a MySQL table as MSSQL compatiable TSQL using a union query and on the MySQL <i>information_schema</i>.
]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/tips/migration-from-mysql-to-mssql-quick-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL vs MsSQL &#8211; comparisons never end</title>
		<link>http://www.php-trivandrum.org/general-articles/mysql-vs-mssql-comparisons-never-end/</link>
		<comments>http://www.php-trivandrum.org/general-articles/mysql-vs-mssql-comparisons-never-end/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 17:52:21 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[General Articles]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[MSSQL]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/code-snippets/mysql-vs-mssql-comparisons-never-end/</guid>
		<description><![CDATA[Search for the title, and you will land in several sites, which will tell you the views of the author. In fact there may be hell lot of people who would tell you that one out performs the other. But in reality what does that mean ?. If one knows how to optimize the database [...]]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/general-articles/mysql-vs-mssql-comparisons-never-end/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Migration from MySQL to MSSQL our solutions &#8211; Continued</title>
		<link>http://www.php-trivandrum.org/code-snippets/migration-from-mysql-to-mssql-our-solutions-continued/</link>
		<comments>http://www.php-trivandrum.org/code-snippets/migration-from-mysql-to-mssql-our-solutions-continued/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 18:45:15 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[General Articles]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[MSSQL]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/?p=967</guid>
		<description><![CDATA[In the previous post, I had specified that a code analysis would be presented later on, which is happening now. Though I am not permitted to abstract the whole database abstraction, which would otherwise divulge the core business logic of the system too, I do expect that the following would be enough to guide a [...]]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/code-snippets/migration-from-mysql-to-mssql-our-solutions-continued/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Migration from MySQL to MSSQL our solutions</title>
		<link>http://www.php-trivandrum.org/general-articles/migration-from-mysql-to-mssql-our-solutions/</link>
		<comments>http://www.php-trivandrum.org/general-articles/migration-from-mysql-to-mssql-our-solutions/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 03:17:15 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[General Articles]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[MSSQL]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/general-articles/migration-from-mysql-to-mssql-our-solutions/</guid>
		<description><![CDATA[Last post I did had all of my feelings, and despair, and now I am sure those were out of sheer negligence and mostly because I was unaware of the MS SQL product. Though I still do not agree with certain things like the row_count workaround for the limit feature, and escaping of quotes. But [...]]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/general-articles/migration-from-mysql-to-mssql-our-solutions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Binary tree in MySQL for MLM</title>
		<link>http://www.php-trivandrum.org/code-snippets/binary-tree-in-mysql-for-mlm/</link>
		<comments>http://www.php-trivandrum.org/code-snippets/binary-tree-in-mysql-for-mlm/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 20:28:22 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[MLM database design]]></category>
		<category><![CDATA[mlm tree]]></category>
		<category><![CDATA[mysql tree design]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/?p=897</guid>
		<description><![CDATA[Recently for a student, I was asked to explain the design considerations of a Binary Tree which was to be used in an MLM solution. About 10 years back it was a nightmare, and in my career, I was lucky to get that privilage for more than a dozen times with varying schemes and structures. [...]]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/code-snippets/binary-tree-in-mysql-for-mlm/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Invoke shell from MySQL trigger</title>
		<link>http://www.php-trivandrum.org/code-snippets/invoke-shell-from-mysql-trigger/</link>
		<comments>http://www.php-trivandrum.org/code-snippets/invoke-shell-from-mysql-trigger/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 14:47:04 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql trigger shell]]></category>
		<category><![CDATA[php snippets]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/?p=479</guid>
		<description><![CDATA[No I am not insane, and after a long days search over the wide Internet, even google admitted defeat, there seemed to be no way to do this. Finally I had already dropped the idea or even let off the thing altogether. But recently for another project I needed to check in for an entirely [...]]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/code-snippets/invoke-shell-from-mysql-trigger/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>MySQL Query Profiler; Better late than never</title>
		<link>http://www.php-trivandrum.org/general-articles/mysql-query-profiler-better-late-than-never/</link>
		<comments>http://www.php-trivandrum.org/general-articles/mysql-query-profiler-better-late-than-never/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 13:32:34 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[General Articles]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/?p=135</guid>
		<description><![CDATA[One of the great things about MySQL is the superior innovation model that’s used to deliver database server software. Rather than relying solely on internal engineers who create and maintain a piece of software (as in a traditional software company), MySQL partners with the millions of active users across the world who take advantage of [...]]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/general-articles/mysql-query-profiler-better-late-than-never/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpbb MySQL queries; need optimizations</title>
		<link>http://www.php-trivandrum.org/mysql/phpbb-mysql-queries-need-optimizations/</link>
		<comments>http://www.php-trivandrum.org/mysql/phpbb-mysql-queries-need-optimizations/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 04:28:48 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/?p=120</guid>
		<description><![CDATA[This one really hit me, but none would be much worried about these small things.

explain SELECT ban_ip, ban_userid, ban_email  FROM phpbb_banlist WHERE ban_ip IN ('5bcd7c03', '5bcd7cff', '5bcdffff', '5bffffff') OR ban_userid = -1;
+----+-------------+---------------+------+----------------+------+---------+------+------+-------------+
&#124; id &#124; select_type &#124; table         &#124; type &#124; possible_keys  &#124; key  &#124; [...]]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/mysql/phpbb-mysql-queries-need-optimizations/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Tunning Mysql; Rephrase queries Continued</title>
		<link>http://www.php-trivandrum.org/mysql/tunning-mysql-rephrase-queries-continued/</link>
		<comments>http://www.php-trivandrum.org/mysql/tunning-mysql-rephrase-queries-continued/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 04:09:52 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/?p=118</guid>
		<description><![CDATA[Hey, as of late, I had the opportunity to check the optimization for a heavily loaded phpbb system. It also shows lac of sql optimization in the code. 

SELECT DISTINCT t.topic_id, t.topic_title, t.topic_poster, t.topic_first_post_id, t.forum_id, t.topic_replies, u.user_id, u.username, s.post_id, s.post_text
FROM phpbb_posts p, phpbb_topics t, phpbb_users u, phpbb_posts_text s
WHERE p.topic_id = t.topic_id AND t.topic_poster = u.user_id [...]]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/mysql/tunning-mysql-rephrase-queries-continued/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tunning Mysql; Rephrase queries</title>
		<link>http://www.php-trivandrum.org/mysql/tunning-mysql-rephrase-queries/</link>
		<comments>http://www.php-trivandrum.org/mysql/tunning-mysql-rephrase-queries/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 03:10:00 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/?p=111</guid>
		<description><![CDATA[The following is an excerpt from mysql slow log on a server which I was assigned to do MySQL tunning and optimizing. The following log was after the proper indexes were applied. Each query was taking about .9 seconds (query time is 0, because slow-query-time in mysql settings was 1, and that means logs will [...]]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/mysql/tunning-mysql-rephrase-queries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Consider Query Cache performance when designing tables</title>
		<link>http://www.php-trivandrum.org/mysql/consider-query-cache-performance-when-designing-tables/</link>
		<comments>http://www.php-trivandrum.org/mysql/consider-query-cache-performance-when-designing-tables/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 03:05:20 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/?p=109</guid>
		<description><![CDATA[I have seen many web applications with poor database design. As of recent to increase performance, every body is utilizing some sort of caching. The primary one being query cache inside database server itself. Most of the developers are not aware of this, and do not make use of this. For example lets consider an [...]]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/mysql/consider-query-cache-performance-when-designing-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Responsible use of Indexes</title>
		<link>http://www.php-trivandrum.org/mysql/responsible-use-of-indexes/</link>
		<comments>http://www.php-trivandrum.org/mysql/responsible-use-of-indexes/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 05:00:51 +0000</pubDate>
		<dc:creator>ericj</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/mysql/responsible-use-of-indexes.html</guid>
		<description><![CDATA[At several stages, I have been asked to benchmark web applications. I always tend to do the light weight stuff at the start, and when it gets into my mind, that the system which is being tested is working some what like it is expected, I steer my course and go for bigger feats. For [...]]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/mysql/responsible-use-of-indexes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Foreign Keys in MySQL</title>
		<link>http://www.php-trivandrum.org/tips/using-foreign-keys-in-mysql/</link>
		<comments>http://www.php-trivandrum.org/tips/using-foreign-keys-in-mysql/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 05:17:26 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/tips/using-foreign-keys-in-mysql.html</guid>
		<description><![CDATA[On the article at php&#124;architect, Ligaya Turmelle explains you how to handle Foreign Keys in MySQL so they can serve your whims.
No, foreign keys aren&#8217;t from Brazil or Italy or even the US. Though they can be a bit strange to those who do not understand them, have no fear. We are here to teach [...]]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/tips/using-foreign-keys-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Backups and a lot more</title>
		<link>http://www.php-trivandrum.org/general-articles/mysql-backups-and-a-lot-more/</link>
		<comments>http://www.php-trivandrum.org/general-articles/mysql-backups-and-a-lot-more/#comments</comments>
		<pubDate>Wed, 19 Sep 2007 19:11:52 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[General Articles]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/general-articles/mysql-backups-and-a-lot-more.html</guid>
		<description><![CDATA[A couple of years back, I had asked several people through groups, and posts the possibility of backing up a MySQL database programatically, from client side applications which could connect to remote servers running MySQL. There was a lot of suggestions, 
* php script on server to take backup on server
* application code to select [...]]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/general-articles/mysql-backups-and-a-lot-more/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimizing Indexes</title>
		<link>http://www.php-trivandrum.org/mysql/optimizing-indexes/</link>
		<comments>http://www.php-trivandrum.org/mysql/optimizing-indexes/#comments</comments>
		<pubDate>Thu, 03 May 2007 03:23:10 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/mysql/optimizing-indexes.html</guid>
		<description><![CDATA[Designing a database as part of a big project, will need a lot of experience.  There are several factors which should be considered before finalizing a database schema. Since once the project starts rollout, there is no going back, other than adding a new index, or adding another field, any major change will affect [...]]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/mysql/optimizing-indexes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculations ? Try and use SQL</title>
		<link>http://www.php-trivandrum.org/php/calculations-try-and-use-sql/</link>
		<comments>http://www.php-trivandrum.org/php/calculations-try-and-use-sql/#comments</comments>
		<pubDate>Wed, 02 May 2007 01:36:01 +0000</pubDate>
		<dc:creator>jijutm</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.php-trivandrum.org/php/calculations-try-and-use-sql.html</guid>
		<description><![CDATA[Hmm.. yes.. I literally meant it.. for several things you can directly use SQL calculations, though the queries and functions shown here are tested only with mysql, it should work with most other sql servers too. The cliche is if you have the sql server on the same server where your webserver and php interpreter [...]]]></description>
		<wfw:commentRss>http://www.php-trivandrum.org/php/calculations-try-and-use-sql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
