Significance of db sync query

Can someone tell what exactly does this query do ?
My SQL skills are poor but still I do not understand what this query will actually do & what is the benefit ?

Thanks in advance !

It checks if any schema was updated. Say you have table 1 with 10 columns and you decide to add a new column. Metabase need to run those kind of queries to keep uptodate with your Database

How this query returns anything ?

They don't return anything in fact but will return the columns :slight_smile: Which will tell metabase how your schema has changed

I ran this and got no ouput . What I am missing :thinking:

the sync and scan queries won't return nothing, it's a process that metabase runs to know whtat's inside your db

Sorry I still did not get it, When the queries does not return anything, by this same query, how metabase knows what's inside my db ?

Open an IDE of your choice and simple run select * from your_table Limit 1 what do you get?

1 row of that table

Do you get any schema with that? Do you know what columns the tables has? with simply returning 1 row

Yes but my question is different.Please go to the link in the question.
There the query is

    1 <> 1

From this query, what will be understood about schema

Those queries are executed during Sync to see if the specific table can be accessed (if there's privileges to select on the table), so Metabase can ask for all columns in the table and continue on to Fingerprinting and then Scan.

1 Like

Oh now I understood.
So the mentioned query is just to check and then the main select query of fingerprinting starts


1 Like

Correct :slight_smile:

1 Like