<?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: indecsi : dati-va si voi cu parerea</title><link>http://sqlserver.ro/forums/thread/3205.aspx</link><pubDate>Mon, 05 Nov 2007 21:55:09 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3205</guid><dc:creator>B_gd_n[ ]Sahlean</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3205.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=3205</wfw:commentRss><description>&lt;p&gt;Cred ca gasesti raspunsul chiar in articolul respectiv:&lt;/p&gt;&lt;p&gt;"&lt;span style="font-size:10pt;font-family:'Comic Sans MS';"&gt;DMVs
provide a level of transparency that was &lt;span style="font-weight:bold;"&gt;not available in SQL Server
2000&lt;/span&gt; and can be used for diagnostics, memory and process tuning, and
monitoring&lt;span&gt;"&lt;/span&gt;&lt;/span&gt;&amp;nbsp; .&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="font-weight:bold;"&gt;Fragmente poti gasi in:&lt;/p&gt;&lt;p&gt;http://www.2shared.com/file/2464287/72fdc52a/sqlserver.html&lt;/p&gt;&lt;p&gt;http://www.sqlskills.com/blogs/paul/2007/10/05/IndexesFromEveryAngleHowCanYouTellIfAnIndexIsBeingUsed.aspx&amp;nbsp;&lt;/p&gt;&lt;p&gt;http://www.mssqltips.com/tip.asp?tip=1359&lt;/p&gt;&lt;p&gt;http://www.mssqltips.com/tip.asp?tip=1196&lt;/p&gt;&lt;p&gt;http://www.mssqltips.com/tip.asp?tip=1014&amp;nbsp;&lt;/p&gt;&lt;p&gt;http://www.databasejournal.com/features/mssql/print.php/3608296&amp;nbsp;&lt;/p&gt;&lt;p&gt;http://www.sqlskills.com/blogs/paul/CategoryView,category,Indexes+From+Every+Angle.aspx&lt;/p&gt;&lt;p&gt;...&lt;/p&gt;&lt;p&gt;&lt;br&gt;O&amp;nbsp; prezentarea exhaustiva a solutiilor de optimizare poti gasi chiar in BOL din SQL Server 2000.&lt;br&gt;&lt;/p&gt;&lt;p&gt;Ca fapt divers, de la adresa &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=2ec9e842-40be-4321-9b56-92fd3860fb32&amp;amp;DisplayLang=en" title="http://www.microsoft.com/downloads/details.aspx?FamilyID=2ec9e842-40be-4321-9b56-92fd3860fb32&amp;amp;DisplayLang=en" target="_blank"&gt;aceasta&lt;/a&gt; se poate copia o schema care include vederile (views) sistem din SQL Server 2005.&lt;br&gt;&lt;span style="font-weight:bold;"&gt;&lt;br&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: indecsi : dati-va si voi cu parerea</title><link>http://sqlserver.ro/forums/thread/3203.aspx</link><pubDate>Mon, 05 Nov 2007 16:32:04 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3203</guid><dc:creator>MihaiBejenariu</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3203.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=3203</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="http://sqlserver.ro/Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;xmldeveloper:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Daca folositi SQL Server 2005 cititi neaparat acest articol: &lt;a href="http://blogs.msdn.com/sqlcat/archive/2006/02/13/531339.aspx"&gt;http://blogs.msdn.com/sqlcat/archive/2006/02/13/531339.aspx&lt;/a&gt;
&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Super articolul.&amp;nbsp;&lt;br&gt; &lt;/p&gt;&lt;p&gt;BTW, cum s-ar face acelasi lucru in SQL Server 2000?&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: indecsi : dati-va si voi cu parerea</title><link>http://sqlserver.ro/forums/thread/3195.aspx</link><pubDate>Sat, 03 Nov 2007 17:13:04 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3195</guid><dc:creator>Diana</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3195.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=3195</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="http://sqlserver.ro/Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;liviu.costea:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;Chiar am vrut sa ma uit la rapoarte
(decat sa iau rezultatele la query, si sa le pun in csv ca sa pot cauta
prin ele), dar nu imi apare optiunea "Reports". Nici in Tasks nu e. Eu
am 2005 Developer Edition, poate in versiunea asta nu e sau poate mai
trebuie ceva instalat.&lt;/p&gt;
&lt;p&gt;Ai idee?&lt;/p&gt;&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;Ce - ti "intoarce" SERVERPROPERTY('ProductVersion') ?&lt;br&gt;
&lt;/p&gt;</description></item><item><title>Re: indecsi : dati-va si voi cu parerea</title><link>http://sqlserver.ro/forums/thread/3193.aspx</link><pubDate>Sat, 03 Nov 2007 12:29:12 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3193</guid><dc:creator>ggciubuc</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3193.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=3193</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="http://sqlserver.ro/Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;liviu.costea:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;DIV class=ForumPostContentText id=_ctl0__ctl1_bcr_Deletepost1___PostPreview___PostRepeater__ctl1_PostViewWrapper&gt;
&lt;P&gt;Parerea mea e ca unul din indecsii astia doi&amp;nbsp;e in plus, mai bine spus&amp;nbsp;al doilea. &lt;/P&gt;
&lt;P&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/P&gt;
&lt;P&gt;Legat de indexul pe 7 coloane : cred ca acestea fac parte dintr-un index cu optiunea include columns. Citez din books online :&lt;/P&gt;
&lt;P&gt;"&lt;/P&gt;
&lt;P&gt;Indexes that include nonkey columns provide the greatest benefit when they cover the query. This means the indexes include all columns referenced by the query. For more information see Index with Included Columns.&lt;/P&gt;
&lt;P&gt;USE AdventureWorks;&lt;BR&gt;GO&lt;BR&gt;CREATE NONCLUSTERED INDEX IX_Address_PostalCode&lt;BR&gt;ON Person.Address (PostalCode)&lt;BR&gt;INCLUDE (AddressLine1, AddressLine2, City, StateProvinceID);&lt;BR&gt;"&lt;BR&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description></item><item><title>Re: indecsi : dati-va si voi cu parerea</title><link>http://sqlserver.ro/forums/thread/3188.aspx</link><pubDate>Fri, 02 Nov 2007 16:51:18 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3188</guid><dc:creator>liviu.costea</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3188.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=3188</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="http://sqlserver.ro/Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;rsocol:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;P&gt;Ambii indecşi pot fi utili, la query-uri diferite. Mai precis, indexul nonclustered e util când faci o căutare după coloana datetime, fără sa ai nicio condiţie pe coloana int. Să luăm ca exemplu tabela Production.ProductCostHistory din AdventureWorks şi următoarele trei query-uri:&lt;/P&gt;
&lt;P&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/P&gt;
&lt;P&gt;Da, ai dreptate, cu siguranta sunt cateva queri-uri care s-ar putea folosi de indexul asta. Si nu depinde numai de predicat(dupa StartDate)&amp;nbsp;ci si de output, daca acele coloane care le selectez nu sunt in index probabil ca&amp;nbsp;nu-l va ma folosi ca oricum trebuie sa treaca prin clustered.&lt;/P&gt;
&lt;P&gt;Insa pot sa-mi dau seama daca am asemenea queri-uri care sa foloseasca indexul sau nu.&lt;/P&gt;
&lt;P&gt;Folosind &lt;FONT size=2&gt;sys.dm_db_index_operational_stats am urmatorul rezultat pentru indexul asta: 0 reads si 13288 writes. Asta e tot ce vroiam.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;Multumesc!&lt;/P&gt;&lt;/FONT&gt;</description></item><item><title>Re: indecsi : dati-va si voi cu parerea</title><link>http://sqlserver.ro/forums/thread/3186.aspx</link><pubDate>Fri, 02 Nov 2007 16:20:14 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3186</guid><dc:creator>liviu.costea</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3186.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=3186</wfw:commentRss><description>&lt;P&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="http://sqlserver.ro/Themes/default/images/icon-quote.gif"&gt; &lt;strong&gt;Diana:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Pe SQL 2005 exista si cateva rapoarte standard (la nivelul bazei de date) - cred ca te poate ajuta "Index Usage Statistics". Da "right-click" pe baza si alege Reports ---&amp;gt; Standard Reports. Rapoartele ofera datele din dynamic management views intr-o forma mai accesibila...&lt;BR&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/P&gt;
&lt;P&gt;Chiar am vrut sa ma uit la rapoarte (decat sa iau rezultatele la query, si sa le pun in csv ca sa pot cauta prin ele), dar nu imi apare optiunea "Reports". Nici in Tasks nu e. Eu am 2005 Developer Edition, poate in versiunea asta nu e sau poate mai trebuie ceva instalat.&lt;/P&gt;
&lt;P&gt;Ai idee?&lt;/P&gt;</description></item><item><title>Re: indecsi : dati-va si voi cu parerea</title><link>http://sqlserver.ro/forums/thread/3185.aspx</link><pubDate>Fri, 02 Nov 2007 16:00:57 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3185</guid><dc:creator>rsocol</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3185.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=3185</wfw:commentRss><description>&lt;p&gt;Ambii indecşi pot fi utili, la query-uri diferite. Mai precis, indexul nonclustered e util când faci o căutare după coloana datetime, fără sa ai nicio condiţie pe coloana int. Să luăm ca exemplu tabela Production.ProductCostHistory din AdventureWorks şi următoarele trei query-uri:&lt;/p&gt;&lt;p&gt;SELECT COUNT(*) FROM Production.ProductCostHistory WHERE ProductID=708&lt;br&gt;&lt;br&gt;SELECT COUNT(*) FROM Production.ProductCostHistory WHERE StartDate='20010701'&lt;/p&gt;&lt;p&gt;SELECT MAX(StartDate) FROM Production.ProductCostHistory&lt;br&gt;&lt;br&gt;Pentru primul query se face Clustered Index Seek (şi are un cost total de 0.0032876), însă pentru al doilea query se face Clustered Index Scan&amp;nbsp; (având un cost total de 0.0053128), pentru că avem nu avem condiţie pe prima coloană din index, iar pentru al treilea query face tot un Clustered Index Scan (costul fiind de 0.0054355). Dacă creăm şi un index non-clustered, pe aceleaşi coloane ca şi indexul clustered, dar în ordine inversă:&lt;/p&gt;&lt;p&gt;CREATE INDEX IX ON Production.ProductCostHistory (StartDate, ProductID)&lt;/p&gt;&lt;p&gt;Atunci şi al doilea query foloseşte un index seek, având astfel o performanţă mai bună (costul este acum 0.0034049). La al treilea query, aparent se face un Index Scan (pe noul index), dar observăm că de fapt e limitat cu un TOP 1, ceea ce îl face să fie la fel de performat ca un seek (costul total fiind 0.0032843).&lt;br&gt;&lt;/p&gt;&lt;p&gt;Deci în cazul tău, problema se rezumă la a decide dacă pot exista query-uri care să pună condiţie doar pe coloana datetime, fără implica şi coloana int. Dacă există, atunci trebuie pus în balanţă beneficiul rezultat la asemenea interogări cu costul actualizării unui index suplimentar la adăugarea/actualizarea/ştergerea datelor din tabele. În cazul în care interogările sunt mult mai dese decât modificările, atunci probabil e mai bine să păstrăm indexul. Dacă modificările sunt foarte dese, atunci poate ar fi mai bine să renunţăm la el (dar chiar şi modificările pot beneficia de un index în cazul în care avem un UPDATE sau un DELETE care are o condiţie care implică acele coloane).&lt;br&gt;&lt;/p&gt;&lt;p&gt;Răzvan&lt;/p&gt;</description></item><item><title>Re: indecsi : dati-va si voi cu parerea</title><link>http://sqlserver.ro/forums/thread/3184.aspx</link><pubDate>Fri, 02 Nov 2007 15:25:06 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3184</guid><dc:creator>Diana</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3184.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=3184</wfw:commentRss><description>Pe SQL 2005 exista si cateva rapoarte standard (la nivelul bazei de
date) - cred ca te poate ajuta "Index Usage Statistics". Da
"right-click" pe baza si alege Reports ---&amp;gt; Standard Reports.
Rapoartele ofera datele din dynamic management views intr-o forma mai
accesibila...&lt;br&gt;</description></item><item><title>Re: indecsi : dati-va si voi cu parerea</title><link>http://sqlserver.ro/forums/thread/3183.aspx</link><pubDate>Fri, 02 Nov 2007 15:24:36 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3183</guid><dc:creator>liviu.costea</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3183.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=3183</wfw:commentRss><description>&lt;P&gt;Da, e o idee buna sa ma uit la index usage, sa vad cat de mult a fost folosit indexul meu.&lt;/P&gt;
&lt;P&gt;Mersi!&lt;/P&gt;</description></item><item><title>Re: indecsi : dati-va si voi cu parerea</title><link>http://sqlserver.ro/forums/thread/3182.aspx</link><pubDate>Fri, 02 Nov 2007 15:23:44 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3182</guid><dc:creator>liviu.costea</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3182.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=3182</wfw:commentRss><description>2005</description></item><item><title>Re: indecsi : dati-va si voi cu parerea</title><link>http://sqlserver.ro/forums/thread/3181.aspx</link><pubDate>Fri, 02 Nov 2007 15:19:31 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3181</guid><dc:creator>B_gd_n[ ]Sahlean</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3181.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=3181</wfw:commentRss><description>Liviu: ce versiune de SQL Server folosesti ?</description></item><item><title>Re: indecsi : dati-va si voi cu parerea</title><link>http://sqlserver.ro/forums/thread/3180.aspx</link><pubDate>Fri, 02 Nov 2007 15:09:00 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3180</guid><dc:creator>xmldeveloper</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3180.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=3180</wfw:commentRss><description>&lt;P&gt;Daca folositi SQL Server 2005 cititi neaparat acest articol: &lt;A href="http://blogs.msdn.com/sqlcat/archive/2006/02/13/531339.aspx"&gt;http://blogs.msdn.com/sqlcat/archive/2006/02/13/531339.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Va raspunde la intrebarea aduce un index mai mult overhead decat e utilizat?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>Re: indecsi : dati-va si voi cu parerea</title><link>http://sqlserver.ro/forums/thread/3179.aspx</link><pubDate>Fri, 02 Nov 2007 15:04:03 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3179</guid><dc:creator>Diana</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3179.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=3179</wfw:commentRss><description>&lt;p&gt;Cum e folosit tabelul -ce query - uri ruleaza in mod curent?&lt;/p&gt;&lt;p&gt;Incearca
sa captezi un "trace" cu profiler - ul in timp ce se lucreaza pe tabel.
Foloseste trace - ul ca workload pentru Database Engine Tuning Advisor
(SQL 2005) / Index Tuning Wizard (SQL 2000) si vezi ce recomandari
genereaza...&lt;/p&gt;</description></item><item><title>indecsi : dati-va si voi cu parerea</title><link>http://sqlserver.ro/forums/thread/3178.aspx</link><pubDate>Fri, 02 Nov 2007 14:32:38 GMT</pubDate><guid isPermaLink="false">963f3a18-65dd-4aad-905c-b785cfe1d7c7:3178</guid><dc:creator>liviu.costea</dc:creator><slash:comments>0</slash:comments><comments>http://sqlserver.ro/forums/thread/3178.aspx</comments><wfw:commentRss>http://sqlserver.ro/forums/commentrss.aspx?SectionID=16&amp;PostID=3178</wfw:commentRss><description>&lt;DIV class=ForumPostContentText id=_ctl0__ctl1_bcr_Deletepost1___PostPreview___PostRepeater__ctl1_PostViewWrapper&gt;
&lt;P&gt;Salut, am si eu o intrebare, daca puteti sa va dati cu parerea la urmatoarea situatie:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Faceam review la aplicatie si am gasit la o tabela urmatorii doi indecsi (tabela e foarte des folosita):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;1. clustered pe 2 coloane: int si datetime (intul nu e identity), coloanele astea doua sunt si un alternate key&lt;/P&gt;
&lt;P&gt;&amp;nbsp;2. un index pe vreo 7 coloane, din care primele doua sunt aceleasi coloane de la primul index in ordine inversa. Cred ca celelalte 5 coloane is folosite ca output si nu in predicat.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Tabela are 10 coloane, dintre care o coloana e identity si PK.&lt;/P&gt;
&lt;P&gt;Parerea mea e ca unul din indecsii astia doi&amp;nbsp;e in plus, mai bine spus&amp;nbsp;al doilea. Selectivitatea primelor doua coloane din index e foarte mare (de fapt e maxima), si cred ca se va folosi in mai toate cazurile indexul clustered. Chiar daca se va folosi indexul al doilea, faptul ca exclude doar 3 coloane din tabela nu salveaza mult IO fata de folosirea celui clustered.&lt;/P&gt;
&lt;P&gt;Voi ce ziceti?&lt;/P&gt;&lt;/DIV&gt;</description></item></channel></rss>