Solved

PK and Indexes DW Database

Posted on 2011-02-24
2
339 Views
Last Modified: 2016-02-15
We have a SQL Server 2008 R2 database that supports the Datawarehouse. I have noticed that it does not have primary key or clustered indexes for more than 70% of tables.

The DB is around 90 GB with some huge tables which did not have primary key or clustered indexes.

Can you please guide me through the optimal practices for this DW setup with respect to Indexes and PK's.

Thanks,
0
Comment
Question by:rocky_lotus_newbie
2 Comments
 
LVL 9

Accepted Solution

by:
rajeevnandanmishra earned 250 total points
ID: 34969987
Hi,
Normally DW databases are not having the PK/FK and Custered Indexes.

The PK/Clustered Indexes are normally created in an OLTP databases where the data is quite less comparatibly and a fast retrieval is required. As the clustered index will change the physical layout of the table, so it will not have big impact in the OLTP database.
But in DW databases, If we have clustered index and it changes, then the whole (very very large table need to be changed as per the index). This is basic idea for not having the CI on big tables.


0
 
LVL 40

Assisted Solution

by:lcohan
lcohan earned 250 total points
ID: 34970859
You should optimize your OLTP/OLAP/DW databases for IO operations as needed by your applications.

CLUSTERED indexes may be indeed painful for INSERTS and DELETES of large volumes however they ensure fresh/updated statistics on tables so less indexing is required. Also they may be your best choice for partitioning large objects in your DW database.  This is valid from SQL 2000 to curent 2008.

PK and FK may not be required in your OLAP/DW dbs as your data integrity should have been checked alreay in your OLTP however purges/deletes/archiving may leave orphans in your DB's if not correctly done.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
push and Pull replication 31 47
SQL Server 2008 R2 service pack updates 5 45
SQL Add Parameter in Variable 4 21
SQL query 7 15
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question