users table

The users table in the Forum Database Schema schema has 11 columns, keyed by id. 13 columns in user_badges, topics, posts, post_revisions and 5 more reference it.

reputation and post_count are caches rebuildable from votes and posts. The reputation index is what makes a leaderboard cheap.

Columns (11)

Columns of the users table
ColumnTypeConstraintsDescription
iduuidprimary key
usernamevarchar(40)unique, not null
emailvarchar(255)unique, not null
display_namevarchar(80)
avatar_urlvarchar(500)
signaturevarchar(500)
reputationintegernot null
post_countintegernot null
statususer_statusnot null
joined_attimestamptznot null
last_seen_attimestamptz

Indexes (2)

  • (status, reputation)
  • (last_seen_at)

Relationships