<?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: Improve the speed and security of your SQL queries</title>
	<atom:link href="http://programmingzen.com/2009/09/09/improve-the-speed-and-security-of-your-sql-queries/feed/" rel="self" type="application/rss+xml" />
	<link>http://programmingzen.com/2009/09/09/improve-the-speed-and-security-of-your-sql-queries/</link>
	<description>Meditations on programming, startups, and technology</description>
	<lastBuildDate>Wed, 01 Feb 2012 10:09:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Ennuyer.net &#187; Blog Archive &#187; Rails Reading - Sept 10, 2009</title>
		<link>http://programmingzen.com/2009/09/09/improve-the-speed-and-security-of-your-sql-queries/#comment-7666</link>
		<dc:creator>Ennuyer.net &#187; Blog Archive &#187; Rails Reading - Sept 10, 2009</dc:creator>
		<pubDate>Thu, 10 Sep 2009 19:36:01 +0000</pubDate>
		<guid isPermaLink="false">http://antoniocangiano.com/?p=1101#comment-7666</guid>
		<description>[...]  Improve the speed and security of your SQL queries &#124; Zen and the Art of Programming  [...]</description>
		<content:encoded><![CDATA[<p>[...]  Improve the speed and security of your SQL queries | Zen and the Art of Programming  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mario Briggs</title>
		<link>http://programmingzen.com/2009/09/09/improve-the-speed-and-security-of-your-sql-queries/#comment-7659</link>
		<dc:creator>Mario Briggs</dc:creator>
		<pubDate>Thu, 10 Sep 2009 08:17:05 +0000</pubDate>
		<guid isPermaLink="false">http://antoniocangiano.com/?p=1101#comment-7659</guid>
		<description>Ankur, 
you are right and wrong at the sametime. Blind faith can lead to problems :-)
e.g.
String street = getStreetFromUser();
Query query = session.createQuery(&quot;from Address a where a.street=&#039;&quot; + street + &quot;&#039;&quot;);

see - http://www.owasp.org/index.php/Interpreter_Injection#ORM_Injection</description>
		<content:encoded><![CDATA[<p>Ankur,<br />
you are right and wrong at the sametime. Blind faith can lead to problems <img src='http://programmingzen.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
e.g.<br />
String street = getStreetFromUser();<br />
Query query = session.createQuery(&#8220;from Address a where a.street=&#8217;&#8221; + street + &#8220;&#8216;&#8221;);</p>
<p>see &#8211; <a href="http://www.owasp.org/index.php/Interpreter_Injection#ORM_Injection" rel="nofollow">http://www.owasp.org/index.php/Interpreter_Injection#ORM_Injection</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ankur Shah</title>
		<link>http://programmingzen.com/2009/09/09/improve-the-speed-and-security-of-your-sql-queries/#comment-7648</link>
		<dc:creator>Ankur Shah</dc:creator>
		<pubDate>Wed, 09 Sep 2009 15:58:54 +0000</pubDate>
		<guid isPermaLink="false">http://antoniocangiano.com/?p=1101#comment-7648</guid>
		<description>I think so hibernate have inbuilt support for parameterized query. So hibernate is less prone to sql injection.</description>
		<content:encoded><![CDATA[<p>I think so hibernate have inbuilt support for parameterized query. So hibernate is less prone to sql injection.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TimothyAWiseman</title>
		<link>http://programmingzen.com/2009/09/09/improve-the-speed-and-security-of-your-sql-queries/#comment-7646</link>
		<dc:creator>TimothyAWiseman</dc:creator>
		<pubDate>Wed, 09 Sep 2009 15:37:06 +0000</pubDate>
		<guid isPermaLink="false">http://antoniocangiano.com/?p=1101#comment-7646</guid>
		<description>Excellent post.  Paramaterizing queries can be enormous beneficial in terms of both speed and security.

The article &quot;The  Curse and Blessing of Dynamic SQL &quot; at http://www.sommarskog.se/dynamic_sql.html
makes this point with examples and details for T-SQL in Microsoft SQL Server.</description>
		<content:encoded><![CDATA[<p>Excellent post.  Paramaterizing queries can be enormous beneficial in terms of both speed and security.</p>
<p>The article &#8220;The  Curse and Blessing of Dynamic SQL &#8221; at <a href="http://www.sommarskog.se/dynamic_sql.html" rel="nofollow">http://www.sommarskog.se/dynamic_sql.html</a><br />
makes this point with examples and details for T-SQL in Microsoft SQL Server.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Woodhouse</title>
		<link>http://programmingzen.com/2009/09/09/improve-the-speed-and-security-of-your-sql-queries/#comment-7640</link>
		<dc:creator>Mike Woodhouse</dc:creator>
		<pubDate>Wed, 09 Sep 2009 08:13:14 +0000</pubDate>
		<guid isPermaLink="false">http://antoniocangiano.com/?p=1101#comment-7640</guid>
		<description>In general, I absolutely agree with the above. Where the RDBMS not only stores the parsed query but the query plan, however, one should probably be aware that queries such as the &quot;BETWEEN&quot; one can have unexpected adverse effects. 

Consider the case where all karma values lie between 1000 and 5000 and further that karma is indexed. A SELECT for karma between 1999 and 2001 will almost certainly use the index, being suitably selective. Looking for all karmas between 1100 and 4900 would probably be best done with a table scan, but would be unexpectedly slower in the case that the query plan was re-used from the first query.

It&#039;s a relatively rare situation but I&#039;m sensitive to it: the scars are still healing after several years ago!</description>
		<content:encoded><![CDATA[<p>In general, I absolutely agree with the above. Where the RDBMS not only stores the parsed query but the query plan, however, one should probably be aware that queries such as the &#8220;BETWEEN&#8221; one can have unexpected adverse effects. </p>
<p>Consider the case where all karma values lie between 1000 and 5000 and further that karma is indexed. A SELECT for karma between 1999 and 2001 will almost certainly use the index, being suitably selective. Looking for all karmas between 1100 and 4900 would probably be best done with a table scan, but would be unexpectedly slower in the case that the query plan was re-used from the first query.</p>
<p>It&#8217;s a relatively rare situation but I&#8217;m sensitive to it: the scars are still healing after several years ago!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

