statistics

  • is it possible to copy statistics of a Db1.TableA into Db2.TableA where both databases are exactly identical except the data in it.

  • I don't know that you can. I would think internal algorithms and such are in play in SQL Server. So depending on what query has been run against what column, etc.

    According to sys.stats the query processor is what is creating the stats so even if you got them matched at some point, it could change depending on what querying is being done on each database/table.

    Shawn Melton
    Twitter: @wsmelton
    Blog: wsmelton.github.com
    Github: wsmelton

  • i did generate scripts for statistics from better performing database and copied to the database that performs very poor hoping it would choose the execution plan path but unfortuntely i didnt do.

    I am trying to make my execution plan use parallelism(Gather Streams) but could not.same query is ran on both databases but the plan is different. the Bad databse could not use parallelism not sure why though it is very small

  • I restore db to production every month so that data addedd in the stage area will be updated but during this process i rebuild indexes,backup db and restore on to production by which i think i am losing statistics generated in the production before restore, how do i avoid that? so that i can keep all the statistics created before the restore to improve my query perofrmance.

  • Tara-1044200 (9/22/2010)


    the Bad databse could not use parallelism not sure why though it is very small

    Parallelism depends on the amount of the data dealt in a query execution( when there is larger amount data). and more than one cpu processor. refer these links

    http://www.sqlservercentral.com/articles/Configuring/managingmaxdegreeofparallelism/1029/

    http://www.sqlservercentral.com/articles/Locking/67952/

    http://www.sqlservercentral.com/blogs/sql_performance/archive/2010/3/15/microsoft-sql-server-degree-of-parallelism.aspx

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • Tara-1044200 (9/26/2010)


    so that i can keep all the statistics created before the restore to improve my query performance.

    i dont think that can be done, statistics(not the user defined ones) are created by implicitly by sql server.

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

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

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