How to stop database sync query

I see two running sync queries in database processes.

These queries are too heavy and can lock tables.
I disabled horly syncs in settings.

But sync queries are still running and restarts if I kill them or restart a database.

How can I stop them?

Hi @aliaksandr.karmyzau

Please post “Diagnostic Info” from Admin > Troubleshooting.

Metabase has to sync your databases to be able to show tables/fields in the interface.
Sync cannot be disabled currently, but there’s an issue open for changing that:
https://github.com/metabase/metabase/issues/10398 - upvote by clicking :+1: on the first post

Scan is not the same as sync, but sync also includes fingerprinting, which is a somewhat heavy process that runs on first sync and then very rarely again.
Scan can be disabled.

For a bit more context here:
https://www.metabase.com/docs/latest/administration-guide/01-managing-databases.html#database-sync-and-analysis

Here is 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/88.0.4324.150 Safari/537.36”,
“vendor”: “Google Inc.”
},
“system-info”: {
“file.encoding”: “UTF-8”,
“java.runtime.name”: “OpenJDK Runtime Environment”,
“java.runtime.version”: “11.0.7+10”,
“java.vendor”: “AdoptOpenJDK”,
“java.vendor.url”: “https://adoptopenjdk.net/”,
“java.version”: “11.0.7”,
“java.vm.name”: “OpenJDK 64-Bit Server VM”,
“java.vm.version”: “11.0.7+10”,
“os.name”: “Linux”,
“os.version”: “4.14.209-160.339.amzn2.x86_64”,
“user.language”: “en”,
“user.timezone”: “GMT”
},
“metabase-info”: {
“databases”: [
“mysql”,
“h2”
],
“hosting-env”: “elastic-beanstalk”,
“application-database”: “postgres”,
“application-database-details”: {
“database”: {
“name”: “PostgreSQL”,
“version”: “11.8”
},
“jdbc-driver”: {
“name”: “PostgreSQL JDBC Driver”,
“version”: “42.2.8”
}
},
“run-mode”: “prod”,
“version”: {
“date”: “2021-01-05”,
“tag”: “v0.37.5”,
“branch”: “release-x.37.x”,
“hash”: “be537ee”
},
“settings”: {
“report-timezone”: “US/Central”
}
}
}

@aliaksandr.karmyzau Can you post the query that you kill on your database? I have a feeling it’s fingerprinting, but that would be very useful to know.

I can’t see the whole query but here:

image

@aliaksandr.karmyzau And you cannot right-click the cell and copy the information?
Otherwise run this query on MySQL: SHOW FULL PROCESSLIST

SHOW FULL PROCESSLIST did the trick

– Metabase
SELECT custom_certification_report.first_name AS first_name FROM custom_certification_report GROUP BY custom_certification_report.first_name ORDER BY custom_certification_report.first_name ASC LIMIT 5000

@aliaksandr.karmyzau Okay, that is definitely fingerprinting, but I’m unsure why it’s listing two processes (in your screenshot) - is that different process IDs?

How many rows do you have in custom_certification_report ?

And do you have any indexes on custom_certification_report . first_name ?

Yes, they are two separate processes with separate IDs.

SHOW INDEX FROM custom_certification_report gave me nothing

SELECT COUNT(*) FROM custom_certification_report just hangs, maybe metabase query locks the table

@aliaksandr.karmyzau Okay, stop Metabase, while you investigate your database. You can also try running the query Metabase gets stuck on with EXPLAIN ANALYZE in front to get more information about your database.