Finding queries that utilize a specific table

Good afternoon,

I have a table I need to replace with a different table in all saved queries. Is there any way to query or search for the queries that reference this table? Thank you.

Hi @saaballergies

You can find all GUI questions that uses a specific table by going to Browse data > click "Learn about our data" in upper-right (/reference/databases) > select database > click "Tables in ..." in menu > select table > click "Questions about this table" in menu.

For SQL questions you would either have to use the search, or look in the Metabase application database table report_card.dataset_query

2 Likes

Can we make the report_card accessible from within the UI for read-only?
Or is it possible to just add the Metabase application DB to Metabase as a connection?

It’s tentatively coming in 47

1 Like

You guys are awesome. I hope you all know that.

It’s not coming in v47, might come later

1 Like

Hi, it used to be possible to search for the tables used in SQL questions using the search feature, however it seems not to be possible anymore. Is it a bug?

Thank you

Thank you !

This seems a bit overkill for a feature that was previously available in Metabase. We used to be able to enter a table name in the search bar and it would yield all questions pulling from that table (the search would look inside the SQL of the questions). Metabase no longer does that - searching for a table name only yields questions with the table name in the title, or the actual tables. Was that feature dropped or is this a bug?

I didn’t know that Metabase did that. Please remember that search is meant to be used as a simple way of finding things by its name, not to search dependencies. This tool was built for Metabase admins or data engineers which need to know about lineage of the Metabase entities

At least from our team's experience it used to do that, yes. To be clear we are not looking to search dependencies or the lineage of Metabase entities, just to search based on the SQL inside the question.

An example to what we're looking for is, if I write a question called ABC and the SQL of the question is select * from active_users, if I use the search bar and type active_users, I want to see question ABC in the results. This used to be the case and our team leveraged this feature to, for example, understand whether we can drop certain tables without impacting Metabase users. But now, searching for active_users would only return the actual active_users table and not a question like ABC.

I noticed there is a new toggle to "Search the contents of native queries" in the search panel. Toggling this on restores the original search results for any given text.

1 Like

I don't see this option anywhere. Could you screenshot where you're seeing this within your Metabase GUI?

Please use Introducing Metagraph