<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Selecting all except some columns in MySQL</title>
	<atom:link href="http://www.codediesel.com/mysql/selecting-all-except-some-columns-in-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codediesel.com/mysql/selecting-all-except-some-columns-in-mysql/</link>
	<description>/* PHP &#38; MySQL Journal */</description>
	<lastBuildDate>Fri, 27 Jan 2012 16:39:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Sebastian</title>
		<link>http://www.codediesel.com/mysql/selecting-all-except-some-columns-in-mysql/comment-page-1/#comment-1140</link>
		<dc:creator>Sebastian</dc:creator>
		<pubDate>Sat, 21 Mar 2009 21:32:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.codediesel.com/?p=376#comment-1140</guid>
		<description>I think David&#039;s idea is not bad too... If said before that reducid query load was not your goal (as you are executing an extra query to fetch the table definition).

You could probably do a SELECT * and then unset the unused fields.</description>
		<content:encoded><![CDATA[<p>I think David&#8217;s idea is not bad too&#8230; If said before that reducid query load was not your goal (as you are executing an extra query to fetch the table definition).</p>
<p>You could probably do a SELECT * and then unset the unused fields.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sameer</title>
		<link>http://www.codediesel.com/mysql/selecting-all-except-some-columns-in-mysql/comment-page-1/#comment-1139</link>
		<dc:creator>sameer</dc:creator>
		<pubDate>Fri, 20 Mar 2009 05:30:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.codediesel.com/?p=376#comment-1139</guid>
		<description>Not sure what you really mean. But if you are saying that we should &#039;SELECT&#039; all the columns and then unset the ones we do not want and then display the result; then it destroys the main purpose of the above code. The idea is to not select the columns we want so that we can reduce the query load.</description>
		<content:encoded><![CDATA[<p>Not sure what you really mean. But if you are saying that we should &#8216;SELECT&#8217; all the columns and then unset the ones we do not want and then display the result; then it destroys the main purpose of the above code. The idea is to not select the columns we want so that we can reduce the query load.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.codediesel.com/mysql/selecting-all-except-some-columns-in-mysql/comment-page-1/#comment-1138</link>
		<dc:creator>David</dc:creator>
		<pubDate>Fri, 20 Mar 2009 00:20:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.codediesel.com/?p=376#comment-1138</guid>
		<description>Just found your site - enjoying it quite a bit so far!!

Just curious - if you know which columns you DON&#039;T want, would it make just as much sense to use the columns as keys, unset them, and implode the results?  I haven&#039;t tried and I&#039;m probably just barely NOT a noobie... just figured I&#039;d ask if you can see a reason to use one method over the other.

Great site!
David</description>
		<content:encoded><![CDATA[<p>Just found your site &#8211; enjoying it quite a bit so far!!</p>
<p>Just curious &#8211; if you know which columns you DON&#8217;T want, would it make just as much sense to use the columns as keys, unset them, and implode the results?  I haven&#8217;t tried and I&#8217;m probably just barely NOT a noobie&#8230; just figured I&#8217;d ask if you can see a reason to use one method over the other.</p>
<p>Great site!<br />
David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sameer</title>
		<link>http://www.codediesel.com/mysql/selecting-all-except-some-columns-in-mysql/comment-page-1/#comment-1102</link>
		<dc:creator>sameer</dc:creator>
		<pubDate>Wed, 04 Mar 2009 13:55:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.codediesel.com/?p=376#comment-1102</guid>
		<description>Thanks for all the comments guys! I completely agree with Onno. But it still is a lot easy for me to use the above code while developing a quick prototype php application as I already said in my previous comment.</description>
		<content:encoded><![CDATA[<p>Thanks for all the comments guys! I completely agree with Onno. But it still is a lot easy for me to use the above code while developing a quick prototype php application as I already said in my previous comment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EllisGL</title>
		<link>http://www.codediesel.com/mysql/selecting-all-except-some-columns-in-mysql/comment-page-1/#comment-1101</link>
		<dc:creator>EllisGL</dc:creator>
		<pubDate>Wed, 04 Mar 2009 13:34:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.codediesel.com/?p=376#comment-1101</guid>
		<description>I&#039;m with Onno about the issues with this.</description>
		<content:encoded><![CDATA[<p>I&#8217;m with Onno about the issues with this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Onno Marsman</title>
		<link>http://www.codediesel.com/mysql/selecting-all-except-some-columns-in-mysql/comment-page-1/#comment-1099</link>
		<dc:creator>Onno Marsman</dc:creator>
		<pubDate>Tue, 03 Mar 2009 09:19:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.codediesel.com/?p=376#comment-1099</guid>
		<description>This is a really bad idea. When you would add columns to the table definition they transparently get inserted into a query like this. This way you aren&#039;t tracking which columns are used and which are not. So there&#039;s a big risk that eventually there will be columns that won&#039;t be used. 

About the aggressively caching idea: It&#039;s not a bad idea: I would suggest to manually put the result directly in the query.</description>
		<content:encoded><![CDATA[<p>This is a really bad idea. When you would add columns to the table definition they transparently get inserted into a query like this. This way you aren&#8217;t tracking which columns are used and which are not. So there&#8217;s a big risk that eventually there will be columns that won&#8217;t be used. </p>
<p>About the aggressively caching idea: It&#8217;s not a bad idea: I would suggest to manually put the result directly in the query.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eli White</title>
		<link>http://www.codediesel.com/mysql/selecting-all-except-some-columns-in-mysql/comment-page-1/#comment-1098</link>
		<dc:creator>Eli White</dc:creator>
		<pubDate>Mon, 02 Mar 2009 17:44:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.codediesel.com/?p=376#comment-1098</guid>
		<description>One other thing to point out.  I&#039;ve seen this type of code done in various places (the select to discover column names).   One thing you can do, is cache that data aggressively, since it&#039;s rare your table definitions change.

Which means that you don&#039;t really have the overhead on every query, you do it once and keep it cached forever, and manually flush the cache if you change the table columns.</description>
		<content:encoded><![CDATA[<p>One other thing to point out.  I&#8217;ve seen this type of code done in various places (the select to discover column names).   One thing you can do, is cache that data aggressively, since it&#8217;s rare your table definitions change.</p>
<p>Which means that you don&#8217;t really have the overhead on every query, you do it once and keep it cached forever, and manually flush the cache if you change the table columns.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sameer</title>
		<link>http://www.codediesel.com/mysql/selecting-all-except-some-columns-in-mysql/comment-page-1/#comment-1097</link>
		<dc:creator>sameer</dc:creator>
		<pubDate>Mon, 02 Mar 2009 05:00:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.codediesel.com/?p=376#comment-1097</guid>
		<description>There are many cases when this might be useful. Take a typical example. You are designing a prototype Ajax/PHP application or a Web Service. There are many instances in the application where you have to shuffle data from the server to the client quickly. The extra overhead of a single query on the server is negligible in comparison to the amount of data transfer saved by dropping unrequested columns. It also saves the labor of typing a long list of column names in the SELECT query.</description>
		<content:encoded><![CDATA[<p>There are many cases when this might be useful. Take a typical example. You are designing a prototype Ajax/PHP application or a Web Service. There are many instances in the application where you have to shuffle data from the server to the client quickly. The extra overhead of a single query on the server is negligible in comparison to the amount of data transfer saved by dropping unrequested columns. It also saves the labor of typing a long list of column names in the SELECT query.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jani Hartikainen</title>
		<link>http://www.codediesel.com/mysql/selecting-all-except-some-columns-in-mysql/comment-page-1/#comment-1096</link>
		<dc:creator>Jani Hartikainen</dc:creator>
		<pubDate>Sun, 01 Mar 2009 01:49:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.codediesel.com/?p=376#comment-1096</guid>
		<description>Is there some reason to essentially waste one query for getting the list of columns?</description>
		<content:encoded><![CDATA[<p>Is there some reason to essentially waste one query for getting the list of columns?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

