Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9026363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:30:04+00:00 2026-06-16T06:30:04+00:00

We’ve got a data warehouse design with four dimension tables and one fact table:

  • 0

We’ve got a data warehouse design with four dimension tables and one fact table:

  • dimUser id, email, firstName, lastName
  • dimAddress id, city
  • dimLanguage id, language
  • dimDate id, startDate, endDate
  • factStatistic id, dimUserId, dimAddressId, dimLanguageId, dimDate, loginCount, pageCalledCount

Our problem is: We want to build the fact table which includes calculating the statistics (depending on userId, date range) and filling the foreign keys.

But we don’t know how, because we don’t understand how to use natural keys (which seems to be the solution to our problem according to the literature we read).

I believe a natural key would be the userId, which is needed in all ETL jobs which calculate the dimension data.

But there are many difficulties:

  • in the ETL jobs load(), we do bulk inserts with INSERT IGNORE INTO to remove duplicates => we don’t know the surrogate keys which were generated
  • if we create meta data (including a set of dimension_name, surrogate_key, natural_key) this will not work because of the duplicate elimination

The problem seems to be the duplicate elimination strategy. Is there a better approach?

We are using MySQL 5.1, if it makes any difference.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T06:30:05+00:00Added an answer on June 16, 2026 at 6:30 am

    If your fact table is tracking logins and page calls per user, then you should have set of source tables which track these things, which is where you’ll load your fact table data from. I would probably build the fact table at the grain of one row per user / login date – or even lower to persist atomic data if at all possible.

    Here you would then have a fact table with two dimensions – User and Date. You can persist address and language as dimensions on the fact as well, but these are really just attributes of user.

    Your dimensions should have surrogate keys, but also should have the source “business” or “natural” key available – either as an attribute on the dimension itself, or through a mapping table as your colleague suggested. It’s not “wrong” to use a mapping table – it does make things easier when there are multiple sources.

    If you store the business keys on a mapping table, or in the dimension as an attribue, then for each row to load in the fact, it’s a simple lookup (usually via a join) against the dim or mapping table to get the surrogate key for the user (and then from the user to get the user’s “current” address / language to persist on the fact). The date dimension usually hase a surrogate key stored in a YYYYMMDD or other “natural” format – you can just generate this from the date information on your source record that you’re loading into the fact.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I want to construct a data frame in an Rcpp function, but when I
I'm making a simple page using Google Maps API 3. My first. One marker
Let's say I'm outputting a post title and in our database, it's Hello Y’all
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.