Skip to content

add an index to the ghost column

username-removed-28993 requested to merge perf/add-index-to-user-ghost into master

What does this MR do?

Adds an index to the :ghost column for users.

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

Only one user ever has :ghost set to true, and we look that up using User.ghost pretty frequently. Without an index, this will perform a full table scan.

Bookmarking for later: if we begin to add more categories of users in this way, I suggest we refactor out to a single record in a dedicated table, say global_entities, that has a column for each unique user/other entity.

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Merge request reports