PostgreSQL database with ~10,000 boolean states per row -


i'm @ bit of loss how design particular database. has following features:

  • expected 3 million+ rows corresponding 'users';
  • each 'user' has associated them ~10,000 unique boolean states;
  • these states sparse in nature, , additional states added in future, , shouldn't stored in ordered list;
  • the states updated frequently, @ rate of 20 in span of 2 hours, every 24 hours, on average per active 'user';

the obvious design have lookup table between users , states, i'm concerned not fast enough, when looking states per user, expected 5 billion+ rows in lookup table.

any advice appreciated.

i create relation between 2 tables

-------------------------------------------------- | id | username                                  | -------------------------------------------------- | 1  | bl-ro                                     | -------------------------------------------------- | 2  | darkmukke                                 | -------------------------------------------------- 

and relation bools

-------------------------------------------------- | id | fk_user | bool                            | -------------------------------------------------- | 1  | 1       | true                            | -------------------------------------------------- | 2  | 1       | false                           | -------------------------------------------------- 

Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -