You are hereBlog
Register   |  Login
 Links
Minimize
 User Group Blog
Minimize
 User Group Blog
Minimize
Jan 16

Written by: Allen Berezovsky
1/16/2009 6:29 PM

So I was doing a lecture on sql server query optimization at UCLA yesterday, and one of the topics I was covering was statiscs. As we know, statistics is information that the sql server collects about the distribution of data in columns and indexes, and they are used by the query optimizer to determine the best execution plan. If the database option to update statistics automatically is on, which is the default, statistics will be updated as soon as the need is discovered. In general, if your table has over 500 rows in it, and at least 500 plus 20% of the rowcount rows have been modified, statistics are out of date. Therefore, when that happens, and a user does a select, sql server will first update the statistics to get the best execution plan, and then work on returning your query results. While that sounds good in theory, in practice, it kills your query performance because wating for statistics to update when you're trying to get data returned to your application is very costly. I talked about being proactive in updating statistics with good maintenance plans, etc. I also talked about the possibility of turning on the option of updating statistics asynchronously on the database. What that will do, is alow your query to return data using the old execution plan, while the statistics are updating on the different thread.

As I was discussing these issues, a great question came up. Is updating statistics sufficient to make sure that our stored procedures use the latest and greatest execution plan? The answer is, not necessarily. Before SQL Server 2005, the execution plan for a stored procedure was saved during initial compile, and if you changed your table structure or added new indexes to a table after that compile, you would have to make sure to recompile your stored procedure in order for it to generate a new and better execution plan. Since the 2005 version, there has been a slight improvement to when the optimization of your procedure's execution plan occurs. Now, the optimization happens automatically when the first time a stored procedure is executed right after SQL Server services are restarted. It will also happen automatically if an underlying table used by the stored procedure changes. However, if you add a new index from which a stored procedure might benefit, and you do not want to wait till the SQL Server is restarted for your stored procedure to reap the benefit of your new index. In this case, you might want to force the stored procedure to recompile the next time it executes, and for that you can use the sp_recompile system stored procedure.

Tags:

29 comments so far...

Re: Updating Statistics VS Recompiling Stored Procedures

Looking For discountchanel replica
Looking For discountchanel handbags
Looking For discountchanel
Beautifulgucci handbags for sale
Beautifulgucci for sale
The store online sells theBalenciaga bags
Balenciagafor sale
If you want to buylouis vuitton bag
If you want to buylouis vuitton
different kinds oflouis vuitton handbag for cheap
different kinds oflouis vuitton for cheap
louis vuitton bag
replica louis vuitton bag for Cheap Wholesalecheap
replica louis vuitton bag for for Cheap Wholesale
china Wholesale
replica louis vuitton
cheapreplica louis vuitton handbagsfor sale
chanel handbags
gucci handbags
louis vuitton shoesfor wholesale
cheap and nicegucci shoesfor sale
different kinds ofshoes
chanel bagsfor sale
chanel handbagsfor discount
large number discountchanel

By lv on   3/18/2010 10:35 PM

hary This article is very good, describes some of the things I never know, there are many new things put in front of me, for example, a lot of valuable goods inside the Online Shop but others have no, there are several categories of shoes, a basketball su

hary
This article is very good, describes some of the things I never know, there are many new things put in front of me, for example, a lot of valuable goods inside the Online Shop but others have no, there are several categories of shoes, a basketball superstar Michael Jordan shoes:Air Jordan 3 III, Air Jordan 4 IV, By air-jordan on   4/12/2010 4:12 PM

These shoes made my trip to<a href="http://www.asicsforsale.com/asics-tiger-mexico-66-yellowblack-p-9.html"> <strong>onitsuka tiger mexico 66 yellow black</strong></a><strong></strong> Argentina that much more

These shoes made my trip to onitsuka tiger mexico 66 yellow black Argentina that much more enjoyable. I needed a pair of onitsuka tiger mexico 66 by asics shoes that I could walk great mens onitsuka tiger mexico 66 distances in and stand in for asics onitsuka tiger mexico 66 several hours at a time. These were my answer. They have great support, and give the feeling asics tiger mexico 66 that one is walking on air. They did get dirty, when we went rappelling. onitsuka tiger mini clubman Although you are not supposed to, I washed them on gently cycle in my front loader onituka tiger mini cooper washing machine. No harm, no foul. I highly recommend them.

By onitsuka tiger mexico 66 on   4/18/2010 1:06 AM

air-jordan

utopia
This article is very good, describes some of the things I never know, there are many new things put in front of me, for example, a lot of valuable goods inside the Online Shop but others have no, there are several categories of shoes, a basketball superstar Michael Jordan shoes:Women Jordans ,Kids Jordans ,Air Jordan Fusions ,Jordan Fusion III ,Jordan Fusion IV ,the famous gucci shoes:Gucci Outlet Store ,Gucci Outlet Online ,Gucci outletin,Gucci Shoes For Men ,Discount Gucci Shoes,and the coach shoesCoach Belts ,Coach Jewelry ,Coach Bracelet ,Coach Necklace ,Coach Earrings ,MBT VOI ,MBT Sport,etc., in short, very grateful to the author provides us with this information.

By air-jordan on   4/25/2010 6:17 PM

air-jordan

utopia
This article is very good, describes some of the things I never know, there are many new things put in front of me, for example, a lot of valuable goods inside the Online Shop but others have no, there are several categories of shoes, a basketball superstar Michael Jordan shoes:Women Jordans ,Kids Jordans ,Air Jordan Fusions ,Jordan Fusion III ,Jordan Fusion IV ,the famous gucci shoes:Gucci Outlet Store ,Gucci Outlet Online ,Gucci outletin,Gucci Shoes For Men ,Discount Gucci Shoes,and the coach shoesCoach Belts ,Coach Jewelry ,Coach Bracelet ,Coach Necklace ,Coach Earrings ,MBT VOI ,MBT Sport,etc., in short, very grateful to the author provides us with this information.

By air-jordan on   4/25/2010 6:18 PM

Re: Updating Statistics VS Recompiling Stored Procedures


Do you know Habbo credits?if you play online game,you will know Habbo Coins is the game gold.if you had more Habbo gold,you can had a tall level.but you want to buy Habbo Coins.you can come here and spend a little money to bought cheap Habbo credits.Quivkly come here.

By SIWON on   5/3/2010 6:17 PM

http://www.dearwatches.com

watches replica
replica watches
replica Montblanc watches

By replica watches on   5/4/2010 5:58 PM

http://www.dearwatches.com

watches replica
replica watches
replica Montblanc watches

By replica watches on   5/4/2010 5:59 PM

Re: Updating Statistics VS Recompiling Stored Procedures

chanel handbags on sale gucci handbags hot sale louis vuitton handbags sale louis vuitton cheap louis vuitton handbags high quality louis vuitton handbag louis vuitton lv louis vuitton replica gucci high quality gucci shoes for sale gucci handbags hot sale —— replica louis vuitton bags buy now louis vuitton bags on discount louis vuitton shoes on discount louis vuitton buy now gucci cheap now gucci bags very good gucci handbags very good gucci replica low price gucci replica handbags high quality gucci replica bags high quality —— gucci low price gucci bags buy now gucci handbags buy now gucci bag buy nows balenciaga free shipping balenciaga bags on sale balenciaga handbags on discounts louis vuitton handbags sale LV louis vuitton buy louis vuitton bags best ugg boots sale discount ugg boots hot sale ugg discount low price —— replica louis vuitton bag low price louis vuitton bag on discount louis vuitton wallets on discount chanel handbags buy now chanel bags low price chanel purses free shipping replica chanel on discount replica chanel bags on sale chanel handbags on discount Cheap Christian Louboutin Shoes to buy christian Louboutin shoes on sale christian Louboutin boots new arrive christian louboutin discount buy now

By DFG on   5/16/2010 6:52 PM

Re: Updating Statistics VS Recompiling Stored Procedures


Nice to Know. This is growing daily ..
Regards
replica handbags


[url=http://www.replicahandbagscheap.com/]replica handbags[/url]

By SDFSFSFSFDS on   5/17/2010 6:08 PM

Re: Updating Statistics VS Recompiling Stored Procedures


cheap authentic Louis Vuitton bags
LV Replica Handbags
Gucci
Buy Gucci Handbags
pandora jewellery
ghd hair straighteners uk

By liking on   5/17/2010 10:09 PM

Re: Updating Statistics VS Recompiling Stored Procedures

Birkenstock is the well-known German footwear brand. Birkenstock shoes, Birkenstock sandals and Birkenstock clogs all use environmentally-friendly process and proven craftsmanship, additionally, their unique design encourages overall human health.Representative products: Birkenstock Gizeh, Arizona and Boston clog,ect. Birkenstocks are crazily popular.

By discount birkenstock on   5/18/2010 10:50 PM

Re: Updating Statistics VS Recompiling Stored Procedures

If you find different DVD's containing episodes of "MURDER SHE WROTE DVD COLLECTION", be aware that they are NOT Universal MURDER SHE WROTE DVD Is!AND You can order the MURDER SHE WROTE DVD SET Is containing the entire Season One at Amazon.com (Area 1 DVD's): click here!

By wang on   5/21/2010 6:40 PM

air max 2009

When you attend all major sporting events,you can find many famous athletes have wear nike max shoes as womens air max shoes.air max shoes there a huge market anywhere in the world and many young people and people in almost all ages and sexes is faithful to air max+ 2009, because womens air max+ 2009,air max+ 2010,air max lebron VII shoes , air max 90,womens air max 97,nike air max 95,air max classic bw shoes,nike air max TN and womens air max 90 lived his name, all these years.The first line of Nike air max Shoes were launched in the year 1987 called air max 87.They are leading the world of athletic shoes.Welcome to nike air max store .In that ,maybe you can find some for you such as air max,nike free 5.0 shoe
,kids air max 90 shoes,nike air max ltd,womens air max 2012,kobe v shoes are more than mere footwear.They are actually a fashion statement.You can be sure that a NBA basketball shoe will be the most worn shoe in the summer.

By womens air max 2009 on   5/21/2010 9:32 PM

air max 2009

nike air max 90 and womens air max 90 were first released in 1990 and was known as the Air Max or the Air Max III until 2000 when Nike reissued these classic nike air max running shoes like nike air max tn shoes still extremely popular today. and now nike company have produce new air max running shoes,like nike air max 2009,womens air max 2009,nike air max 2010 and womens air max 2010,these air max shoes are produced with a Duromesh upper, synthetic suede, and synthetic leather.there are all breathe,durable and comfortable.on the air max running shoe site,you will buy all kinds of nike air max,include nike air max 95and womens air max 95 and so on.

By air max 2009 on   5/21/2010 9:32 PM

nike shox

Nike Shox has driven the sale upsurge online, the cheap Nike Shox has large sum of customers base. We provide Nike shox running shoes that occupy the sports shoe field for a long time, for example, Nike Shox r4 and Nike Shox NZ. Womens Nike Shox is also very pervasive as more and more women like to go out for sports now. Nike shox on sale with lower cost and advantages of flexible reaction to the customers are appreciated by our clients. Shox NZ and Shox r4 are our featured products with the best sale performance this season. Mens Nike shox are all very classy with unique design and comfortable materials. The new arrival white Nike shox is especially for this summer. Nike Shox R4 Torch with torch pattern is very eye-catching and slap-up. In addition, we also provide kids Nike shox, which is the optimal choice for your children as the gift

By nike shox on   7/5/2010 5:32 PM

vibram five finger

Had been thinking about Lindsey's new vibram fivefingers ever since she posted about them on this blog. When she first sent me a photo of these bizarre looking vibram five,I just laughed at their vibram fivefingers ridiculousness, thinking 'no way I'll ever put those things on my five finger feet!' But alas, once I saw them and read about them, I just couldn't stop thinking about them! I had to try them for myself. Last week I went to Blue five fingers Ridge Mountain Sports in Charlottesville, VA and tried on a pair of fivefingers kso. I tried both the Classics and the Sprints, but I liked the arch and heel support in the Sprints much vibram shoes better. Like my sister, I impulsively purchased a pair on the vibram five finger spot. Obviously I had to try them out right vibram finger away, so I mixed a little bit of walking and vibram five fingers running in since I had read many reviews explaining you need to vibram five fingers shoes gradually adjust your muscles to barefoot running.Running in these five fingers shoe is amazing. I actually am not a running fan, but these shoes make it feel more vibram five fingers fluid, light, and fun! After running/walking in them for the first two vibram kso days, I took a break to let my muscles vibram classic recuperate. This past weekend I broke them back out for some hiking and wouldn't you know, I fell even more in love with them. Although vibram flow walking over gravel in my Vibrams was a little vibram sprint uncomfortable, the rest of the hike was extremely fun and vibram fivefingers kso enjoyable. I am wanting to work out in my vibram 5fingers every day!Most of the vibram shoes sale, the fact that it is indeed more harm than good. The problem is that these shoes in order to “protect” in such a way that they should not be his leg. After the over-built five finger shoes muscles, tendons and ligaments of the lower limb atrophy conclusions. This is because your five fingers shoe do the work, your legs and feet should do.

By vibram five finger on   7/5/2010 11:00 PM

vibram five finger

Provincial Economic Commission vibram five Power Division official said, made the same power,vibram shoes , small thermal coal fivefingers five fingers consumption is 30% higher than the big unit to 50%. Because of small thermal vibram shoes power units with high energy consumption and serious pollution as vibram fingers energy saving under Jianfeng.Included in the scope of fivefingers kso Hubei Province, 33 sets of shutting down small thermal power vibram fivefingers units, mainly for the following unit capacity of 50,000 kilowatts of conventional thermal power, run for 20 years, single 100,000 kilowatts under fivefingers kso conventional thermal power units and so on.Shutting down small thermal power vibram finger will not affect the power supply situation in vibram fivefinger Hubei? The responsible person, Hubei five fingers vibram Province, the existing thermal power vibram five fingers installed capacity of 12.2 million kilowatts, the first half of this vibram five finger year, Jingmen Power Plant, Xiangfan Power Plant were put into a station will be 600,000 kilowatts of large five finger shoes units, this year’s summer peak load and annual can five finger guarantee basic electricity.Another problem with shoes is that they vibram five finger shoes encourage to run the wrong form. Your body is designed to run on the ball and your feet five finger death prospects. Try running around barefoot down, you feel high heels almost touching the ground. In contrast, most of the five fingers footwear will make you sit your heels, so you not only slow down,mbt shoes on sale, but will inevitably lead to knee and back pain five fingers classic, of course, can not achieve their vibram goals. They are kept clean and dry than bare feet foot,snug on the in-step, not to mention useful when a sharp stone or a nail under their feet.So how do five fingers flow athletes? Get with a model that simulates the benefits of a barefoot shoes five fingers sale.

By vibram five finger on   7/5/2010 11:00 PM

five fingers

Provincial Economic Commission vibram five Power Division official said, made the same power,vibram shoes , small thermal coal fivefingers five fingers consumption is 30% higher than the big unit to 50%. Because of small thermal vibram shoes power units with high energy consumption and serious pollution as vibram fingers energy saving under Jianfeng.Included in the scope of fivefingers kso Hubei Province, 33 sets of shutting down small thermal power vibram fivefingers units, mainly for the following unit capacity of 50,000 kilowatts of conventional thermal power, run for 20 years, single 100,000 kilowatts under fivefingers kso conventional thermal power units and so on.Shutting down small thermal power vibram finger will not affect the power supply situation in vibram fivefinger Hubei? The responsible person, Hubei five fingers vibram Province, the existing thermal power vibram five fingers installed capacity of 12.2 million kilowatts, the first half of this vibram five finger year, Jingmen Power Plant, Xiangfan Power Plant were put into a station will be 600,000 kilowatts of large five finger shoes units, this year’s summer peak load and annual can five finger guarantee basic electricity.Another problem with shoes is that they vibram five finger shoes encourage to run the wrong form. Your body is designed to run on the ball and your feet five finger death prospects. Try running around barefoot down, you feel high heels almost touching the ground. In contrast, most of the five fingers footwear will make you sit your heels, so you not only slow down,mbt shoes on sale, but will inevitably lead to knee and back pain five fingers classic, of course, can not achieve their vibram goals. They are kept clean and dry than bare feet foot,snug on the in-step, not to mention useful when a sharp stone or a nail under their feet.So how do five fingers flow athletes? Get with a model that simulates the benefits of a barefoot shoes five fingers sale.

By http://www.fivefingersale.com/ on   7/5/2010 11:52 PM

Vibram five fingers

For those of you who do not know vibram fivefingers of new shoe designed specifically for the operation, called Bikila named after Olympic champion Abebe Bikila, who won the race in 1960, the marathon, barefoot!It has the same design vibram five, that so many have won, but contains a little more traction on the ground, concrete runners understand.In any case, we have a word of Country Travel, provider of popular five finger.

By Vibram five fingers on   7/23/2010 7:46 PM

five fingers footwear

Vibram five fits like a glove covered hand. Shoes give an idea of how to guarantee a fully naked, with adequate protection in the field of security. Each five fingers are independent, Moscow, like a second skin, a real foot, Augloves Au.They very easy, so fans of his bare feet feel a great vibram shoes freedom.

By five fingers footwear on   7/23/2010 7:49 PM

Reebok ZigTech

Do you plan to buy the new Zig Pulse Shoes pieces ‘which claims to be’ on the energy drink for your feet? I do not see any of these in the future. You can watch a video of John Wall Mens ZigTech Shoes commercial below. Without being at the press conference announcement of the shoes.Everything about zig pulse women is designed to conserve and return energy to the athlete for a soft and springy stride. The one-of-a-kind Cheap Zigtech Shoesbottom unit features an innovative, lightweight foam that is engineered into a dramatic, geometric, Reebok ZigTech. This unique zig-zag sole absorbs the impact of heel strike and sends a wave of energy along the length of the shoe to help propel the athlete forward with each step.

By zigtechshoesonsale on   7/25/2010 7:39 PM

EasyTone Inspire

This technology is based on the well known “Reebok Zig pulse shoes” which are used in workouts and in many offices and Men's Reebok Zigtech as chairs that help improve your posture and build core strength. Everything about EasyTone Shoes is designed to conserve and return energy to the athlete for a soft and springy stride. The Easy Tone Shoes bottom unit features an innovative, lightweight foam that is engineered into a dramatic, geometric, EasyTone Inspire. This unique Cheap Zigtech Shoes sole absorbs the impact of heel strike and sends a wave of energy along the length of the Cheap Zigtech Shoes to help propel the athlete forward with Discount Reebok zigtech.

By zigtechshoesoutlet on   7/25/2010 7:40 PM

Your name:
Title:
Comment:
Add Comment    Cancel