Does statistics matter?

  • Hi,

    We had a table in our production database and wanted to make an EXACT copy of it in the same

    database.

    The new table would be used from now onwards.

    So firstly i copied all the data from old table to the new one.

    Then I copied all the primary key, constraints, triggers, indexes from old table.

    Now I dont know to copy all the statistics from old table..

    Does it matter if i dont copy all stats??

    I see by default some stats come up in the new table , but that are less compared to in the old table.

    Will it effect any working on our retail dept ??

    Please Advise.

    Regards,

    Skybvi

    Regards
    Sushant Kumar
    MCTS,MCP

  • Autostats will rebuild all the stats it needs. However if you have created stats manually then you need to copy those. If you changed stats settings you also need to copy that over.

    It's not a bad idea to script them because then the first queries won't need to wait on those to be created.

  • Ninja's_RGR'us (1/6/2012)


    Autostats will rebuild all the stats it needs. However if you have created stats manually then you need to copy those. If you changed stats settings you also need to copy that over.

    It's not a bad idea to script them because then the first queries won't need to wait on those to be created.

    Sorry my bad, I forgot to mention that it is SQL Server 2000 🙁

    Some stats which come automatically (on creating new table), maybe those are the stats wich were created manually.

    "Changed stats settings" means in a job or how... because I just scripted out everything and ran to make the new table...

    Actually this server is used just to add/edit/modify some data/products in the retail store.

    Its not used for fetching/processing of reports, etc..

    We have another sql server 2005 whcih has the data from all stores at a central place to do our reporting/processing. So, there we do update/rebuild stats frequently.

    But, i dont think we update stats/rebuild stats on the sql server 2000

    Regards,

    Skybvi

    Regards
    Sushant Kumar
    MCTS,MCP

  • 2000 makes no difference here. Best thing to do is to rebuild the stats as well. But it's not critical

    If this is a low usage server don't bother aside from scripting your stats. I'm 90% sure you can do that in the 2000's script wizard but I can't confirm.

  • Just run UPDATE STATISTICS on the 2000 server for the table.

    The rest of ninja's advice is what I'd recommend.

  • Steve Jones - SSC Editor (1/6/2012)


    Just run UPDATE STATISTICS on the 2000 server for the table.

    The rest of ninja's advice is what I'd recommend.

    Yup,

    Just created a maintenence plan in query analyzer in sql 2000.

    Thanks Steve and Ninja.

    Regards,

    Skybvi

    Regards
    Sushant Kumar
    MCTS,MCP

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply