Re: How to represent variable data types?
- From: Ed Prochak <edprochak@xxxxxxxxx>
- Date: Mon, 5 Jan 2009 05:52:05 -0800 (PST)
On Jan 3, 5:57 pm, bukzor <workithar...@xxxxxxxxx> wrote:
In my application we have a data structure that comes in four flavors:
double, integer, string, and timestamp. To store it in our database,
so far we've used four separate tables (values_d, values_i, ...). This
works OK, but means that we need to do every query four times if we
don't know the data type we're looking for (the usual case).
I'm working on refactoring the database this week, and notice that my
double, string, and timestamp tables have very few unique values,
meaning that I could save disk space (and possibly query time) if I
normalize the data out of those tables. Once that's done, all my
values_* tables have the exact same signature, making me wonder if
they couldn't be consolidated into one table.
Any suggestions?
Has anyone solved this problem before?
--Buck
Sounds to me like you are mapping some programming construct (like a C
union{} ) onto the database.At first glance this seems a bad idea.
Ed
.
- References:
- How to represent variable data types?
- From: bukzor
- How to represent variable data types?
- Prev by Date: Re: How to represent variable data types?
- Next by Date: DBMS recommendation?
- Previous by thread: Re: How to represent variable data types?
- Next by thread: Re: How to represent variable data types?
- Index(es):
Relevant Pages
|