Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««678910

A Check and Foreign Key Constraint Improves Query Performance Expand / Collapse
Author
Message
Posted Monday, December 9, 2013 2:49 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Sunday, August 3, 2014 10:22 PM
Points: 97, Visits: 324
Great Article !
Suppose I create some other type of constraint on table like allow only numeric then how will this type of constraint affect performance ?

Suppose I create computed column on table.Then how it will affect performance .

So I have ask 2 question .

Thanks.


Regards
Kumar Harsh

Post #1520970
Posted Monday, December 9, 2013 3:36 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 3:51 PM
Points: 36,959, Visits: 31,469
pandeharsh (12/9/2013)
Great Article !
Suppose I create some other type of constraint on table like allow only numeric then how will this type of constraint affect performance ?

Suppose I create computed column on table.Then how it will affect performance .

So I have ask 2 question .

Thanks.


No one will know for sure. You must test it in your environment.

As to the computed column, if you persist the column, then performance will likely be better because because it will be recalculated only for inserts or updates of the related columns and not for reads as a non-persisted computed column would be.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1521329
« Prev Topic | Next Topic »

Add to briefcase «««678910

Permissions Expand / Collapse