BigBear.ai
  • Home
  • Industries
    • Academia
    • Government
    • Healthcare
    • Manufacturing
  • Solutions
    • AI Capabilities
    • Cyber
    • Data Analytics
    • Enterprise Planning and Logistics
    • Intelligent Automation
    • Modeling Solutions
    • Professional Services
  • Products
    • FutureFlow Rx
    • MedModel
    • Process Simulator
    • ProModel
    • ProModel AutoCAD Edition
    • Shipyard AI
    • Support
  • Company
    • About
    • Investor Relations
    • Partners
    • Team
  • Careers
    • Benefits
    • Culture
    • Explore Jobs
    • Military and Veterans
    • Applicant Login
    • Employee Login
  • Resources
    • Blog
    • Events
    • Newsroom
    • Resource Library
    • Online Store
  • Contact
Search

Home Data Modeling Degenerate Dimensions – Deep Dive

Blog

Degenerate Dimensions – Deep Dive

Jim McHugh
May 20, 2020
  • Share
  • Share

In this blog post, a part of my deep dive series, I will focus on Degenerate Dimensions in this post.

When introducing the concept of dimensional modeling, I like to compare it to the English language. I start with dimensions, which are essentially nouns (person, places, things, concepts, or ideas). The dimensions are containers of adjectives, describing the dimension (noun). Facts are actions (verbs) that connect two or more dimensions.

Degenerate Dimensions, as the name implies, are those dimensional attributes that lack the distinctness of structure found in regular dimensions. Degenerate dimensions are those attributes that do not fit into any single dimension table and, therefore, only exist as a key value in a fact table used for filtering queries. This is somewhat contrary to dimensional modeling, and therefore we need to understand the reason for the degenerate dimension and when we should use this concept.

Let’s review the definition I have provided above. First, degenerate dimensions are dimensional attributes. That means these attributes are descriptive of a dimension and can be used to filter the fact table. The next part of the definition, that lacking the distinctness of structure, is where we see the separation from a typical dimensional attribute. A revised way to look at this is everything about the degenerate dimension is contained in the attribute; therefore, it would be a dimension table with a single key attribute. Finally, the definition includes by stating it is used in fact tables for filtering, grouping, and sorting. As we can see, this attribute is needed in the fact table because it provides all of the abilities a normal dimensional attribute allows.

FACT-ORDER
Figure 1.

Believe it or not, Degenerate Dimensions are relatively common and occur in the most basic of dimensional models. Let’s look at the conceptual data model for an order/invoice. For a purchase, we would have a Customer (dimension) who placed an Order (fact) via an Invoice (dimension) for a Product (dimension) (see figure 1.)

From a conceptual point of view, we are fine. It all works as planned, no issues.

Let’s move to a logical model (see figure 2.)

FACT-ORDER-DTL-500x475-1
Figure 2.

OK, I can easily define the customer and product dimensions, but I have a challenge finding attributes for the invoice dimension. All I could come up with is the Invoice Number and an Invoice Line Number. Well, that would make the dimension as deep as the fact table, so what value is a dimension with attributes that cannot live outside the fact? Answer: none. Therefore, I need to consolidate the Invoice Number and an Invoice Line Number into the Order fact as degenerate dimensions (figure 3.)

 FACT-ORDER-DTL-DD-456x500
Figure 3.

Now that I have moved the Invoice Number and an Invoice Line Number into the fact, I see that I have reached an optimal solution to my modeling challenge. I can still easily find all of the sales by customer and product. I can also easily filter, group, and sort what was purchased together in a single transaction via the invoice number.

Let’s look at another example. A long time ago, I worked for a large insurance company. As we all know, insurance companies sell policies on which claims are made. When we modeled out the requirements conceptually, we had something like this for an insurance claim (figure 4.)

FACT-CLAIM-CONCEPTUAL
Figure 4.

But when we moved to a logical perspective, we modeled it this way (figure 5.)

FACT-CLAIM-LOGICAL
Figure 5.

As you can see, the claim dimension is a degenerate dimension because everything we want to associate with the claim is found in the fact, leaving the claim dimension with only a claim number. We decided to model it this way because we didn’t want to snowflake claim type from the claim dimension. That left us with only a claim number in each of these dimensions; therefore, we made this attribute a degenerate dimension. Our decision to use a degenerate dimension provided for faster query response.

In conclusion, Degenerate Dimensions are references to the operational world and are useful in filtering, grouping, and sorting facts. You always need to be careful when implementing degenerate dimensions and follow the process I describe above. Remember, degenerate dimensions are not a panacea, and the misuse of degenerate dimensions can lead to unnecessary use of space and poor performing queries.

Posted in Data Modeling, Data Warehousing.
BigBear.ai
  • Home
  • Industries
  • Solutions
  • Products
  • Company
  • Careers
  • Blog
  • Investor Relations
  • Online Store
  • Contact
  • Twitter
  • Facebook
  • Linkedin
  • Google My business for BigBear.ai
1-410-312-0885
[email protected]
  • Privacy Policy
  • Terms of Use
  • Accessibility
  • Site Map
© BigBear.ai 2023
We value your privacy
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Privacy Policy | Do not sell my personal information
AcceptCookie Settings
Manage Consent

Cookies Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
JSESSIONIDsessionThe JSESSIONID cookie is used by New Relic to store a session identifier so that New Relic can monitor session counts for an application.
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
CookieDurationDescription
__atuvc1 year 1 monthAddThis sets this cookie to ensure that the updated count is seen when one shares a page and returns to it, before the share count cache is updated.
__atuvs30 minutesAddThis sets this cookie to ensure that the updated count is seen when one shares a page and returns to it, before the share count cache is updated.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
CookieDurationDescription
_ga2 yearsThe _ga cookie, installed by Google Analytics, calculates visitor, session and campaign data and also keeps track of site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognize unique visitors.
_ga_NK4L4Q320Q2 yearsThis cookie is installed by Google Analytics.
_gat_gtag_UA_163894009_21 minuteSet by Google to distinguish users.
_gid1 dayInstalled by Google Analytics, _gid cookie stores information on how visitors use a website, while also creating an analytics report of the website's performance. Some of the data that are collected include the number of visitors, their source, and the pages they visit anonymously.
at-randneverAddThis sets this cookie to track page visits, sources of traffic and share counts.
CONSENT2 yearsYouTube sets this cookie via embedded youtube-videos and registers anonymous statistical data.
uvc1 year 1 monthSet by addthis.com to determine the usage of addthis.com service.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
CookieDurationDescription
f5avraaaaaaaaaaaaaaaa_session_sessionbusinesswire.com cookie
loc1 year 1 monthAddThis sets this geolocation cookie to help understand the location of users who share the information.
VISITOR_INFO1_LIVE5 months 27 daysA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.
YSCsessionYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.
yt-remote-connected-devicesneverYouTube sets this cookie to store the video preferences of the user using embedded YouTube video.
yt-remote-device-idneverYouTube sets this cookie to store the video preferences of the user using embedded YouTube video.
Save & Accept