home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 17,919 of 19,505   
   Erland Sommarskog to basis_consultant@hotmail.com   
   Re: Set MSSQL 2005 to Favor Returning Fi   
   23 Sep 10 22:40:45   
   
   bef0a075   
   From: esquel@sommarskog.se   
      
   basis_consultant@hotmail.com (basis_consultant@hotmail.com) writes:   
   > I am not sure whether I am posting to the correct group; If not, please   
   > tell me which groups are better.   
   >   
   > My experience has been mainly with Oracle. In Oracle (9i+) there is an   
   > optimizer mode name FIRST_ROWS (Now FIRST_ROWS_N), typically used in   
   > OLTP environments.   
   >   
   > It hints that the database should favor returning the first N rows of   
   > a query as soon as possible; The rest of the query can continue running   
   > in the background.   
   > Typically, this mode favors indexes over full-table scans.   
   >   
   > The idea is that the user sees a result set quickly.   
   >   
   > Is there something similar in MSSQL 2005? If so, any info or links will   
   > be greatly appreciated.   
      
   Add "OPTION (FAST n)" at the end of the WHERE clause. n is a number >= 1.   
      
   Whether it is a good idea, I don't know. It may be useful for something   
   that fills a form, as the user can get the first set of rows to look at   
   quickly. When you this hint, the otimizer will be less prone to use   
   stopping operators like hash joins.   
      
      
      
      
      
      
   --   
   Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se   
      
   Links for SQL Server Books Online:   
   SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx   
   SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx   
   SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca