What is the role of a cluster?
A cluster basically pre-joins two or more tables. These tables are joined on some key field(s). This is called the "cluster key". So for a cluster, a row from Table A is physically stored next to it's join partner from Table B. So conceptually, a cluster might look something like this:
Table A Table B Name ID City ----- --- -------- Bob 1 Denver Joe 2 Chicago Sue 3 Dallas
If they were not stored in a cluster, the two tables would look like:
Table A Table B Name ID ID City ----- --- --- -------- Bob 1 1 Denver Joe 2 2 Chicago Sue 3 3 Dallas
These are two separate tables here. You can clearly see the join key (ID column). Why store tables clustered together? For improved performance of queries that join two tables together. Hopefully, this is done on two tables that almost always get joined on the same column. This way, the join is predone for you. If the tables were separate, then they would have to be joined. Normally, clusters are on very big tables that get joined together often on the same key column. Why not use a cluster? What happens if you need just the contents of table A from the cluster? You have to read the contents of table B as well. This can cause a performance problem for those queries that query just one of the tables. So there is a trade off here.
For More Information
- What do you think about this answer? E-mail the Edtior at firstname.lastname@example.org with your feedback.
- The Best Oracle Web Links: tips, tutorials, scripts, and more.
- Have an Oracle or SQL tip to offer your fellow DBA's and developers? The best tips submitted will receive a cool prize--submit your tip today!
- Ask your technical Oracle and SQL questions--or help out your peers by answering them--in our live discussion forums.
- Ask the Experts yourself: Our SQL, database design, Oracle, SQL Server, DB2, metadata, and data warehousing gurus are waiting to answer your toughest questions.
Dig Deeper on Oracle database design and architecture
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.