Metabase - how to find question id or dashboard id from queryHash

1k Views Asked by At

We are using Metabase to query Amazon Redshift DB.
In AWS UI queries section I can see Metabase user ID and corresponding queryHash.

-- Metabase:: userID: 201 queryType: native queryHash: e0f499f3bc109a46cdf4e686fa06fb6379ec01265640ecc3f45365349b7c6e3f

Now, I have to find out what is the question id and dashboard id for this queryHash? Is this possible, If yes how?
Thanks in Advance!!

1

There are 1 best solutions below

0
On

The simplest way that I found was by querying Metabase database. QueryHash column can be found in query and query_execution tables. It seems that only query_execution table has a reference to question/card.

SELECT 
    card_id
FROM
    query_execution
WHERE
    ENCODE(hash, 'hex') = 'e0f499f3bc109a46cdf4e686fa06fb6379ec01265640ecc3f45365349b7c6e3f'