<?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>Programmer&#039;s Notes &#187; MySQL</title>
	<atom:link href="http://programmersnotes.info/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://programmersnotes.info</link>
	<description>Notes on the web-development and artificial intelligence.</description>
	<lastBuildDate>Mon, 18 Jul 2011 13:20:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Building high-loaded portal &#8211; InnoDB vs MyISAM</title>
		<link>http://programmersnotes.info/2009/05/20/building-high-loaded-portal-innodb-vs-myisam/</link>
		<comments>http://programmersnotes.info/2009/05/20/building-high-loaded-portal-innodb-vs-myisam/#comments</comments>
		<pubDate>Wed, 20 May 2009 07:00:55 +0000</pubDate>
		<dc:creator>Konstantin Mirin</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[DB Design]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[DB]]></category>
		<category><![CDATA[design pattern]]></category>
		<category><![CDATA[efficiency]]></category>
		<category><![CDATA[production]]></category>

		<guid isPermaLink="false">http://konstantin.takeforce.net/?p=5</guid>
		<description><![CDATA[Post shares practical experience of developing MySQL DB for the high-loaded website.


No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h2><a name="intro">Preface</a></h2>
<p>In November 2008 I&#8217;ve got a nice project, that resulted in a complex search engine, that specializes in clothing. I can&#8217;t give the link now, but will do when site officially launches. Key features of such service are:</p>
<ul>
<li>Large number of users, which search with various parameters, rate items, leave comments, create articles etc.</li>
<li>Large database, that is updated frequently</li>
</ul>
<p>Sure, the site is running on a dedicated server, sure I use caching, but optimal DB is a key to success.</p>
<p><span id="more-5"></span></p>
<h2><a name="myisam-innodb">MyISAM or InnoDB?</a></h2>
<p>Since we need reliability, I created different tests, search the internet etc. My main question was &#8211; what to use MyISAM or InnoDB? I found the <a href="http://www.mysqlperformanceblog.com/2007/01/08/innodb-vs-myisam-vs-falcon-benchmarks-part-1/">post on the MySQL Perfomance Blog</a> (also <a href="http://www.mysqlperformanceblog.com/2007/10/12/myisam-scalability-and-innodb-falcon-benchmarks/">this</a> and <a href="http://www.mysqlperformanceblog.com/2007/01/03/innodb-benchmarks/">this</a>) and came to the conclusion, that when SELECT&#8217;ing, InnoDB is definitely faster (or, at least, is not slower). In addition, it provides constraints mechanism and allows transactions. The only thing it doesn&#8217;t have is FULLTEXT search. One more disadvantage is slower inserts. However, 80% of DB usage in this project are SELECT queries without FULLTEXT. For the fulltext search I created MyISAM table with fields I need and it works fine. The project is finished, but there will be phase 2 and I&#8217;m thinking of introducing <a href="http://www.sphinxsearch.com/">Sphinx</a> there. Anybody has experience with it?<br />
So I came up with InnoDB storage engine.</p>
<h2><a name="structure">Optimizing structure</a></h2>
<p>Next important step is DB structure. I&#8217;ll give some background info about the project so you could better understand what I&#8217;m talking about. The site collects info from different UK shops. Then users can rate them, add some tags, create articles (called &#8220;looks&#8221;) and link that articles to the products they&#8217;re writing about. And the same (tags, comments, rating) applies to the looks. Here we come across with an interesting question. We can create structure of different types for this:</p>
<ul>
<li>Create 2 separate cross-tables for linking Rating to Look or Product</li>
<li>Create one cross-table and add additional field &#8220;type&#8221; there to differentiate between Product and Look entities</li>
</ul>
<p>See both variants in the following images:<br />
<div id="attachment_251" class="wp-caption aligncenter" style="width: 310px"><a href="http://programmersnotes.info/wp-content/uploads/2009/05/norm1.png"><img src="http://programmersnotes.info/wp-content/uploads/2009/05/norm-300x174.png" alt="Normalized variant" title="Normalized variant" width="300" height="174" class="size-medium wp-image-251" /></a><p class="wp-caption-text">Normalized variant</p></div><br />
<div id="attachment_252" class="wp-caption aligncenter" style="width: 310px"><a href="http://programmersnotes.info/wp-content/uploads/2009/05/denorm1.png"><img src="http://programmersnotes.info/wp-content/uploads/2009/05/denorm-300x157.png" alt="Denormalized version" title="Denormalized version" width="300" height="157" class="size-medium wp-image-252" /></a><p class="wp-caption-text">Denormalized version</p></div><br />
Initially I thought that the second variant would perform better, but after creating and running tests, I saw, that:</p>
<ul>
<li>If there are 0-2 ratings linked to entity, then normalized variant is better</li>
<li>If there are 3-5 ratings linked to entity, then denormalized variant is slightly (less than 1%) better</li>
<li>If there are 6-8 ratings linked to the entity, the normalized variant wins again</li>
</ul>
<p>I did these tests for different situations similar to this one, in each test I generated random records and randomly linked them with each other. Number of record in Product, Look tables was 10000, in Rating &#8211; 20000. Number of records in cross tables varies because the linkings are random.<br />
So I came up with normalizing everything like it should be done according to the DB theory.</p>
<p>The only exclusion of this rule is the following situation. In this project you can add different alternatives to the product. Each alternative is &#8220;better&#8221; or &#8220;cheaper&#8221; or &#8220;different&#8221; etc. And since the only case when these alternatives are pulled from DB is when user views the product, they are pulled altogether, so it is better to keep them in the same table.</p>
<h2><a name="conclusion">Conclusion</a></h2>
<ul>
<li>InnoDB turns out to behave better under the high load, it supports transactions and maintains constraints. All that helps to develop better and never leave orphan records.</li>
<li>Using normalization techniques you usually get better performance</li>
<li>Create tests and test everything if you are going to do something great <img src='http://programmersnotes.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<h4>Further reading</h4>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Database_normalization">Database Normalization</a></li>
<li><a href="http://www.mysqlperformanceblog.com/2007/01/08/innodb-vs-myisam-vs-falcon-benchmarks-part-1/">MySQL Performance Blog</a></li>
</ul>
<p>P.S. I&#8217;m looking forward to see your comments on implementation techniques in the high-loaded websites, your thoughts about the InnoDB vs MyISAM question and anything else you can think of <img src='http://programmersnotes.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d5').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Liked the post? Bookmark it</em></strong></a>
<br />
<div class="d5" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F05%2F20%2Fbuilding-high-loaded-portal-innodb-vs-myisam%2F&amp;title=Building+high-loaded+portal+%26%238211%3B+InnoDB+vs+MyISAM" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F05%2F20%2Fbuilding-high-loaded-portal-innodb-vs-myisam%2F&amp;title=Building+high-loaded+portal+%26%238211%3B+InnoDB+vs+MyISAM" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F05%2F20%2Fbuilding-high-loaded-portal-innodb-vs-myisam%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F05%2F20%2Fbuilding-high-loaded-portal-innodb-vs-myisam%2F&amp;title=Building+high-loaded+portal+%26%238211%3B+InnoDB+vs+MyISAM" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F05%2F20%2Fbuilding-high-loaded-portal-innodb-vs-myisam%2F&amp;T=Building+high-loaded+portal+%26%238211%3B+InnoDB+vs+MyISAM" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F05%2F20%2Fbuilding-high-loaded-portal-innodb-vs-myisam%2F&amp;title=Building+high-loaded+portal+%26%238211%3B+InnoDB+vs+MyISAM" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F05%2F20%2Fbuilding-high-loaded-portal-innodb-vs-myisam%2F&amp;title=Building+high-loaded+portal+%26%238211%3B+InnoDB+vs+MyISAM" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F05%2F20%2Fbuilding-high-loaded-portal-innodb-vs-myisam%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Building+high-loaded+portal+%26%238211%3B+InnoDB+vs+MyISAM+@+http%3A%2F%2Fprogrammersnotes.info%2F2009%2F05%2F20%2Fbuilding-high-loaded-portal-innodb-vs-myisam%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F05%2F20%2Fbuilding-high-loaded-portal-innodb-vs-myisam%2F&amp;t=Building+high-loaded+portal+%26%238211%3B+InnoDB+vs+MyISAM" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d5').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d5').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>

<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://programmersnotes.info/2009/05/20/building-high-loaded-portal-innodb-vs-myisam/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>MySQL Workbench &#8211; The Database Modeling Tool for MySQL</title>
		<link>http://programmersnotes.info/2009/03/01/mysql-workbench-the-database-modeling-tool-for-mysql/</link>
		<comments>http://programmersnotes.info/2009/03/01/mysql-workbench-the-database-modeling-tool-for-mysql/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 05:42:13 +0000</pubDate>
		<dc:creator>Konstantin Mirin</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Yii]]></category>
		<category><![CDATA[database design]]></category>
		<category><![CDATA[DB]]></category>
		<category><![CDATA[modelling]]></category>

		<guid isPermaLink="false">http://programmersnotes.info/?p=80</guid>
		<description><![CDATA[MySQL Workbench review based on my own usage experience. Pros and cons of the tool.


No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h2>The history</h2>
<p>In December I&#8217;ve got a project, that required sophisticated and quite complex DB and that DB was subject to change greatly during first development phase. Before that project I was using <a target="_blank" href="http://www.sparxsystems.com.au/">Sparx Enterprise Architect</a> both for application design and DB design. But, frankly speaking, it&#8217;s not good at databases, especially MySQL. So I decided to pick up a new DB modelling tool.<br />
<span id="more-80"></span></p>
<h2>Requirements</h2>
<p>My requirements to it were:</p>
<ul>
<li><strong>Convenient entering</strong> of the attributes and their types. When I have an idea, I want it to be recorded fast, I don&#8217;t want to spend time clicking different &#8220;add&#8221; and &#8220;save&#8221; buttons in order to enter table attributes</li>
<li><strong>Full MySQL features</strong> (including all types of indexes) and main storage engines support (MyISAM, InnoDB, MEMORY)</li>
<li><strong>Visual tables layout</strong> like in MS Access</li>
<li><strong>Maintaining table joins</strong> and involved indexes, visual creation of table connections</li>
<li><strong>SQL export</strong></li>
<li><strong>Free!</strong></li>
</ul>
<h2>On the way to perfection&#8230;</h2>
<p>I went through <a target="_blank" href="http://www.databaseanswers.org/modelling_tools.htm">this list</a> and installed and tried around 10 different tools and I didn&#8217;t like any of them. One has no visual modelling, other has inconvenient input, third has both, but doesn&#8217;t support a number of MySQL features. So finally I ended up with <a target="_blank" href="http://dev.mysql.com/workbench/">MySQL Workbench</a>. It gives me all I need and even more.</p>
<h2>Yes! It&#8217;s really perfect <img src='http://programmersnotes.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </h2>
<p><a target="_blank" href="http://dev.mysql.com/workbench/?page_id=11">Here</a> you may find a list of features together with versions comparison. You can read it yourself and I want to describe why I liked it:</p>
<h3>Nice design</h3>
<p>Yes, it matters. When you use Windows95-like program, you can&#8217;t feel as good as if you&#8217;re using excellent-designed one. Here is a screen:<br />
<div id="attachment_82" class="wp-caption aligncenter" style="width: 310px"><a href="http://programmersnotes.info/wp-content/uploads/2009/02/wb_model_table_editor11.png"><img src="http://programmersnotes.info/wp-content/uploads/2009/02/wb_model_table_editor1-300x238.png" alt="Model Overview" title="Model Overview" width="300" height="238" class="size-medium wp-image-82" /></a><p class="wp-caption-text">Model Overview</p></div></p>
<h3>Creating DB</h3>
<p>I liked their &#8220;schema approach&#8221;. When you create DB, you set the schema default encoding and all the tables in DB are automatically created in this encoding. Sure, you can change it for each table, but this is very helpful. I&#8217;ve also set up mydefault storage engine &#8211; InnoDB (MyISAM is default). This setting can be found in a seconds; everything is in it&#8217;s place (Tools -> Options -> MySQL).<br />
So now I can create my table without remembering that I should change some settings each time I create new table. That&#8217;s my first requirement.</p>
<h3>Creating tables</h3>
<p>I liked their template approach to the generic field names. Near every table has ID field. In my name conventions (since I&#8217;m using Yii framework, I follow their), ID field name is [tableName]ID. So I go to the Tools -> Options -> Model and set there:</p>
<ul>
<li>Primary key pattern &#8211; %table%ID</li>
<li>Primary key default type &#8211; INT(11)</li>
<li>Foreign key defaults (since I&#8217;m using InnoDB, which takes care of data integrity, I set this. I&#8217;ll tell more about this in my future posts about MySQL&#038;InnoDB)</li>
</ul>
<p>Three little settings, but it makes my life much more simple! Actually, you can set up the naming of the auto-generated index fields, but I don&#8217;t use it, I create all tables I need myself. However, Workbench can create cross table for Many-to-Many relation for you.<br />
Now I create the table (collation and engine are set automatically), go to the &#8220;fields&#8221; tab (tabs are in the bottom &#8211; I had problems finding them first time) and have my ID field created. Unfortunately, I can&#8217;t say that I want first letter in lower-case, so I correct it manually. Then start adding fields. It is very simple. First you double click on the empty row where should one name of the field, enter your name, press TAB, enter the field type (I usually enter 1-3 letters and press &#8220;Down&#8221; key, it selects correct type), press TAB again and you&#8217;re on the next field! So you just keep populating your attributes really fast! Then just tick NN (not null) and AI (auto increment) checkboxes and your table scheme is done. All indexes are set up on the next tab &#8211; Indexes except PRIMARY KEY. ID field is PRIMARY KEY by default. To add more fields there, select field and tick PRIMARY KEY checkbox in the right part of the tab.</p>
<h3>Visual layout</h3>
<p>Consider we created tables we need, now we advance to the scheme and connections. Double click &#8220;Add Diagram&#8221; in the top of the screen and you&#8217;re there. In the centre of the right pane you have tables you created. If you drag table from that list to your diagram, you&#8217;ll see big dot near it&#8217;s name. That&#8217;s also very convenient when you have a number of tables. Sure, here you can snap to grid, show/hide it, but that&#8217;s not so impressive.</p>
<h3>Visual grouping</h3>
<p>And this feature is mega-great! When you have huge DB, you can group tables using coloured layers:<br />
<div id="attachment_85" class="wp-caption aligncenter" style="width: 310px"><a href="http://programmersnotes.info/wp-content/uploads/2009/02/wb_diagam_zoomed_out11.png"><img src="http://programmersnotes.info/wp-content/uploads/2009/02/wb_diagam_zoomed_out1-300x239.png" alt="ER Diagram with coloured layers for grouping" title="ER diagram with layers" width="300" height="239" class="size-medium wp-image-85" /></a><p class="wp-caption-text">ER Diagram with coloured layers for grouping</p></div></p>
<h3>Visual connections</h3>
<p>Yes, it allows you to connect tables like you want. 1-1,1-N and N-M relations. If you prefer to create foreign keys automatically, yo can use these types of joins. I prefer to create all tables and fields and then connect it. So I click on the last icon in the left toolbar, select foreign key, then click &#8220;Pick referenced columns&#8221; and finally select the primary key I link to. I&#8217;m done. All InnoDB connections are automatically created.<br />
<div id="attachment_86" class="wp-caption aligncenter" style="width: 310px"><a href="http://programmersnotes.info/wp-content/uploads/2009/02/wb_diagam_fk_pick_columns11.png"><img src="http://programmersnotes.info/wp-content/uploads/2009/02/wb_diagam_fk_pick_columns1-300x239.png" alt="Creating relationship using existing columns" title="Creating relatinship" width="300" height="239" class="size-medium wp-image-86" /></a><p class="wp-caption-text">Creating relationship using existing columns</p></div></p>
<h3>SQL export</h3>
<p>Sure, SQL export is not new or impressive feature, but MySQL Workbench allows you not only to create SQL for the scheme, but also to create ALTER DB script for the CREATE DB script already created. For example, you designed a great DB, exported to SQL query, installed on server and then your client wants changes. You open MySQL Workbench project, make necessary changes and then create ALTER script. Very convenient thing <img src='http://programmersnotes.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Integration with Yii</h2>
<p>One clever guy (<a target="_blank" href="http://blog.orite.com.au/web_development/2009-02-06/mwbmodelcommand-yii-framework-and-mysql-workbench/">unikly</a>) created the Yii shell command, that allows to use mwb file instead of DB connection when creating Yii DB models. This command is available on the Yii <a target="_blank" href="http://www.yiiframework.com/extension/mwbmodelcommand/">extensions page</a>. As for me, it&#8217;s a very big plus.</p>
<h2>A fly in the ointment</h2>
<p>I&#8217;ve noticed several bad things in this software:</p>
<ul>
<li>When DB becomes huge, you need a good machine to work with it comfortably. It takes too much resources</li>
<li>Some interface elements are not evident (In the DB overview screen lowest part has tabs both on the top and on the bottom. Top tabs &#8211; switch between tables, bottom tabs &#8211; switch between table&#8217;s sections (properties, fields, indexes)</li>
<li>When creating joins, it doesn&#8217;t maintain the uniqueness of foreign indexes names. Take a close look at the export script (and watch for constraints and auto-created foreign keys) when it fails in phpMyAdmin (or other tool)</li>
</ul>
<p>
<strong>Disclaimer:</strong> Screenshots are taken from <a target="_blank" href="http://dev.mysql.com/workbench/?page_id=35">MySQL Workbench</a> site, I was lazy to take my own ones.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d80').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Liked the post? Bookmark it</em></strong></a>
<br />
<div class="d80" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F03%2F01%2Fmysql-workbench-the-database-modeling-tool-for-mysql%2F&amp;title=MySQL+Workbench+%26%238211%3B+The+Database+Modeling+Tool+for+MySQL" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F03%2F01%2Fmysql-workbench-the-database-modeling-tool-for-mysql%2F&amp;title=MySQL+Workbench+%26%238211%3B+The+Database+Modeling+Tool+for+MySQL" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F03%2F01%2Fmysql-workbench-the-database-modeling-tool-for-mysql%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F03%2F01%2Fmysql-workbench-the-database-modeling-tool-for-mysql%2F&amp;title=MySQL+Workbench+%26%238211%3B+The+Database+Modeling+Tool+for+MySQL" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F03%2F01%2Fmysql-workbench-the-database-modeling-tool-for-mysql%2F&amp;T=MySQL+Workbench+%26%238211%3B+The+Database+Modeling+Tool+for+MySQL" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F03%2F01%2Fmysql-workbench-the-database-modeling-tool-for-mysql%2F&amp;title=MySQL+Workbench+%26%238211%3B+The+Database+Modeling+Tool+for+MySQL" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F03%2F01%2Fmysql-workbench-the-database-modeling-tool-for-mysql%2F&amp;title=MySQL+Workbench+%26%238211%3B+The+Database+Modeling+Tool+for+MySQL" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F03%2F01%2Fmysql-workbench-the-database-modeling-tool-for-mysql%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+MySQL+Workbench+%26%238211%3B+The+Database+Modeling+Tool+for+MySQL+@+http%3A%2F%2Fprogrammersnotes.info%2F2009%2F03%2F01%2Fmysql-workbench-the-database-modeling-tool-for-mysql%2F" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fprogrammersnotes.info%2F2009%2F03%2F01%2Fmysql-workbench-the-database-modeling-tool-for-mysql%2F&amp;t=MySQL+Workbench+%26%238211%3B+The+Database+Modeling+Tool+for+MySQL" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://programmersnotes.info/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d80').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d80').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>

<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://programmersnotes.info/2009/03/01/mysql-workbench-the-database-modeling-tool-for-mysql/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

