PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.sqlserver.server > newbee needs sp:recompile
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
newbee needs sp:recompile

Réponse
 
LinkBack Outils de la discussion
Vieux 15/07/2008, 06h22   #1
Danny Ni
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut newbee needs sp:recompile

Hi,

When I ran SQL Profile on one of SQL 2005 server, it captured a lot of
sp:Recompile ( 2 Statistics changed) anf they all belong to the same
statement in the same SP. The statement is just a SELECT statement join 3
table and a temp table, could the statistics of one joined table out of
sync? How do I make sure that's the case and how do I reset?

TIA



  Réponse avec citation
Vieux 15/07/2008, 08h31   #2
Uri Dimant
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: newbee needs sp:recompile

Danny
http://www.microsoft.com/technet/pro...05/recomp.mspx



"Danny Ni" <dndn@yahoo.com> wrote in message
news:u6k1hJj5IHA.4364@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> When I ran SQL Profile on one of SQL 2005 server, it captured a lot of
> sp:Recompile ( 2 Statistics changed) anf they all belong to the same
> statement in the same SP. The statement is just a SELECT statement join 3
> table and a temp table, could the statistics of one joined table out of
> sync? How do I make sure that's the case and how do I reset?
>
> TIA
>
>
>



  Réponse avec citation
Vieux 15/07/2008, 14h45   #3
Dan Guzman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: newbee needs sp:recompile

> When I ran SQL Profile on one of SQL 2005 server, it captured a lot of
> sp:Recompile ( 2 Statistics changed) anf they all belong to the same
> statement in the same SP. The statement is just a SELECT statement join 3
> table and a temp table, could the statistics of one joined table out of
> sync? How do I make sure that's the case and how do I reset?


Below is a relevant excerpt from the article Uri posted. I suggest you
consider a table variable instead of temp table if the recompilations are
causing you pain.

"Best Practice: Because a change in cardinality of a table variable does not
cause recompilations, consider using a table variable instead of a temporary
table. However, because the query optimizer does not keep track of a table
variable's cardinality and because statistics are not created or maintained
on table variables, non-optimal query plans might result. One has to
experiment whether this is the case, and make an appropriate trade-off."

--
Hope this s.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/

"Danny Ni" <dndn@yahoo.com> wrote in message
news:u6k1hJj5IHA.4364@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> When I ran SQL Profile on one of SQL 2005 server, it captured a lot of
> sp:Recompile ( 2 Statistics changed) anf they all belong to the same
> statement in the same SP. The statement is just a SELECT statement join 3
> table and a temp table, could the statistics of one joined table out of
> sync? How do I make sure that's the case and how do I reset?
>
> TIA
>
>
>


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 04h22.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09925 seconds with 11 queries