﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss Content Posted by Dinesh Priyankara / Article Discussions / Article Discussions by Author  / Optimizing Your Application - Part 2 / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 09:43:35 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Optimizing Your Application - Part 2</title><link>http://www.sqlservercentral.com/Forums/Topic101634-108-1.aspx</link><description>&lt;P&gt;The Dataset class is designed to cache data.  Why create another structure to hold multiple datasets each with one table, when you can create one dataset with multiple tables?  &lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description><pubDate>Fri, 25 Feb 2005 04:40:00 GMT</pubDate><dc:creator>Malcolm Matthews</dc:creator></item><item><title>RE: Optimizing Your Application - Part 2</title><link>http://www.sqlservercentral.com/Forums/Topic101634-108-1.aspx</link><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;img src='images/emotions/smile.gif' height='20' width='20' border='0' title='Smile' align='absmiddle'&gt;&lt;img src='images/emotions/smile.gif' height='20' width='20' border='0' title='Smile' align='absmiddle'&gt;No doubt you can increase performance of the application by eliminating round-trips and re-querying. I have much experience with this type of application and I have applied this scenario not only with small amount of data but large amount of data. But think twice weather the data should be cached or not because it depend on various things such as application type, data type (how often data is modified) and memory.&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;img src='images/emotions/wow.gif' height='20' width='20' border='0' title='Wow' align='absmiddle'&gt;&lt;img src='images/emotions/wow.gif' height='20' width='20' border='0' title='Wow' align='absmiddle'&gt;Why I used HashTable for this is: it is a dictionary type collection that is optimized for fast retrieval. I do not think that DataSet is really applicable for this operation.&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt; &lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Dinesh&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt; &lt;/P&gt;</description><pubDate>Wed, 25 Feb 2004 21:00:00 GMT</pubDate><dc:creator>Dinesh Priyankara</dc:creator></item><item><title>RE: Optimizing Your Application - Part 2</title><link>http://www.sqlservercentral.com/Forums/Topic101634-108-1.aspx</link><description>&lt;P&gt;I like hashtables (and use them when I need quick 1-1 lookups), but for UI elements or other sequential-access type things, why not just keep the dataset/datatable around as long as you need it?&lt;/P&gt;&lt;P&gt;If you don't need &lt;STRONG&gt;really speedy&lt;/STRONG&gt; data access and the dataset you have is small, you can even do a select/filter on the dataset to narrow the set you have without going back to the database.  OTOH, I found in a set of 10K records that it was much faster to ask the database to query and narrow for me than it was to use the dataset.&lt;/P&gt;&lt;P&gt;-Thor Johnson&lt;/P&gt;</description><pubDate>Wed, 25 Feb 2004 08:04:00 GMT</pubDate><dc:creator>thormj</dc:creator></item><item><title>RE: Optimizing Your Application - Part 2</title><link>http://www.sqlservercentral.com/Forums/Topic101634-108-1.aspx</link><description>&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;FONT face=Arial&gt;&lt;img src='images/emotions/ermm.gif' height='20' width='20' border='0' title='Errmmm...' align='absmiddle'&gt;Bryant, &lt;SPAN style="FONT-FAMILY: Verdana"&gt;&lt;/SPAN&gt;I did not say that I was not concerned with performance! &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Verdana"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;&lt;SPAN style="FONT-FAMILY: Verdana"&gt;I think caching is only useful if you have data that is relatively static. I think that other solutions should be consideration before deciding to cache anything.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;</description><pubDate>Wed, 25 Feb 2004 07:38:00 GMT</pubDate><dc:creator>Code Monkey</dc:creator></item><item><title>RE: Optimizing Your Application - Part 2</title><link>http://www.sqlservercentral.com/Forums/Topic101634-108-1.aspx</link><description>&lt;P&gt;Using a HashTable might not be a good idea. HashTable orders its items by internal hashcode, so if you're expecting items to be in a particular order (e.g. either sorted or in the order that you put them into the collection), you might be in for a nasty surprise.&lt;/P&gt;&lt;P&gt;Why not just use a DataSet instead?&lt;/P&gt;</description><pubDate>Wed, 25 Feb 2004 07:28:00 GMT</pubDate><dc:creator>dmbaker</dc:creator></item><item><title>RE: Optimizing Your Application - Part 2</title><link>http://www.sqlservercentral.com/Forums/Topic101634-108-1.aspx</link><description>&lt;P&gt;&lt;img src='images/emotions/shocked.gif' height='20' width='20' border='0' title='Shocked' align='absmiddle'&gt;&lt;img src='images/emotions/shocked.gif' height='20' width='20' border='0' title='Shocked' align='absmiddle'&gt;&lt;img src='images/emotions/shocked.gif' height='20' width='20' border='0' title='Shocked' align='absmiddle'&gt; You're not concerned with performance? I bet your users are and if they don't get reasonable performance then they can't work with "greater efficiency and ease" can they? &lt;img src='images/emotions/shocked.gif' height='20' width='20' border='0' title='Shocked' align='absmiddle'&gt;&lt;img src='images/emotions/shocked.gif' height='20' width='20' border='0' title='Shocked' align='absmiddle'&gt;&lt;img src='images/emotions/shocked.gif' height='20' width='20' border='0' title='Shocked' align='absmiddle'&gt;&lt;/P&gt;&lt;P&gt;Eliminating server round trips is especially important in stateless environments because new connections often need to be made to the server and this is particularly expensive. If you're using .NET, an easier item to cache though would be a dataset or datatable (Preferably typed).&lt;/P&gt;&lt;P&gt;That said, Keith does make a good point. Caching should not be done unless you actually need to optimize performance. In this economy, throwing hardware at it is not the solution and developers and DBA's need to work &lt;EM&gt;together&lt;/EM&gt; on optimizing DB operations. That is why Microsoft made SQL Server easier to manage than many other DBMS's, so they can spend more time with developers designing databases - &lt;EM&gt;that&lt;/EM&gt;is where the performance benedits come in; up front.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description><pubDate>Wed, 25 Feb 2004 07:06:00 GMT</pubDate><dc:creator>Tatsu</dc:creator></item><item><title>RE: Optimizing Your Application - Part 2</title><link>http://www.sqlservercentral.com/Forums/Topic101634-108-1.aspx</link><description>&lt;P&gt;As an application designer I should not have to concern myself with caching data for the purpose of improving performance.&lt;img src='images/emotions/shocked.gif' height='20' width='20' border='0' title='Shocked' align='absmiddle'&gt;&lt;/P&gt;&lt;P&gt;If caching data I need to write code that determines when the cache needs to be updated.&lt;/P&gt;&lt;P&gt;As an application developer I am more concerned about developing business logic that helps users perform there jobs with greater efficiency and ease.&lt;img src='images/emotions/smile.gif' height='20' width='20' border='0' title='Smile' align='absmiddle'&gt;&lt;/P&gt;&lt;P&gt;Providing good database performance should be the domain of the developers of the DBMS and the database administrators.&lt;/P&gt;</description><pubDate>Wed, 25 Feb 2004 03:15:00 GMT</pubDate><dc:creator>Code Monkey</dc:creator></item><item><title>Optimizing Your Application - Part 2</title><link>http://www.sqlservercentral.com/Forums/Topic101634-108-1.aspx</link><description>Comments posted to this topic are about the content posted at &lt;A HREF=http://www.sqlservercentral.com/columnists/dPriyankara/optimizingyourapplicationpart2.asp&gt;http://www.sqlservercentral.com/columnis</description><pubDate>Sun, 22 Feb 2004 07:20:00 GMT</pubDate><dc:creator>Dinesh Priyankara</dc:creator></item></channel></rss>