<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/css" href="http://www.flexsolutions.com.br/Data/style/rss1.css" ?> <?xml-stylesheet type="text/xsl" href="http://www.flexsolutions.com.br/Data/xsl/rss1.xsl" ?>
<!--RSS generated by mojoPortal Blog Module V 1.0 on Friday, September 10, 2010-->
<rss version="2.0">
  <channel>
    <title>Blog Flexsolutions Consultores Ltda.</title>
    <link>http://www.flexsolutions.com.br/blog.aspx</link>
    <description>Flexsolutions Consultores Ltda</description>
    <copyright>Copyright 2006 Juliano Morais Barbosa</copyright>
    <ttl>120</ttl>
    <managingEditor>julianomb@nospamgmail.com</managingEditor>
    <generator>mojoPortal Blog Module V 1.0</generator>
    <item>
      <title>&amp;Aacute;lcool ou gasolina?:Especial - Economia - Setores - Estad&amp;atilde;o.com.br</title>
      <link>http://www.flexsolutions.com.br/aacutelcool-ou-gasolinaespecial-economia-setores-estadatildeocombr.aspx</link>
      <pubDate>Fri, 29 Jan 2010 15:07:21 GMT</pubDate>
      <guid>http://www.flexsolutions.com.br/aacutelcool-ou-gasolinaespecial-economia-setores-estadatildeocombr.aspx</guid>
      <author>Admin</author>
      <comments>http://www.flexsolutions.com.br/aacutelcool-ou-gasolinaespecial-economia-setores-estadatildeocombr.aspx</comments>
      <description><![CDATA[<p>&nbsp;</p> <p><a href="http://www.estadao.com.br/especiais/alcool-ou-gasolina,539.htm">Álcool ou gasolina?:Especial - Economia - Setores - Estadão.com.br</a></p><br /><a href='http://www.flexsolutions.com.br'>Admin</a>&nbsp;&nbsp;<a href='http://www.flexsolutions.com.br/aacutelcool-ou-gasolinaespecial-economia-setores-estadatildeocombr.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>JP dotNet: Split e join de strings em T-SQL</title>
      <link>http://www.flexsolutions.com.br/jp-dotnet-split-e-join-de-strings-em-t-sql.aspx</link>
      <pubDate>Wed, 25 Nov 2009 16:21:18 GMT</pubDate>
      <guid>http://www.flexsolutions.com.br/jp-dotnet-split-e-join-de-strings-em-t-sql.aspx</guid>
      <author>Admin</author>
      <comments>http://www.flexsolutions.com.br/jp-dotnet-split-e-join-de-strings-em-t-sql.aspx</comments>
      <description><![CDATA[<p>&nbsp;</p> <blockquote> <h5><a href="http://jpdotnet.blogspot.com/2009/05/split-e-join-de-strings-em-t-sql.html">Split e join de strings em T-SQL</a></h5> <p>Olá,<br>Um das maiores necessidades dos desenvolvedores que trabalham com T-SQL é o de passar uma string com separadores como parâmetro em uma stored procedure, por exemplo, e usá-la como argumento em uma cláusula where como um conjunto, utilizando a palavra reservada IN.<br>A necessidade inversa também é importante, ou seja, concatenar o resultado de um campo de uma select em uma string separada por um determinado delimitador.<br>Estas tarefas, tão comuns em qualquer linguagem de programação, são também conhecidas como split e join.<br>Para executá-las em T-SQL, existem várias maneiras e muitos já postaram milhares de modos, no entanto, segue minha contribuição que creio ser uma das mais simples e eficientes pois usa dos recursos de XML do T-SQL para seu fim.<br>Para fazer o split:<br>DELCARE @string VARCHAR(200)<br>SET @string = '124, 456, 789, 121212, 3256 '<br>DECLARE @xmlAuxiliar XML<br>SET @xmlAuxiliar = '<i>' + REPLACE(@string, ',', '</i><i>') + '</i>'<br>SELECT x.i.value('.', 'INT') FROM @xmlAuxiliar.nodes('//i') x(i)<br>Observação: pode-se substituir o INT da última instrução por outro tipo, como VARCHAR. Neste caso a lista seria algo como 'João, Pedro, Marcos, Lucas'<br>Para fazer o join:<br>SELECT NomeDoCampo + ', '<br>FROM NomeDaTabela<br>FOR XML PATH('')<br>Observação: seu separador pode ser outro que não ', '. Caso o retorno do campo não seja um tipo caractere, é necessário converter.<br>Abraços e até a próxima.</p></blockquote> <p><a href="http://jpdotnet.blogspot.com/2009/05/split-e-join-de-strings-em-t-sql.html">JP dotNet: Split e join de strings em T-SQL</a></p><br /><a href='http://www.flexsolutions.com.br'>Admin</a>&nbsp;&nbsp;<a href='http://www.flexsolutions.com.br/jp-dotnet-split-e-join-de-strings-em-t-sql.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>FTP MySQL and Webserver System Backup script</title>
      <link>http://www.flexsolutions.com.br/ftp-mysql-and-webserver-system-backup-script.aspx</link>
      <pubDate>Wed, 25 Nov 2009 10:04:52 GMT</pubDate>
      <guid>http://www.flexsolutions.com.br/ftp-mysql-and-webserver-system-backup-script.aspx</guid>
      <author>Admin</author>
      <comments>http://www.flexsolutions.com.br/ftp-mysql-and-webserver-system-backup-script.aspx</comments>
      <description><![CDATA[<p>&#160;</p>  <blockquote>Use following form to generate backup ftp script :)</blockquote>  <p><a href="http://bash.cyberciti.biz/backup/wizard-ftp-script.php">FTP MySQL and Webserver System Backup script</a></p><br /><a href='http://www.flexsolutions.com.br'>Admin</a>&nbsp;&nbsp;<a href='http://www.flexsolutions.com.br/ftp-mysql-and-webserver-system-backup-script.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>FTP MySQL and Webserver System Backup script</title>
      <link>http://www.flexsolutions.com.br/ftp-mysql-and-webserver-system-backup-script.aspx</link>
      <pubDate>Wed, 25 Nov 2009 10:04:33 GMT</pubDate>
      <guid>http://www.flexsolutions.com.br/ftp-mysql-and-webserver-system-backup-script.aspx</guid>
      <author>Admin</author>
      <comments>http://www.flexsolutions.com.br/ftp-mysql-and-webserver-system-backup-script.aspx</comments>
      <description><![CDATA[<p>&#160;</p>  <blockquote>Use following form to generate backup ftp script :)</blockquote>  <p><a href="http://bash.cyberciti.biz/backup/wizard-ftp-script.php">FTP MySQL and Webserver System Backup script</a></p><br /><a href='http://www.flexsolutions.com.br'>Admin</a>&nbsp;&nbsp;<a href='http://www.flexsolutions.com.br/ftp-mysql-and-webserver-system-backup-script.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>SQL Compact: Sim, a performance conta muito </title>
      <link>http://www.flexsolutions.com.br/sql-compact-sim-a-performance-conta-muito-.aspx</link>
      <pubDate>Tue, 17 Nov 2009 17:44:07 GMT</pubDate>
      <guid>http://www.flexsolutions.com.br/sql-compact-sim-a-performance-conta-muito-.aspx</guid>
      <author>Admin</author>
      <comments>http://www.flexsolutions.com.br/sql-compact-sim-a-performance-conta-muito-.aspx</comments>
      <description><![CDATA[<h5>SQL Compact: Sim, a performance conta muito</h5>
<p>H&aacute; tempos foi reportado que num dos nossos clientes da nossa solu&ccedil;&atilde;o de pr&eacute;/auto-venda, o carregamento de uma lista com 60 a 70 registos demorava mais de 5 minutos, enquanto noutros clientes, com o mesmo volume de informa&ccedil;&atilde;o n&atilde;o demorava mais de uns breves segundos. A opera&ccedil;&atilde;o em causa dependia de uma consulta &agrave; base de dados no PDA que continha m&uacute;ltiplos JOIN, sobre um comando preparado, e a diferen&ccedil;a entre clientes tamb&eacute;m poderia estar relacionada com os equipamentos utilizados, pois a tal opera&ccedil;&atilde;o de &lsquo;5 minutos&rsquo; com a mesma base de dados demorava &lsquo;apenas&rsquo; 40 segundos no meu emulador.</p>
<p>Para fazer o tunning &agrave; instru&ccedil;&atilde;o, abri o SQL Server Management Studio, e estudei o Execution Plan da mesma, o que me foi dando ideias para &iacute;ndices a criar, mas sem que tal tivesse um impacto significativo em termos de performance. A&iacute; vi que tinha que mudar a instru&ccedil;&atilde;o e comecei a pensar como faz&ecirc;-lo, pois era importante obter a informa&ccedil;&atilde;o das tais tabelas ligadas de uma s&oacute; vez, mas identifiquei uma tabela de lookup, e tirei-a da instru&ccedil;&atilde;o SQL, menos um JOIN portanto, e automaticamente o comando passou a ser executado quase instantaneamente. Como a tal tabela era importante, decidi pr&eacute;-carreg&aacute;-la numa colec&ccedil;&atilde;o do tipo key, value, e a cada registo consultava essa colec&ccedil;&atilde;o para recuperar o valor que necessitava.</p>
<p>Tudo embalado de novo (altera&ccedil;&atilde;o ao comando, carregamento da lista e novos &iacute;ndexes), no PDA do cliente a tal opera&ccedil;&atilde;o que demorava mais de 5 minutos passou a ser executada em entre 1 e 2 segundos!</p>
<p>Hoje dei com <a href="http://social.msdn.microsoft.com/Forums/en-US/sqlce/thread/6b7274ce-0fbe-40a4-af22-ad3fad9eee96" target="_blank">esta p&eacute;rola</a> no f&oacute;rum da MSDN <a href="http://social.msdn.microsoft.com/Forums/en-US/sqlce/threads" target="_blank">dedicado ao SQL Compact</a>, um tipo que tinha uma instru&ccedil;&atilde;o t&atilde;o simples como:</p>
<p><span style="font-family: Courier New;">SELECT TOP(1) SysDate FROM Violator ORDER BY SysDate Desc</span></p>
<p>em que a tabela em causa tinha um index criado para a coluna em causa com ordem descendente. Ao executar a instru&ccedil;&atilde;o no emulador demorava cerca de 35 segundos, o que para ele era inaceit&aacute;vel, e ao analisar o Execution Plan do comando no SQL Server Management Studio, conclu&iacute;u que o SQL Compact estava a fazer um INDEX SCAN em vez de um INDEX SEEK, que se esperaria que fosse mais performante. O <a href="http://erikej.blogspot.com/" target="_blank">EricEJ</a>, um MVP de SQL Server Compact, sugeriu-lhe uma pequena modifica&ccedil;&atilde;o &agrave; instru&ccedil;&atilde;o, acrescentando-lhe um WHERE in&oacute;cuo&hellip;</p>
<p><span style="font-family: Courier New;">SELECT TOP(1) SysDate FROM Violator <strong>WHERE SysDate &lt; GETDATE() </strong>ORDER BY SysDate Desc</span></p>
<p>&hellip; e automaticamente o comando passou a ser executado de forma muito mais r&aacute;pida no emulador!</p>
<p><strong>Conclus&atilde;o</strong></p>
<p>O Query Processor (QP) do SQL Compact tem o seu qu&ecirc; de feminino, &eacute; dif&iacute;cil compreender as suas decis&otilde;es, e mesmo quando achamos que o conhecemos bem, l&aacute; aparece uma situa&ccedil;&atilde;o nova a mostrar-nos o contr&aacute;rio, e temos de usar de truques para o convencer a fazer o que queremos :)</p>
<div><span>Published</span> Fri, Sep 11 2009 18:29 by <a href="http://www.flexsolutions.com.br/members/AlbertoSilva/default.aspx">Alberto Silva</a>
<div><span id="ctl00_Main_ctl08_ctl01">Filed under: <a rel="tag" href="http://msmvps.com/blogs/albertosilva/archive/tags/Desenvolvimento+_2800_.net+CF_2900_/default.aspx">Desenvolvimento (.net CF)</a>, <a rel="tag" href="http://msmvps.com/blogs/albertosilva/archive/tags/Desenvolvimento+_2800_SQL+Server+CE_2900_/default.aspx">Desenvolvimento (SQL Server CE)</a>, <a rel="tag" href="http://msmvps.com/blogs/albertosilva/archive/tags/MSDN/default.aspx">MSDN</a></span></div>
</div><br /><a href='http://www.flexsolutions.com.br'>Admin</a>&nbsp;&nbsp;<a href='http://www.flexsolutions.com.br/sql-compact-sim-a-performance-conta-muito-.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>Principles behind the Agile Manifesto</title>
      <link>http://www.flexsolutions.com.br/agile-principles.aspx</link>
      <pubDate>Sun, 18 Oct 2009 17:53:52 GMT</pubDate>
      <guid>http://www.flexsolutions.com.br/agile-principles.aspx</guid>
      <author>Admin</author>
      <comments>http://www.flexsolutions.com.br/agile-principles.aspx</comments>
      <description><![CDATA[<h1 style="text-align: center;">Principles behind the Agile Manifesto</h1>
<p style="text-align: center;"><br /><br /> <span style="font-size: x-small;"> <em>We follow these principles:</em> </span></p>
<p style="text-align: center;"><span style="font-size: x-small;"> Our highest priority is to satisfy the customer<br /> through early and continuous delivery<br /> of valuable software. </span></p>
<p style="text-align: center;"><span style="font-size: x-small;"> Welcome changing requirements, even late in <br /> development. Agile processes harness change for <br /> the customer's competitive advantage. </span></p>
<p style="text-align: center;"><span style="font-size: x-small;"> Deliver working software frequently, from a <br /> couple of weeks to a couple of months, with a <br /> preference to the shorter timescale. </span></p>
<p style="text-align: center;"><span style="font-size: x-small;"> Business people and developers must work <br /> together daily throughout the project. </span></p>
<p style="text-align: center;"><span style="font-size: x-small;"> Build projects around motivated individuals. <br /> Give them the environment and support they need, <br /> and trust them to get the job done. </span></p>
<p style="text-align: center;"><span style="font-size: x-small;"> The most efficient and effective method of <br /> conveying information to and within a development <br /> team is face-to-face conversation. </span></p>
<p style="text-align: center;"><span style="font-size: x-small;"> Working software is the primary measure of progress. </span></p>
<p style="text-align: center;"><span style="font-size: x-small;"> Agile processes promote sustainable development. <br /> The sponsors, developers, and users should be able <br /> to maintain a constant pace indefinitely. </span></p>
<p style="text-align: center;"><span style="font-size: x-small;"> Continuous attention to technical excellence <br /> and good design enhances agility. </span></p>
<p style="text-align: center;"><span style="font-size: x-small;"> Simplicity--the art of maximizing the amount <br /> of work not done--is essential. </span></p>
<p style="text-align: center;"><span style="font-size: x-small;"> The best architectures, requirements, and designs <br /> emerge from self-organizing teams. </span></p>
<p style="text-align: center;"><span style="font-size: x-small;"> At regular intervals, the team reflects on how <br /> to become more effective, then tunes and adjusts <br /> its behavior accordingly. </span></p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: left;"><span style="font-size: x-small;">Referencia: </span><a href="http://agilemanifesto.org/principles.html">http://agilemanifesto.org/principles.html</a></p><br /><a href='http://www.flexsolutions.com.br'>Admin</a>&nbsp;&nbsp;<a href='http://www.flexsolutions.com.br/agile-principles.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>RapidShare</title>
      <link>http://www.flexsolutions.com.br/Blog/ViewPost.aspx?pageid=24&amp;ItemID=75&amp;mid=7</link>
      <pubDate>Sun, 06 Sep 2009 22:37:20 GMT</pubDate>
      <guid>http://www.flexsolutions.com.br/Blog/ViewPost.aspx?pageid=24&amp;ItemID=75&amp;mid=7</guid>
      <author>Admin</author>
      <comments>http://www.flexsolutions.com.br/Blog/ViewPost.aspx?pageid=24&amp;ItemID=75&amp;mid=7</comments>
      <description><![CDATA[<p>rapidshare</p>
<p>http://tech-buzz.net/2006/05/11/rapidshare-unleashed-hack-to-download-limit/</p><br /><a href='http://www.flexsolutions.com.br'>Admin</a>&nbsp;&nbsp;<a href='http://www.flexsolutions.com.br/Blog/ViewPost.aspx?pageid=24&ItemID=75&mid=7'>...</a>]]></description>
    </item>
    <item>
      <title>Procurando arquvio no rapidshare</title>
      <link>http://www.flexsolutions.com.br/google-rapidshare.aspx</link>
      <pubDate>Sat, 22 Aug 2009 16:44:58 GMT</pubDate>
      <guid>http://www.flexsolutions.com.br/google-rapidshare.aspx</guid>
      <author>Admin</author>
      <comments>http://www.flexsolutions.com.br/google-rapidshare.aspx</comments>
      <description><![CDATA[<p>Procurando arquivo no rapidshare.de</p>
<ol>
    <li>Va para o site do Google: www.google.com.br</li>
    <li>Digite: <em>site:rapidshare.de</em></li>
    <li>“<em>inurl:pdf</em>” para E-books em formato PDF</li>
    <li>“<em>inurl:avi|wmv|mpg|nva</em>” para Filmes</li>
    <li>“<em>inurl:mp3|ogg|wma</em>” para arquivos de Audio</li>
    <li>“<em>inurl:exe</em>” para arquivos executaveis</li>
    <li>“<em>inurl:zip|rar|7zip|tar</em>” para RAR, ZIP, 7ZIP ou TAR </li>
</ol><br /><a href='http://www.flexsolutions.com.br'>Admin</a>&nbsp;&nbsp;<a href='http://www.flexsolutions.com.br/google-rapidshare.aspx'>...</a>]]></description>
    </item>
    <item>
      <title>Procurando torrents no google</title>
      <link>http://www.flexsolutions.com.br/google-torrents.aspx</link>
      <pubDate>Sat, 22 Aug 2009 16:39:47 GMT</pubDate>
      <guid>http://www.flexsolutions.com.br/google-torrents.aspx</guid>
      <author>Admin</author>
      <comments>http://www.flexsolutions.com.br/google-torrents.aspx</comments>
      <description><![CDATA[<p>Procurando torrents no google.</p>
<ol>
    <li>entre no site do google: www.google.com.br</li>
    <li>Digite: filetype:torrent &lt;nome&gt;, onde &lt;nome&gt; seria o nome do arquivo torrent que voce esta procurando.</li>
    <li>Clique no botao procurar.</li>
</ol><br /><a href='http://www.flexsolutions.com.br'>Admin</a>&nbsp;&nbsp;<a href='http://www.flexsolutions.com.br/google-torrents.aspx'>...</a>]]></description>
    </item>
    <item>
      <title> TechEd - Execution Plans</title>
      <link>http://www.flexsolutions.com.br/-teched-execution-plans.aspx</link>
      <pubDate>Wed, 29 Jul 2009 01:42:26 GMT</pubDate>
      <guid>http://www.flexsolutions.com.br/-teched-execution-plans.aspx</guid>
      <author>Admin</author>
      <comments>http://www.flexsolutions.com.br/-teched-execution-plans.aspx</comments>
      <description><![CDATA[<p>&#160;</p>
<div class="IndentedColumn">
<div class="BlogPostHeader">
<h1 class="MinMargin"><a href="http://www.flexsolutions.com.br/blogs/steve_jones/archive/2008/06/13/teched-execution-plans.aspx">TechEd  - Execution Plans</a></h1>
</div>
</div>
<blockquote>
<p>Randy Dyess of Solid Quality Mentors had a session and since I'd just gotten a copy of Grant Fritchey's book with the same name, I wanted to check it out.</p>
<p>There are 3 types of plans: graphical, text, and XML.</p>
<p>Graphical is cool, looks good, but it doesn't have enough information and once you are in a non-trivial situation, you have to scroll around and it's hard to hold all that information in your mind.</p>
<p>Text plans are what you need to learn to read. Especially in grid mode, we deal with this format for data all the time, so this makes lots of sense for many DBAs, so spend some time working on this. Once you get used to reading text plans, likely this will be your preferred method.</p>
<p>XML - Also hard to read, perhaps need to know XQuery, might be worth learning if you want to know more about XML. Randy doesn't like this, but I think it's worth reading about XML a bit and learning how it works since I think we'll have this data around for a long time. However reading XML isn't easy as things lik whitespace and other characters are encoded. Therefore it's not "human readable" and needs to be consumed by something. However XQuery should help here.</p>
<p>All plans can generate estimated or actual plans. Sometims you can't get actuals since it would be hours to execute the query, or you can't run it on the production system and need to know, or have a good idea of what's happening. Estimated plans help here, but they are not guarenteed to be the same as the actual plan.</p>
<p>One problem with estimated plans is temporary tables. You might need to comment one out to get the plan, and it might not be a good representation of the final plan. If you create a permanent work table and remove it, the same thing happens.</p>
<p><b>Text Plans</b></p>
<p>In the text plans, follow the parent column in your plan. It contains numbers, and the highest number happens first. The recommendation is to start tuning with the highest numbers, tuning there first since a change there will flow down to lower numbers. An observation from Randy that SQL Server seems to do the hardest or more resource intensive things first.</p>
<p>Options:</p>
<ul>
    <li>STATISTICS PROFILE ON</li>
    <li>SHOWPLAN_ALL&#160;</li>
    <li>SHOWPLAN_TEXT</li>
    <li>STATISTICS IO</li>
    <li>STATISTICS TIME ON</li>
</ul>
<p>Statistics IO gives you IO statistics from the query. You get more informaiton in 2008 as this has been enhanced. This is really read and scan information that you can use to determine where you might think about tuning the query. A big thing here is to try and reduce physical reads, but you need to run this a few times and be sure that the physical reads aren't the first ones to populate the cache. Once the data is in the cache, it might perform much better.</p>
<p>In this case, Randy looks to reduce logical reads. If those can be reduced, even if the data is not in cache, physical reads might be reduced.</p>
<p>Execution plans can also be pulled from memory. You can grab the plan from the cache, which is actually what is being used by SQL Server to execute the query. DMVs are available to help here.</p>
<p><b>How do you tune?</b></p>
<p>Randy's Goals</p>
<ul>
    <li>Optimize duration / CPU usage</li>
    <li>Optimize IO usage</li>
</ul>
<p>Tracking duration meaning physical clock time, helps to determine how busy the system is. It's good to know an average time for procedures to execute as a baseline. Know that this will grow over time (potentially) As you add data.</p>
<p>CPU usage - Track this since it's a limited resource. Knowing the top usage queries can allow you to focus your efforts on those queries that are used often and impact the CPU.</p>
<p>Large, complex queries usually have large batches of code, each of which can be tuned as a mini-execution plan.</p>
<p><b>Top Slowdowns</b></p>
<ul>
    <li>Table and clustered index scans</li>
    <li>Index scans v index seeks</li>
    <li>Bookmark lookups</li>
    <li>Join methods</li>
    <li>Sorts</li>
    <li>Compute Scalar</li>
</ul>
<p>Table and clustered index scans are the leading cause of bad performing queries. Not always, sometimes you want this, but it is often bad. A CI scan is a table scan really, but could have better performance since you don't have as many random IOs as on a heap. Randy has this is the number one thing to tune when he sees this. If he can remove this, it often helps. Partial scans are sometimes ok, such as scanning a set of data all grouped together.</p>
<p>Index scans are beter than table scans, but still costly. This usually means a lot of rows ned to be read for the query. Investigate to see if you can turn these into seeks. CI seeks are the best things to have since they hit the data, but only specific rows.</p>
<p>Bookmark Lookups - A non-clustered index is used, but then you must use the CI key to go read the CI and get the data. In 2005 the INCLUDE columns can help remove these. In 2005/2008, you don't see this operator. You see RID (row identifier) and then a Lookup to get the data. These are hard to resolve, you might include 3-5 columns, but not more. You want to review the columns used by indexes to see if you can cover more queries. Or perhaps see if you really need to return that column and perhaps remove the columns. Don't SELECT *, that can cause this. You might also try creating aditional indexes&#160; to be used for joins or perhaps, if appropriate for that table, change the NCI to a CI. This shouldn't be done lightly, especially if you've spent time considering what the best CI should be.</p>
<p>Be sure that your NCI doesn't duplicate the CI keys. They are already included.</p>
<p>Join Methods - SQL Server uses 3 types. Nested loop, Merge, Hash.</p>
<p>Nested loops are for smaller inputs, and has low memory usage. When you have a small and large tables, this often occurs. You don't want this between two large tables. Nested loops may resort your data.</p>
<p>If you have two large tables, a merge join in better. It's for larger inputs, and middle in terms of memory being used.</p>
<p>The hash join is for large tables, uses lots of memory. A row from the first table is run through a hash algorithm and then stored. The hash buckets are stored in MemToLeave, which is only 256MB on 32 bit machines. Above that, the hash tables moves to tempdb, which is much slower.</p>
<p>Sorts are expensive. Don't add them unnecessarily. DISTINCT, UNION, ORDER BY, GROUP BY, aren't always needed. Don't add them out of habit. UNION ALL does not produce a sort because duplicates aren't removed. If possible, allow indexes to presort things.</p>
<p>Compute Scalar is a function being used by the optimizer. Try to reveiew for implicit functions and watch if you have this in a WHERE clause</p>
</blockquote>
<p><a href="http://www.sqlservercentral.com/blogs/steve_jones/archive/2008/06/13/teched-execution-plans.aspx">SQL Server Central</a></p><br /><a href='http://www.flexsolutions.com.br'>Admin</a>&nbsp;&nbsp;<a href='http://www.flexsolutions.com.br/-teched-execution-plans.aspx'>...</a>]]></description>
    </item>
  </channel>
</rss>