search_queries table

The search_queries table in the Reddit Clone Database Schema schema has 8 columns, keyed by id, with 2 foreign keys to users and subreddits.

clicked_position is the relevance feedback signal: a search with results and no click is the one worth investigating.

Columns (8)

Columns of the search_queries table
ColumnTypeConstraintsDescription
iduuidprimary key
user_iduuidreferences users.id
queryvarchar(500)not null
scopesearch_scopenot null
subreddit_iduuidreferences subreddits.id
result_countintegernot null
clicked_positionsmallint
searched_attimestamptznot null

Indexes (2)

  • (user_id, searched_at)
  • (query)

Relationships