<?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>Database &#8211; James Lin&#039;s Blog</title>
	<atom:link href="https://james.lin.net.nz/category/technology/database/feed/" rel="self" type="application/rss+xml" />
	<link>https://james.lin.net.nz</link>
	<description>Just bits and pieces of my life</description>
	<lastBuildDate>Fri, 19 Jan 2018 22:42:50 +0000</lastBuildDate>
	<language>en-NZ</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.9.2</generator>
<site xmlns="com-wordpress:feed-additions:1">22801464</site>	<item>
		<title>New technology to crack down on house-flipping</title>
		<link>https://james.lin.net.nz/2017/03/10/new-technology-to-crack-down-on-house-flipping/</link>
		<comments>https://james.lin.net.nz/2017/03/10/new-technology-to-crack-down-on-house-flipping/#respond</comments>
		<pubDate>Thu, 09 Mar 2017 20:44:22 +0000</pubDate>
		<dc:creator><![CDATA[James Lin]]></dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://james.lin.net.nz/?p=3930</guid>
		<description><![CDATA[Just read an article on cracking down house flipping in NZ, it says &#8220;New Zealand&#8217;s real estate watchdog is ramping up its crackdown on house-flipping by investing in new technology which allows it to track when properties have been quickly re-sold for huge profits.&#8221; So what&#8217;s the new technology is about? You would have thought… <span class="read-more"><a href="https://james.lin.net.nz/2017/03/10/new-technology-to-crack-down-on-house-flipping/">Read More &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p>Just read an article on cracking down house flipping in NZ, it says &#8220;New Zealand&#8217;s real estate watchdog is ramping up its crackdown on house-flipping by investing in new technology which allows it to track when properties have been quickly re-sold for huge profits.&#8221;</p>
<p>So what&#8217;s the new technology is about? You would have thought there is a database table with a simple SQL query like this:</p><pre class="crayon-plain-tag">select * from sales_record r1 left join sales_record r2 on r1.title_no = r2.title_no and r1.id &lt; r2.id where datediff(r2.sales_date, r1.sales_date) &lt; 30;</pre><p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://james.lin.net.nz/2017/03/10/new-technology-to-crack-down-on-house-flipping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">3930</post-id>	</item>
		<item>
		<title>Installing Python Mysql Adapter On Mac OSX</title>
		<link>https://james.lin.net.nz/2013/02/12/installing-python-mysql-adapter-on-mac-osx/</link>
		<comments>https://james.lin.net.nz/2013/02/12/installing-python-mysql-adapter-on-mac-osx/#comments</comments>
		<pubDate>Mon, 11 Feb 2013 18:40:42 +0000</pubDate>
		<dc:creator><![CDATA[James Lin]]></dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://james.lin.net.nz/?p=1310</guid>
		<description><![CDATA[First download and install mysql for Mac OSX Install virtualenv, create a virtualenv and activate it Pip install mysql-python, and you will see an error &#8220;EnvironmentError: mysql_config not found&#8221; Find the mysql_config by running &#8220;sudo find / -name &#8216;mysql_config'&#8221; Go to your /path to virtualenv/build/mysql-python Edit site.cfg Uncomment this line &#8220;#mysql_config = /usr/local/bin/mysql_config&#8221; and change… <span class="read-more"><a href="https://james.lin.net.nz/2013/02/12/installing-python-mysql-adapter-on-mac-osx/">Read More &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p><a href="https://i1.wp.com/james.lin.net.nz/wp-content/uploads/2013/02/python-logo.gif"><img class="alignnone size-full wp-image-1316" alt="python-logo" src="https://i1.wp.com/james.lin.net.nz/wp-content/uploads/2013/02/python-logo.gif?resize=211%2C71" data-recalc-dims="1" /></a><img class="alignnone size-full wp-image-1313" alt="logo-mysql-110x57" src="https://i1.wp.com/james.lin.net.nz/wp-content/uploads/2013/02/logo-mysql-110x57.png?resize=110%2C57" data-recalc-dims="1" /></p>
<ol>
<li>First download and install mysql for Mac OSX</li>
<li>Install virtualenv, create a virtualenv and activate it</li>
<li>Pip install mysql-python, and you will see an error &#8220;EnvironmentError: mysql_config not found&#8221;</li>
<li>Find the mysql_config by running &#8220;sudo find / -name &#8216;mysql_config'&#8221;</li>
<li>Go to your /path to virtualenv/build/mysql-python</li>
<li>Edit site.cfg</li>
<li>Uncomment this line &#8220;#mysql_config = /usr/local/bin/mysql_config&#8221; and change the path to what you found in step 4</li>
<li>Then run &#8220;python setup.py install&#8221;</li>
<li>if you get &#8220;Library not loaded: libmysqlclient.18.dylib&#8221; when using the adapter</li>
<li>Then symlink this file: &#8220;sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib&#8221;</li>
</ol>
<p>To control the server:</p><pre class="crayon-plain-tag">sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
sudo /Library/StartupItems/MySQLCOM/MySQLCOM restart</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>https://james.lin.net.nz/2013/02/12/installing-python-mysql-adapter-on-mac-osx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">1310</post-id>	</item>
		<item>
		<title>MySQL locate function</title>
		<link>https://james.lin.net.nz/2012/03/01/mysql-locate-function/</link>
		<comments>https://james.lin.net.nz/2012/03/01/mysql-locate-function/#respond</comments>
		<pubDate>Wed, 29 Feb 2012 20:28:32 +0000</pubDate>
		<dc:creator><![CDATA[James Lin]]></dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://james.lin.net.nz/?p=1010</guid>
		<description><![CDATA[So everyone knows sql LIKE to search wildcard matches the criteria. How about in a situation that you need to return all the rows that has value is part of the criteria string. eg. given a full URL http://www.abc.com/bl/abcdefg/, return all the rows with uri_part field that values are part of the URL string. [crayon-5a659dbd342a8559162100/]… <span class="read-more"><a href="https://james.lin.net.nz/2012/03/01/mysql-locate-function/">Read More &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p>So everyone knows sql LIKE to search wildcard matches the criteria. How about in a situation that you need to return all the rows that has value is part of the criteria string.</p>
<p>eg. given a full URL http://www.abc.com/bl/abcdefg/, return all the rows with uri_part field that values are part of the URL string.</p>
<p></p><pre class="crayon-plain-tag">+------------+
|uri_part    |
+------------+
|/bl/&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;  |
|/bl/abc/    |
|/ba/abc/    |
+------------+</pre><p></p>
<p>Normally LIKE statement works on the other way around, so you need to use LOCATE function. So in this example would be:</p>
<p></p><pre class="crayon-plain-tag">SELECT uri_part FROM table WHERE locate(uri_part, 'http://www.abc.com/bl/abcdefg/');</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>https://james.lin.net.nz/2012/03/01/mysql-locate-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">1010</post-id>	</item>
		<item>
		<title>Hash Reserve Lookup Database Just Hit 5 Million Entries</title>
		<link>https://james.lin.net.nz/2010/12/20/hash-reserve-lookup-database-just-hit-5-million-entries/</link>
		<comments>https://james.lin.net.nz/2010/12/20/hash-reserve-lookup-database-just-hit-5-million-entries/#respond</comments>
		<pubDate>Mon, 20 Dec 2010 02:49:35 +0000</pubDate>
		<dc:creator><![CDATA[James Lin]]></dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://james.limsbros.com/?p=476</guid>
		<description><![CDATA[Late last week, I started a hash reserve lookup service, and today the database has just grown over 5 million entries. By the end of this week I reckon we will 10 million entries, hopefully we can have better search result by then. Fingers crossed!]]></description>
				<content:encoded><![CDATA[<p><a href="https://i0.wp.com/james.limsbros.com/wp-content/uploads/2010/12/James-Reverse-Hash-Lookup-Service11.png"><img class="alignnone size-full wp-image-481" title="James  Reverse Hash Lookup Service1" src="https://i0.wp.com/james.limsbros.com/wp-content/uploads/2010/12/James-Reverse-Hash-Lookup-Service11.png?resize=382%2C144" alt="" srcset="https://i2.wp.com/james.lin.net.nz/wp-content/uploads/2010/12/James-Reverse-Hash-Lookup-Service11.png?w=382&amp;ssl=1 382w, https://i2.wp.com/james.lin.net.nz/wp-content/uploads/2010/12/James-Reverse-Hash-Lookup-Service11.png?resize=300%2C113&amp;ssl=1 300w" sizes="(max-width: 382px) 100vw, 382px" data-recalc-dims="1" /></a></p>
<p>Late last week, I started a<a href="http://hash.limsbros.com/"> hash reserve lookup service</a>, and today the database has just grown over 5 million entries. By the end of this week I reckon we will 10 million entries, hopefully we can have better search result by then. Fingers crossed!</p>
]]></content:encoded>
			<wfw:commentRss>https://james.lin.net.nz/2010/12/20/hash-reserve-lookup-database-just-hit-5-million-entries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">476</post-id>	</item>
		<item>
		<title>MyISAM vs InnoDB decision matrix</title>
		<link>https://james.lin.net.nz/2010/12/19/myisam-vs-innodb-decision-matrix/</link>
		<comments>https://james.lin.net.nz/2010/12/19/myisam-vs-innodb-decision-matrix/#respond</comments>
		<pubDate>Sun, 19 Dec 2010 02:10:01 +0000</pubDate>
		<dc:creator><![CDATA[James Lin]]></dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://james.limsbros.com/?p=473</guid>
		<description><![CDATA[Ever had problem choosing the right MySQL storage engine? Here is a simple matrix for you to make your decision Is your table is going to be inserted, deleted, and updated much much more than it is going to be selected? InnoDB If you need full-text search MyISAM If you prefer/require relational database design InnoDB… <span class="read-more"><a href="https://james.lin.net.nz/2010/12/19/myisam-vs-innodb-decision-matrix/">Read More &#187;</a></span>]]></description>
				<content:encoded><![CDATA[<p>Ever had problem choosing the right MySQL storage engine? Here is a simple matrix for you to make your decision</p>
<table border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td>Is your table is going to be inserted, deleted, and updated much much more than it is going to be selected?</td>
<td><span style="color: #993300;">InnoDB</span></td>
</tr>
<tr>
<td>If you need full-text search</td>
<td><span style="color: #000080;">MyISAM</span></td>
</tr>
<tr>
<td>If you prefer/require relational database design</td>
<td><span style="color: #993300;">InnoDB</span></td>
</tr>
<tr>
<td>Is disk-space or ram an issue?</td>
<td><span style="color: #000080;">MyISAM</span></td>
</tr>
<tr>
<td>In Doubt?</td>
<td><span style="color: #000080;">MyISAM</span></td>
</tr>
</tbody>
</table>
<p>reference: <a href="http://www.mikebernat.com/blog/MySQL_-_InnoDB_vs_MyISAM">http://www.mikebernat.com/blog/MySQL_-_InnoDB_vs_MyISAM</a></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">
<table border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td>Is your table is going to be inserted, deleted, and updated much much more than it is going to be selected?</td>
<td><span style="color: #993300;">InnoDB</span></td>
</tr>
<tr>
<td>If you need full-text search</td>
<td><span style="color: #000080;">MyISAM</span></td>
</tr>
<tr>
<td>If you prefer/require relational database design</td>
<td><span style="color: #993300;">InnoDB</span></td>
</tr>
<tr>
<td>Is disk-space or ram an issue?</td>
<td><span style="color: #000080;">MyISAM</span></td>
</tr>
<tr>
<td>In Doubt?</td>
<td><span style="color: #000080;">MyISAM</span></td>
</tr>
</tbody>
</table>
</div>
]]></content:encoded>
			<wfw:commentRss>https://james.lin.net.nz/2010/12/19/myisam-vs-innodb-decision-matrix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<post-id xmlns="com-wordpress:feed-additions:1">473</post-id>	</item>
	</channel>
</rss>
