FK's...do they improve query performance

  • Hi

    if we implement FK relationships in SQL will this improve query response time?

    This a reporting database ...we are not concerned with referential integrity.

    Thanks for reading

    Graham

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • Maybe. They're not indexes and as such they won't directly improve performance. They do give the optimiser more information about the data hence allowing it to produce better execution plans

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thank you Gail.

    I thought as much, but needed some clarification.

    Will probably create them now anyway as they will assist other users in understanding the schemas.

    Graham

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • it really depends on the query, and if you have indexes on the FK's. The optimizer will consider, and for reporting, return speed is important. If you do use FK's, make sure you review your indexes.

    The more you are prepared, the less you need it.

Viewing 4 posts - 1 through 3 (of 3 total)

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