Tag: modelling

The AskTOM data model

I popped out a tweet yesterday in Throwback Thursday style showing the date of the first question we took AskTOM – 18 years ago! Many entire computer systems don’t even last that long, and AskTOM hasn’t really needed to change that much in those…

Please keep your foreign keys

I came across an interesting blog post the other day about whether databases should be (declaratively) enforcing the foreign key relationships between tables.  The blog post discussed the issue of foreign keys being temporarily disabled to perform data loading, and then encountering the problem…

Data denormalization … another take

I read an interesting article the other day about data modelling and data denormalization. I’ll paraphrase the topic and requirement here (apologies to the original author for any omissions or excessive brevity). We have a fictional application with chat rooms, people subscribing to those…

Tightening up your data model

Having NOT NULL constraints declared on columns that are genuinely not nullable not only is good practice, but can yield performance gains. Here’s a little routine that lists those columns that probably need a NOT NULL constraint. It looks at all columns and check…

A justification for referential integrity constraints

Yes, I know what you’re thinking. “Here we go again.  Another database dude about to get stuck into us telling us about the importance of foreign keys for data integrity” and yes, I could easily do that.  But you’ve seen that before (and by…

Why I love working on AskTom

Today a question came in, and Swapnasis provided a nice simple test case, which makes my job so much easier.  Here’s a snippet from it SQL> create table TTT( 2 testid integer not null, 3 value integer not null, 4 time timestamp not null,…

Datatype discipline

(This is based on some ‘issues’ a client was having, so the example is architected to make a particular point, but is relevant nonetheless) In the distributed database world, we often have different names for the same piece of information. Consider two tables which…