<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlserver.ro/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Intrebari generale</title><link>http://sqlserver.ro/forums/16/ShowForum.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Re: Imbunatatire performanta</title><link>http://sqlserver.ro/forums/thread/8599.aspx</link><pubDate>Tue, 11 Jan 2011 15:58:23 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:8599</guid><dc:creator>rsocol</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/8599.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=8599</wfw:commentRss><description>Conditia "where tbl1.column2=@valoare" poate schimba mult planul de execuţie. &amp;#206;n acest caz, ar fi util şi un index (non clustered, unic dacă e cazul) pe column2 &amp;#238;n tbl1. De asemenea, ar putea fi necesare nişte hint-uri pentru a forţa join-urile să se facă &amp;#238;ntr-o anumită ordine sau cu o anumită metodă, dar asta depinde de distribuţia datelor din tabele.&lt;br /&gt;&lt;br /&gt;Răzvan</description></item><item><title>Re: Imbunatatire performanta</title><link>http://sqlserver.ro/forums/thread/8598.aspx</link><pubDate>Tue, 11 Jan 2011 14:33:32 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:8598</guid><dc:creator>Diana</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/8598.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=8598</wfw:commentRss><description>Tuning advisor-ul este o alta posibilitate. Scuze pentru omisiune.</description></item><item><title>Re: Imbunatatire performanta</title><link>http://sqlserver.ro/forums/thread/8597.aspx</link><pubDate>Tue, 11 Jan 2011 11:47:55 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:8597</guid><dc:creator>petru.sbiera</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/8597.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=8597</wfw:commentRss><description>partea cu Where mi-a scapat .... de fapt where e in continuare la acele select si era de genul 

where tbl1.column2=@valoare</description></item><item><title>Re: Imbunatatire performanta</title><link>http://sqlserver.ro/forums/thread/8596.aspx</link><pubDate>Tue, 11 Jan 2011 11:47:05 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:8596</guid><dc:creator>Diana</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/8596.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=8596</wfw:commentRss><description>Vezi si planul de executie.&lt;br /&gt;In SQL 2008 planul poate include si sugestii de indexare ("missing indexes").&lt;br /&gt;Pentru SQL 2005 vezi http://www.sql-server-performance.com/articles/per/Identify_Missing_Indexes_Using_SQL_Server_DMVs_p1.aspx</description></item><item><title>Re: Imbunatatire performanta</title><link>http://sqlserver.ro/forums/thread/8595.aspx</link><pubDate>Tue, 11 Jan 2011 11:31:30 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:8595</guid><dc:creator>rsocol</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/8595.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=8595</wfw:commentRss><description>&amp;#206;n tbl1, ar trebui să fie un index pe column4 (singura coloană folosită &amp;#238;n query). &amp;#206;n tbl3 ar trebui să fie suficient indexul clustered pe column1, index care se crează implicit odată cu PK-ul. &amp;#206;n tbl2 aş face un index compus pe column1 şi column3 (&amp;#238;n ordinea asta). &lt;br /&gt;&lt;br /&gt;Cu aceşti indecşi eu aş spera ca planul de execuţie care ar rezulta să fie un merge join (sau hash join) &amp;#238;ntre tbl1 şi tbl2 (cu index scan-uri pe indecşii respectivi), urmat de un nested loops join cu clustered index seek in tbl3.&lt;br /&gt;&lt;br /&gt;N-am &amp;#238;nţeles care era treaba cu WHERE-ul... avea vreo legătură cu tbl1, tbl2, tbl3?&lt;br /&gt;&lt;br /&gt;Răzvan</description></item><item><title>Imbunatatire performanta</title><link>http://sqlserver.ro/forums/thread/8594.aspx</link><pubDate>Tue, 11 Jan 2011 10:09:27 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:8594</guid><dc:creator>petru.sbiera</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/8594.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=8594</wfw:commentRss><description>Buna&lt;br /&gt;Am 3 tabele cu urmatoarea configuratie&lt;br /&gt;&lt;br /&gt;tbl1 - aproximativ 1.000.000 inregistrari&lt;br /&gt;column1 - PK, int&lt;br /&gt;column2 - varchar(10)&lt;br /&gt;column3 - FK, int&lt;br /&gt;column4 - int&lt;br /&gt;column5 - FK, int&lt;br /&gt;column6 - int&lt;br /&gt;&lt;br /&gt;tbl2 - aproximativ 200.000 inregistrari&lt;br /&gt;column1 - PK, int&lt;br /&gt;column2 - FK, int&lt;br /&gt;column3 - FK, int&lt;br /&gt;column4 - int&lt;br /&gt;column5 - decimal&lt;br /&gt;column6 - int&lt;br /&gt;column7 - int&lt;br /&gt;&lt;br /&gt;tbl3 - sub 100 inregistrari&lt;br /&gt;column1 - PK, int&lt;br /&gt;column2 - varchar(10)&lt;br /&gt;&lt;br /&gt;si am urmatorul select:&lt;br /&gt;SELECT t3.column2&lt;br /&gt;            FROM tbl2 t2&lt;br /&gt;            INNER JOIN tbl1 t1 ON t2.column1 = t1.column4&lt;br /&gt;            INNER JOIN tbl3 t3 ON t2.column3 = t3.column1&lt;br /&gt;            WHERE tbl1.column2 = @Valoare&lt;br /&gt;&lt;br /&gt;Intrebarea mea este cum pot imbunatatii structura tabelelor astfel incat durata de executie a acestui querry sa fie mai mic.&lt;br /&gt;Ce indexi ar trebui sa am in fiecare tabel?&lt;br /&gt;Momentan timpul de executie este de 2 secunde.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Mai o intrebare ... de ce daca aceasta interogare este rulata din Microsoft SQl Management Studio dureaza foarte putin (0 ms), iar daca este rulata din aplicatie dureaza pana la 2 secunde.</description></item></channel></rss>