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

  • SEARCH
  • Home
  • 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 447431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:34:11+00:00 2026-05-12T21:34:11+00:00

I was wondering about this. Let’s say I need to store in a datawarehouse

  • 0

I was wondering about this. Let’s say I need to store in a datawarehouse the data for several measures vs time:

t |  x'
-------
1 |  20
2 |  50
3 |  30


t |  x''
-------
3 |  23
4 |  56
6 |  28

and so on..

t |  x''n
-------
5 |  35
6 |  92
7 |  23

If I need to build some large fact table composing the previous data in ways not yet defined, what can be more efficient (in whatever sense), to have a large table storing everything or to have separate tables like I depicted?

t |  x' |  x''
----------------
1 |  20 |
2 |  50 |
3 |  30 | 23   ...
4 |     | 56
5 |     | 28
6 |     | 
7 |     | 
  • 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-05-12T21:34:11+00:00Added an answer on May 12, 2026 at 9:34 pm

    If you’re talking about having a dynamic number of columns (i.e. adding a new column each time you add another x”n), this is really not the relational database way of doing things. Adding a column to a large table is a very inefficient operation. Depending on your RBDMS, it may actually copy and recreate the entire table when you do that. Dynamically creating new tables is faster but still not as fast as inserting rows which is where relational databases really perform at their best. Basically what I’m saying is that you want your database schema to be static (or rarely changing). All the dynamic operations should be purely row based.

    Perhaps what you really want is one table something like this:

    t  | x  | prime
    ---+----+------
    1  | 20 | 1
    2  | 50 | 1
    3  | 30 | 1
    3  | 28 | 2
    4  | 56 | 2
    6  | 28 | 2
    5  | 35 | 3
    6  | 92 | 3
    7  | 23 | 3
    

    Be sure to create indexes on the columns that will appear in WHERE clauses in your queries (or maybe some strategic compound indexes depending on how exactly you will query the table). Also, it’s good practice to have a primary key column as the first column of every table because it will give you unique handles on individual rows if you need to update or delete them. I’ve left off the primary key in my above sample for simplicity in illustrating my point.

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

Sidebar

Related Questions

I've been wondering about this problem for some time - doubleclicking a winforms TabControl's
Just wondering about some practice about this; I have made a simple visual C#
I am wondering about fetching records using Model.get_by_key_name() vs Model.get_by_id() For example, let's say
Just wondering about this code below... when I turn off my internet connection and
I been wondering about this for a while. It seems like there are so
i'm wondering about this possibility. Is it possible to make our code written in
I am wondering about the performance of this index: I have an Invalid varchar(1)
I'm wondering about the feasability of this below. Of course, I'm not asking for
I've always wondered about this, and now a client is wondering whether it's feasable:
I'm wondering how to go about testing this. I have a method that takes

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.