title |
---|
Troubleshooting syncs, scans, and fingerprinting |
First, check if your data is outdated because of browser caching:
Once you've confirmed that you're looking at a non-cached view of your tables and columns, tag your database admin for help with troubleshooting:
Make sure your database driver is up to date.
Go to Admin > Troubleshooting > Logs to check the status of the sync.
Run a query against your database from the Metabase SQL editor to check for database connection or database privilege errors that aren't listed in the logs:
SELECT
*
FROM
"your_schema"."your_table_or_view"
LIMIT 1
Manually re-sync the table or view if needed.
If you've just set up a new database in Metabase, the initial sync query needs some time to kick off. If the sync hasn't started at all, try Troubleshooting database connections.
Explanation
A sync query should show up like this in your database's query execution table (using the privileges for the database user in the database connection details):
SELECT
TRUE
FROM
"your_schema"."your_table_or_view"
WHERE
1 <> 1
LIMIT 0
To run the sync query, Metabase must:
If the connection is failing or the database privileges are wrong, the sync query won't be able to run. If Metabase can't sync with your database after you first set it up, then the initial scan and fingerprinting queries won't run either.
Explanation
Metabase will try to unfold JSON and JSONB records during the sync process, which can take up a decent chunk of query execution time. If you have a lot of JSON records, try disabling the automatic unfolding option to pull the sync out of slow-motion. Remember that you can follow the status of the sync from Admin > Troubleshooting > Logs.
If you're waiting for the initial scan to run after connecting a database, make sure the initial sync has completed first (remember you can check the status from Admin > Troubleshooting > Logs).
Explanation
Scan queries are run against your database to sample column values from the first 1,000 rows in a table or view:
SELECT
"your_table_or_view"."column" AS "column"
FROM
"your_schema"."your_table_or_view"
GROUP BY
"your_table_or_view"."column"
ORDER BY
"your_table_or_view"."column" ASC
LIMIT 1000
A failed scan is caused by a failed scan query---you can look at the logs to debug the query similar to other queries you'd run directly against your database.
Note that when you change a search box filter to a dropdown filter from the Table Metadata, you'll trigger a scan query for that field. If you have a dropdown filter that isn't picking up all the values in a field, remember that Metabase only samples the first 1,000 unique values per field, and stores a maximum of 100 kilobytes of text. If you've got more than 1,000 unique values in a column, or a lot of text-heavy data (like long URLs or survey responses), you can:
To manually re-trigger a fingerprinting query for a given column:
If you're waiting for the initial fingerprinting query to run after connecting a database, make sure the initial sync has completed first (remember you can check the status from Admin > Troubleshooting > Logs).
If you're using MongoDB, Metabase fingerprints the first 10,000 documents per collection. If you're not seeing all of your fields, it's because those fields might not exist in those first 10,000 documents. For more info, see our MongoDB reference doc.
Explanation
The initial fingerprinting query looks at the first 10,000 rows from a given table or view in your database:
SELECT
*
FROM
"your_schema"."your_table_or_view"
LIMIT 10000
If the first 10,000 rows aren't representative of the data in a table (for example, if you've got sparse data with a lot of blanks or nulls), you could see issues such as:
Metabase doesn't have a built-in option to trigger manual fingerprinting queries. You can "reset" a field's settings using the steps above to try and force a fingerprinting query, but it's not guaranteed to work on all versions of Metabase.
To speed up syncs:
To speed up scans:
Explanation
Syncs and scans are ultimately just two kinds of queries that are run against your database, so the speed of execution is limited by the number of queries that are run, the frequency of execution, the size of your data, and the amount of resources you've allocated to your database. Metabase gives you options to adjust the number and frequency of sync and scan queries, since unfortunately, we can't imbue your database with more power... (yet?)
If you can't solve your problem using the troubleshooting guides:
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )