<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Efficient Boolean value storage for Innodb Tables</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2008/04/23/efficient-boolean-value-storage-for-innodb-tables/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2008/04/23/efficient-boolean-value-storage-for-innodb-tables/</link>
	<description>Everything about MySQL Performance</description>
	<pubDate>Thu, 20 Nov 2008 14:16:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/23/efficient-boolean-value-storage-for-innodb-tables/#comment-351838</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Thu, 04 Sep 2008 17:34:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/23/efficient-boolean-value-storage-for-innodb-tables/#comment-351838</guid>
		<description>Sure you're right. It is very inconvenient for query generation.    The bitmap... sure you get searches more complicated and indexes do not work.   The more friendly way of bitmaps is SET type though it is hard to alter if you need new bits.</description>
		<content:encoded><![CDATA[<p>Sure you&#8217;re right. It is very inconvenient for query generation.    The bitmap&#8230; sure you get searches more complicated and indexes do not work.   The more friendly way of bitmaps is SET type though it is hard to alter if you need new bits.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MSDI</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/23/efficient-boolean-value-storage-for-innodb-tables/#comment-351805</link>
		<dc:creator>MSDI</dc:creator>
		<pubDate>Thu, 04 Sep 2008 15:15:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/23/efficient-boolean-value-storage-for-innodb-tables/#comment-351805</guid>
		<description>I've read your comment about the Char trick.

It's interesting, but I don't someone should use such thing on a server. It renders the code less readable

WHERE
bIsActive = '' //This means true

WHERE
bIsActive IS NULL //This means false


Also, your trick about the bitmask is fine, but inapropriate if you need to search there values

bIsActive = 1;
bIsLocked = 2;
bIsConstipated = 4;

Someone that has the 3 flags on would be represented as 0000111 (7) in the database, but if you want to extract the list of active people, you'll need a table scan.

Fine for some use, but if you need index on them, it has a downside...</description>
		<content:encoded><![CDATA[<p>I&#8217;ve read your comment about the Char trick.</p>
<p>It&#8217;s interesting, but I don&#8217;t someone should use such thing on a server. It renders the code less readable</p>
<p>WHERE<br />
bIsActive = &#8221; //This means true</p>
<p>WHERE<br />
bIsActive IS NULL //This means false</p>
<p>Also, your trick about the bitmask is fine, but inapropriate if you need to search there values</p>
<p>bIsActive = 1;<br />
bIsLocked = 2;<br />
bIsConstipated = 4;</p>
<p>Someone that has the 3 flags on would be represented as 0000111 (7) in the database, but if you want to extract the list of active people, you&#8217;ll need a table scan.</p>
<p>Fine for some use, but if you need index on them, it has a downside&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/23/efficient-boolean-value-storage-for-innodb-tables/#comment-287203</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Thu, 24 Apr 2008 14:51:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/23/efficient-boolean-value-storage-for-innodb-tables/#comment-287203</guid>
		<description>Parvesh,

Sure. If you can pack bits to the bitmask this will be the most efficient as I mention in the end of the article.  Though it does not work in all cases.</description>
		<content:encoded><![CDATA[<p>Parvesh,</p>
<p>Sure. If you can pack bits to the bitmask this will be the most efficient as I mention in the end of the article.  Though it does not work in all cases.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Parvesh</title>
		<link>http://www.mysqlperformanceblog.com/2008/04/23/efficient-boolean-value-storage-for-innodb-tables/#comment-287098</link>
		<dc:creator>Parvesh</dc:creator>
		<pubDate>Thu, 24 Apr 2008 10:07:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/2008/04/23/efficient-boolean-value-storage-for-innodb-tables/#comment-287098</guid>
		<description>I usually prefer having one single column named `flags`, and use all it's bits, one for each boolean. The logic of handling these boolean values can lie either in the program or a mysql function. Size of the column `flags` can be determined based on the number of such boolean value.

I know this go against the readability of the database, but is good enough if the matter comes to storage.

--
Parvesh</description>
		<content:encoded><![CDATA[<p>I usually prefer having one single column named `flags`, and use all it&#8217;s bits, one for each boolean. The logic of handling these boolean values can lie either in the program or a mysql function. Size of the column `flags` can be determined based on the number of such boolean value.</p>
<p>I know this go against the readability of the database, but is good enough if the matter comes to storage.</p>
<p>&#8211;<br />
Parvesh</p>
]]></content:encoded>
	</item>
</channel>
</rss>
