Metabase weird query

Hi,

I was checking the pg_stat_activity table in our Postgres database.
I found a weird query which is run by Metabase.

-- Metabase
SELECT "public".<TABLE_NAME>.<COLUMN> AS "column" FROM "public".<TABLE_NAME> GROUP BY "public".<TABLE_NAME>.<COLUMN> ORDER BY "public".<TABLE_NAME>.<COLUMN> ASC LIMIT 1000

This query has been running on multiple tables. I am wondering whether it is triggered by our user or the Metabase backend for some scanning purpose?

We just encountered a case that such query has been run for multiple times and still being active in the database for more than 6 hours. Normally it should return a timeout error if the user tries to run a query which lasted for more than 1 minute which is restricted by our load balancer.

In addition, is there anyway an admin can check the query activity of each user in Metabase?

Thanks.

That's a query that Metabase uses for fingerprinting. I suggest you take a look at settings->admin->databases->advanced options to configure this process tailored to your needs.

The way to check for user activity is via the Audit feature that Metabase has on Pro and enterprise licenses.