Skip to main content

New answers tagged

1 vote

Should I break a large user table into smaller tables for specific roles and information?

For "thousands", splitting (or not) will make little difference to performance. Even for millions, it may not matter. For maintainability and performance, let's see the main queries. JSON ...
Rick James's user avatar
  • 79.4k
0 votes

Database architecture with extension in mind

Relational database management systems expect well-defined data structures - the "relations" in the name. So having runtime-variable needs is a known hard problem. That said, most recent ...
Michael Green's user avatar
1 vote

Database architecture with extension in mind

You could use a non-relational database to store this kind of data. For example, in mongoDB you could have a games collection. Then in your application code, you might have multiple data models: ...
Shahram's user avatar
  • 11
1 vote

Must fact tables be designed for aggregation?

The column list for every fact table I have ever made has been of the form "primary key followed by several dimension columns, followed by every bit of info we store about the primary key"......
J.D.'s user avatar
  • 39.5k
1 vote

Table structure with multiple foreign keys and values

A little more traditional :) Have a list of objects combining Foo and Bar: create table Objects ( oid primary key, type check('Foo', 'Bar'), ); create table Foo ( id references Objects(oid), name)...
White Owl's user avatar
  • 959
0 votes

How to handle the deletion of records with "shared ownership"?

I think I agree with @Charlieface In a real world scenario (and from my personal experience) you can easily delete when thy are single tenant but it gets messy in a multi tenant scenario. And in my ...
Francesco Mantovani's user avatar
9 votes

Table structure with multiple foreign keys and values

Neither of these options are good. Not properly normalized. Normalization is violated because you would need to repeat the package data once for each joining row. You can never be sure which row ...
Charlieface's user avatar
  • 14.4k
4 votes

Table structure with multiple foreign keys and values

A more traditional approach: select * from packages_tables ; +------+------+----+ | pkg | Tipe | id | +------+------+----+ | pkg1 | Foo | 1 | | pkg2 | Bar | 1 | | pkg2 | Bar | 2 | | pkg3 | ...
Phill  W.'s user avatar
  • 9,480
0 votes

What value should I choose as length for timestamp without timezone in PostgreSQL?

By all means, use timestamptz instead! timestamp (w/o timezone) stores a date and time for a calendar and a clock. timestamptz (w/ timezone) stores a point in time, the EPOCH. It does not store the ...
comonad's user avatar
  • 101
1 vote

Could a Tool Like ChartDB Work for MongoDB Schema Visualization?

If there is an array inside an object that's a one-to-many relationship. One could build an ER diagram accordingly. A logical data model is different to a physical DB design. The tool could be useful ...
Michael Green's user avatar

Top 50 recent answers are included