June 4, 2010 at 3:29 pm
Is there an advantage to not including keys built into the databases?
I am working a 1.2 tb data warehouse. All the relationships are in an SSAS view.
Is there a performance increase by building the database like this?
June 4, 2010 at 3:56 pm
June 4, 2010 at 3:57 pm
Keys are for keeping data integrities. On fact tables, usually dimension fields are foreign keys to dimention tables. They should not have performance impact.
Indexes will help the search performance but slow down the ETL processes. Some ETL processes remove the indexes before data loading and add indexes back after the loading.
June 4, 2010 at 3:59 pm
Agreed with the others here. Keys are about integrity. Performance is index related.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
June 4, 2010 at 4:09 pm
To add an "it depends" opinion:
I've read that there are cases when a PK-FK relation will help the query analyzer to come up with a more efficient plan. No sample code to prove it though...
Other than that, I second the statements from above.
June 4, 2010 at 4:22 pm
thx
June 4, 2010 at 4:23 pm
You're welcome.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
June 4, 2010 at 6:09 pm
lmu92 (6/4/2010)
To add an "it depends" opinion:I've read that there are cases when a PK-FK relation will help the query analyzer to come up with a more efficient plan. No sample code to prove it though...
That's true. I do not have hard proof of it on SQL Server but I do have hard proof of it on Oracle environment.
FK constraints - if enabled - do have a negative impact in performance, they add the overhead of checking if there is or not a parent key but, if not enabled overhead is not longer there but still tells rdbms that there is a relationship in between those two tables, on that particular column.
Particularly for Data Warehouse environments Oracle relies on FK's defined as disable-rely-novalidate to enable "star transformation" feature which takes advantage of what Oracle calls bitmap indexes.
Sorry for the paragraph before, just wanted to make the point rdbms have the ability to take advantage of FKs even if disabled. 🙂
_____________________________________
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at Amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply