Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: Erland Sommarskog Newsgroups: comp.databases.ms-sqlserver Subject: Re: Some questions about relational indexes and statistics in SS2005 Date: Fri, 10 May 2013 11:05:44 +0200 Organization: Erland Sommarskog Lines: 23 Message-ID: References: <34bd78e8-b0d3-447c-a5de-88d35d6b6383@googlegroups.com> <78faabb3-916b-472e-98f2-095fa7f6dd9e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Info: mx05.eternal-september.org; posting-host="78e2ae7e6764121e217a035f19bdb315"; logging-data="618"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18QryeLptlmCOcBmZYYpyqo" User-Agent: Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32) Cancel-Lock: sha1:DFcCjM64o6K+wQmfuo9kySjTd8s= Xref: csiph.com comp.databases.ms-sqlserver:1475 (rja.carnegie@gmail.com) writes: > Well, my grand scheme includes (1) writing a stored procedure > that defines, say, ten or twenty indexes and statistics on a > table, but allows them to be created one by one, and, > (2) using the same interface to perform "index rebuild" > and "update statistics" on the target - that part isn't > done yet. And this is where the table may be called > Student_2011, Student_2012, Student_2013, and may be in > database UserStuff01, UserStuff02, UserStuff03, and so on: > the interface stored procedure addresses that complexity. > > I also want to avoid having the server do some of this meta-work > more than once. Except that it deletes a lot of the data every > day and loads it in from where it came from again. So, make that > "more than necessary". Not sure where you are heading here. Even if you add statistics manually, SQL Server will still maintain them, just like it maintains autostats. Or do you plan to turn off automatic updates of statistics for the database? -- Erland Sommarskog, Stockholm, esquel@sommarskog.se