Top Quality Users query always empty


We are trying to run the Top Quality Users query in data explorer. Whatever we try, the number of results is always empty

The query is here:

I tried removing the conditions for the user (u.admin, etc.) but still nothing

The query plan is here as well:

Limit (cost=191.87…191.92 rows=20 width=24)
→ Sort (cost=191.87…191.92 rows=20 width=24)
Sort Key: ((sum(p.score) / (count(p.*))::double precision)) DESC
→ HashAggregate (cost=190.58…191.43 rows=20 width=24)
Group Key: p.user_id, u.views
Filter: (count( > 50)
→ Hash Join (cost=8.79…177.19 rows=893 width=1055)
Hash Cond: (p.user_id =
→ Seq Scan on posts p (cost=0.00…165.80 rows=960 width=1051)
Filter: (created_at >= (CURRENT_DATE - ‘P6M’::interval))
→ Hash (cost=7.29…7.29 rows=120 width=8)
→ Seq Scan on users u (cost=0.00…7.29 rows=120 width=8)
Filter: ((NOT admin) AND active)

Should this query be working @tshenry? We ship it by default?

1 Like

So there are a few things to unpack here.

  1. This is a fork of the official data explorer plugin
  2. The query appears twice in that file, the first time including u.blocked which does not exist anymore as mentioned in the comment at the end of the snippet in the OP
  3. We do ship a version of the query in the official plugin

@David_Abitbol you will either want to reach out to the maintainer of that fork, or ideally switch to using the official version at GitHub - discourse/discourse-data-explorer: SQL Queries for admins in Discourse

1 Like

Thanks Taylor.

We are using the Saas version so I don’t know if it’s available. In any case, I’ll go find the query. Thanks!