Home > Archive > MS SQL Server > November 2005 > Delete From SysIndexes









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Delete From SysIndexes
Joe K.

2005-11-29, 8:23 pm


I was told to run the query listed below in the morning on my database and
the other query at the end of the day.

What detail information will be given from the delete and the select
statement?

Thanks,

Morning:
delete from sysindexes where name like '_wa_sys_%'

End of Day:
select count(*) from sysindexes where name like '_wa_sys_%'

Andrew J. Kelly

2005-11-29, 8:23 pm

What was their reasoning? They should learn a little more about how sql
server works before suggesting things like that. If you want to remove
statistics you should have a look at DROP STATISTICS in BooksOnLine. But
why would you want to remove all the stats every day? I can see no
reasoning for that.

--
Andrew J. Kelly SQL MVP


"Joe K." <Joe K.@discussions.microsoft.com> wrote in message
news:CCA353B4-4030-4A18-97AA- 8B320136F80F@microso
ft.com...
>
> I was told to run the query listed below in the morning on my database and
> the other query at the end of the day.
>
> What detail information will be given from the delete and the select
> statement?
>
> Thanks,
>
> Morning:
> delete from sysindexes where name like '_wa_sys_%'
>
> End of Day:
> select count(*) from sysindexes where name like '_wa_sys_%'
>



Armando Prato

2005-11-29, 8:23 pm

Ugh, this is some bad, bad advice.

Why would "he/she" want you to do that??

These are statistics that SQL Server keeps on non-indexed columns. Maybe
a better solution would be to look into them with the idea that you may need
an index or two added to your data model.

Here's a good article that talks about them

http://www.windowsitpro.com/Article...38441.html?Ad=1


"Joe K." <Joe K.@discussions.microsoft.com> wrote in message
news:CCA353B4-4030-4A18-97AA- 8B320136F80F@microso
ft.com...
>
> I was told to run the query listed below in the morning on my database and
> the other query at the end of the day.
>
> What detail information will be given from the delete and the select
> statement?
>
> Thanks,
>
> Morning:
> delete from sysindexes where name like '_wa_sys_%'
>
> End of Day:
> select count(*) from sysindexes where name like '_wa_sys_%'
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com