Skip to content
Snippets Groups Projects
Unverified Commit da81ab2b authored by Natalie's avatar Natalie Committed by GitHub
Browse files

docs - update sync/scan (#29524)

parent 7405692b
No related merge requests found
......@@ -121,8 +121,8 @@ The **Manage database** permission grants access to the settings page for a give
On the database settings page, you can:
- Edit any of the [connection options](../databases/connecting.md) for the data source,
- [sync schemas](../databases/connecting.md#manually-syncing-tables-and-columns), and
- [scan field values](../databases/connecting.md#manually-scanning-column-values).
- [sync schemas](../databases/sync-scan.md#manually-syncing-tables-and-columns), and
- [scan field values](../databases/sync-scan.md#manually-scanning-column-values).
Note that only admins can delete database connections in your Metabase, so people with **Manage database** permissions won't see the **Remove database** button.
......
......@@ -54,7 +54,7 @@ If someone or something creates 100 queries at the same time, this stampede of q
## Managing resource-intensive queries
1. [Reschedule or disable Metabase syncs and scans](../databases/connecting.md#syncing-and-scanning-databases).
1. [Reschedule or disable Metabase syncs and scans](../databases/sync-scan.md).
**Explanation**
......@@ -63,7 +63,7 @@ By default, Metabase makes regular sync and scan queries against your database t
## Questions that use number, date, or timestamp columns
1. Update your database schema so that the columns are typed correctly.
2. [Sync the updated columns](../databases/connecting.md#manually-syncing-tables-and-columns) to bring the changes into Metabase.
2. [Sync the updated columns](../databases/sync-scan.md#manually-syncing-tables-and-columns) to bring the changes into Metabase.
**Explanation**
......
......@@ -28,7 +28,7 @@ It's always a good idea to start with a quick sanity check:
- creating a "contains" filter for string columns, or
- asking your database admin.
3. Ask your Metabase admin to help you check if:
- Metabase is [up to date](../databases/connecting.md#manually-syncing-tables-and-columns) with your database,
- Metabase is [up to date](../databases/sync-scan.md) with your database,
- the column is [visible](../data-modeling/metadata-editing.md#column-visibility) in Metabase,
- you have the correct [data permissions](../permissions/data.md) to access the column.
......@@ -63,7 +63,7 @@ If you're not a Metabase admin, you might have to ask your admin to help you wit
- directly from the database.
2. Cast the column to a data type that matches the desired [filter type](../questions/query-builder/introduction.md#filter-types). You can:
- [cast strings or numbers to dates](../data-modeling/metadata-editing.md#casting-to-a-specific-data-type) from the Data Model page, or
- change the data type of the column in your database, and [re-sync](../databases/connecting.md#manually-syncing-tables-and-columns) the database schema.
- change the data type of the column in your database, and [re-sync](../databases/sync-scan.md#manually-syncing-tables-and-columns) the database schema.
**Explanation**
......
......@@ -22,12 +22,14 @@ Once you've confirmed that you're looking at a non-cached view of your tables an
2. Go to **Admin** > **Troubleshooting** > **Logs** to check the status of the sync.
3. 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:
```sql
SELECT *
FROM "your_schema"."your_table_or_view"
LIMIT 1
```
5. [Manually re-sync](../databases/connecting.md#manually-syncing-tables-and-columns) the table or view if needed.
```sql
SELECT
*
FROM
"your_schema"."your_table_or_view"
LIMIT 1
```
4. [Manually re-sync](../databases/sync-scan.md#manually-syncing-tables-and-columns) the table or view if needed.
### Special cases
......@@ -38,9 +40,12 @@ If you’ve just set up a new database in Metabase, the initial sync query needs
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):
```sql
SELECT TRUE
FROM "your_schema"."your_table_or_view"
WHERE 1 <> 1
SELECT
TRUE
FROM
"your_schema"."your_table_or_view"
WHERE
1 <> 1
LIMIT 0
```
......@@ -80,10 +85,14 @@ If you're waiting for the initial scan to run after connecting a database, make
Scan queries are run against your database to sample column values from the first 1,000 rows in a table or view:
```sql
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
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
```
......@@ -118,8 +127,10 @@ If you're using MongoDB, Metabase fingerprints the first 10,000 documents per co
The initial fingerprinting query looks at the first 10,000 rows from a given table or view in your database:
```sql
SELECT *
FROM "your_schema"."your_table_or_view"
SELECT
*
FROM
"your_schema"."your_table_or_view"
LIMIT 10000
```
......@@ -134,10 +145,10 @@ Metabase doesn't have a built-in option to trigger manual fingerprinting queries
To speed up **syncs**:
- Restrict the privileges used to connect to the database so that Metabase only syncs a limited subset of schemas or tables.
- [Reduce the frequency of sync queries](../databases/connecting.md#scheduling-database-scans).
- [Reduce the frequency of sync queries](../databases/sync-scan.md#scheduling-database-syncs).
To speed up **scans**:
- [Reduce the frequency of scans, or disable scans entirely](../databases/connecting.md#scheduling-database-scans).
- [Reduce the frequency of scans, or disable scans entirely](../databases/sync-scan.md#scheduling-database-scans).
- Reduce the number of columns being scanned by going to **Admin** > **Data Model** and setting **Filtering on this field** to **Search box** or **Plain input box**.
**Explanation**
......@@ -148,7 +159,7 @@ Syncs and scans are ultimately just two kinds of queries that are run against yo
- [Troubleshooting database connections](./db-connection.md).
- [Troubleshooting filters](./filters.md).
- [How syncs and scans work](../databases/connecting.md#syncing-and-scanning-databases).
- [How syncs and scans work](../databases/sync-scan.md#how-database-syncs-work).
## Are you still stuck?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment