Metabase executing queries from table not included the questions

Hi there! When I execute a sproc in Metabase, it fires queries from other tables which are not related or even part of the stored procedures. I have the following questions:

  1. Why is that happening?
  2. Is there a relation like the metabase will be referring to similar type of tables?
  3. Where do I see the list of tables it will be accessing other than the query specific ones?

Diagnostic Info:

{
  "browser-info": {
    "language": "en-US",
    "platform": "Win32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.35",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "Cp1252",
    "java.runtime.name": "Java(TM) SE Runtime Environment",
    "java.runtime.version": "11.0.6+8-LTS",
    "java.vendor": "Oracle Corporation",
    "java.vendor.url": "http://java.oracle.com/",
    "java.version": "11.0.6",
    "java.vm.name": "Java HotSpot(TM) 64-Bit Server VM",
    "java.vm.version": "11.0.6+8-LTS",
    "os.name": "Windows Server 2016",
    "os.version": "10.0",
    "user.language": "en",
    "user.timezone": "America/New_York"
  },
  "metabase-info": {
    "databases": [
      "sqlserver"
    ],
    "hosting-env": "unknown",
    "application-database": "h2",
    "application-database-details": {
      "database": {
        "name": "H2",
        "version": "1.4.197 (2018-03-18)"
      },
      "jdbc-driver": {
        "name": "H2 JDBC Driver",
        "version": "1.4.197 (2018-03-18)"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2022-11-01",
      "tag": "v0.44.6",
      "branch": "release-x.44.x",
      "hash": "5c6ae21"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Hi @sgayathri
I'm not sure I understand what you mean, so you'll need to include the query you are seeing and what you are doing to generate that.

Hi -- I'm getting queries fired up like this in my database.

-- Metabase
SELECT TOP 5000 "dbName"."Demo"."columnName" AS "columnName" 
FROM "dbName"."tableName" 
GROUP BY "dbName"."Demo"."columnName" 
ORDER BY "dbName"."Demo"."columnName" ASC 

Where the table Demo is not part of my queries and filters.

@sgayathri Those are analysis queries https://www.metabase.com/docs/latest/troubleshooting-guide/sync-fingerprint-scan

Thanks!

Going by the resource you sent, why the columns not added as a part of filters also get these queries fired up? Does Metabase automatically mark a column's filter option as "A list of all values"? I see that option turned on for few columns for which I've not did it manually.

@sgayathri I cannot say without seeing all logs and exactly how your foreign key references along with remapping is done.
But that query comes from analysis. Disable it if you don't want it.

Thanks! Are you referring to this option?

@sgayathri No: https://www.metabase.com/docs/latest/databases/connecting#choose-when-metabase-syncs-and-scans

Thanks! Is it possible to know where these queries are triggered?

@sgayathri I don't understand what you mean.

I meant to ask, where can I see in Metabase if the analysis queries are fired. For example, when I launch a widget in Metabase I'm able to see it in the SSMS profiler, but not the analysis queries.

@sgayathri Metabase runs analysis based on the schedule you have defined in the database settings, which I've linked to a couple of times.

If you want to disable sync schedules, then read the first comment here:
https://github.com/metabase/metabase/issues/10398

If you are looking for some other answer, then I don't understand what you are asking and you'll need to be a lot more descriptive.