Metadata lightweight sync taking too long

One of our DBAs came to me and said he noticed Metabase was running queries on our SQL database that were hanging very long. We were able to see Metabase running select statements, like SELECT TOP 1 * FROM “dbo”.“table_name”. He’s also noticed a degradation in our database’s performance because of this due to how long the queries were stuck.

I figured it was from the lightweight scan that Metabase does, which I scheduled to run at 2AM daily. He’s telling me he only noticed this recently, and the tables that it’s taking a very long time on are actually views in SQL (not tables).

The sync finished but I see it took a very long time: [9417aef0-a561-4977-8594-8741751cfdef] 2020-11-03T14:03:38-05:00 INFO metabase.sync.util FINISHED: Sync metadata for sqlserver Database 34 ‘Database_Name’ (17.1 hours)

The only thing that changed was I updated from a 36 build to the latest 37 build. And he told me he never noticed the hanging connections before and didn’t see any performance hits either. Not sure what it could be.

Hi @nick.mcmanus
Sounds like you’re seeing this issue:

Looks like the 0.37.1 update may have addressed this issue. The database sync went from taking 19 hours to 19 seconds to complete. I’ll keep an eye on it but I think this is resolved now.

1 Like