Add `counts.enterprise_users` metric
What does this MR do and why?
This MR adds counts.enterprise_users
metric to understand the adoption of Enterprise Users.
Related to #383140 (closed)
DB Query Plan
SELECT COUNT("user_details"."user_id") FROM "user_details" WHERE "user_details"."enterprise_group_id" IS NOT NULL;
https://console.postgres.ai/gitlab/gitlab-production-main/sessions/24686/commands/78528
This query uses index_user_details_on_enterprise_group_id_and_user_id
.
I've considered adding new specific to this query index:
CREATE INDEX index_user_details_on_user_id_for_enterprise_users ON user_details USING btree (user_id) WHERE (enterprise_group_id IS NOT NULL);
but I don't see any improvements, see https://console.postgres.ai/gitlab/gitlab-production-main/sessions/24686/commands/78535.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Bogdan Denkovych