Original query:

  AuthenticationEvent Load (0.6ms)  SELECT DISTINCT "authentication_events"."provider" FROM "authentication_events"
   (0.4ms)  SELECT MIN("authentication_events"."user_id") FROM "authentication_events" WHERE "authentication_events"."provider" = $1 AND "authentication_events"."created_at" BETWEEN $2 AND $3  [["provider", "ldap"], ["created_at", "2020-08-12 19:05:45.606188"], ["created_at", "2020-09-09 19:05:45.606328"]]
   (0.3ms)  SELECT MAX("authentication_events"."user_id") FROM "authentication_events" WHERE "authentication_events"."provider" = $1 AND "authentication_events"."created_at" BETWEEN $2 AND $3  [["provider", "ldap"], ["created_at", "2020-08-12 19:05:45.606188"], ["created_at", "2020-09-09 19:05:45.606328"]]
   (0.3ms)  SELECT COUNT(DISTINCT "authentication_events"."user_id") FROM "authentication_events" WHERE "authentication_events"."provider" = $1 AND "authentication_events"."created_at" BETWEEN $2 AND $3 AND "authentication_events"."user_id" BETWEEN $4 AND $5  [["provider", "ldap"], ["created_at", "2020-08-12 19:05:45.606188"], ["created_at", "2020-09-09 19:05:45.606328"], ["user_id", 1], ["user_id", 10000]]