Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Expense Computed column or trigger
Message
De
15/08/2006 13:24:45
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01145568
Message ID:
01145662
Vues:
16
>A conversation cam up on which is more expensive to the db a computed column or a trigger.
>
>Example was simple Subtract col 4 from col 3. They were non nullable.
>
>So is a trigger more expensive to run vs. a computed column?
>
>My WAG was the CC.
>
>Any takers with some proof? My googles came up with Oracle and DB2 references :(
>
>__Stephen

Stephen,

It seems to me that the fact that a simple computed column is less expensive than a trigger is self-evident. To run a trigger, SQL Server has to set up a private context for the code, including the INSERTED & DELETED tables. Then the trigger code has to be executed and the environment cleaned up.

There has to be at least 100x more work for the server to run a trigger than to compute a column.

You might want to do a search at sql-server-performance.com to see if there is an article or forum post that can help you to substantiate the claim.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform