
## Mine Amazon Redshift

URL: https://docs.atlan.com/apps/connectors/data-warehouses/amazon-redshift/how-tos/mine-amazon-redshift

> Once you have [crawled assets from Amazon Redshift](/apps/connectors/data-warehouses/amazon-redshift/how-tos/crawl-amazon-redshift), you can mine its query history to construct lineage and retrieve [usage and popularity metrics](/product/capabilities/usage-and-popularity/how-tos/interpret-usage-metrics).

Once you have [crawled assets from Amazon Redshift](https://docs.atlan.com/llms/connectors/amazon-redshift/crawl-amazon-redshift/llms.txt), you can mine its query history to construct lineage and retrieve [usage and popularity metrics](https://docs.atlan.com/llms/catalog/usage-and-popularity/interpret-usage-metrics/llms.txt).

To mine lineage from Amazon Redshift, review the [order of operations](https://docs.atlan.com/llms/catalog/connector-capabilities/order-workflows/llms.txt) and then complete the following steps.

## Select the miner

To select the Amazon Redshift miner:

1. In your Atlan workspace, click **Connectors** in the left sidebar.
 * If you are using the **Old UI (Classic)**, click **New Workflow** in the top navigation.

2. Click **Marketplace**.

3. Search for **Redshift Miner** and select it.

4. Click **Install**.

5. Once installation completes, click **Setup Workflow** on the same tile.

## Configure miner

To configure the Amazon Redshift miner:

1. For _Connection_, select the connection to mine. (To select a connection, [the crawler](https://docs.atlan.com/llms/connectors/amazon-redshift/crawl-amazon-redshift/llms.txt) must have already run.)

2. For _Miner extraction method_, select **Query History**.

3. For _Start time_, choose the earliest date from which to mine query history.

 :::warning

 Amazon Redshift only stores query history for [2-5 days](https://docs.aws.amazon.com/redshift/latest/dg/r_STL_QUERY.html). If you need to query more history, for example in an initial load, consider using [Generic Miner](https://docs.atlan.com/llms/catalog/connector-capabilities/mine-queries-through-cloud-object-storage/llms.txt) first. After the initial load, you can [modify the miner's configuration](https://docs.atlan.com/llms/catalog/connector-capabilities/manage-connectivity/llms.txt) to use query history extraction.

 :::

4. (Optional) For _Advanced Config_, keep _Default_ for the default configuration or click **Advanced** to further configure the miner:
 1. For _Cross Connection_, click **Yes** to extract lineage across all available data source connections or click **No** to only extract lineage from the selected Amazon Redshift connection.
 2. For _Control Config_, if Atlan support has provided you with a custom control configuration, select **Custom** and enter the configuration into the _Custom Config_ box. You can also:
 - Enter `{“ignore-all-case”: true}` to enable crawling assets with case-sensitive identifiers.
5. (Optional) For _Enable Popularity_, click **Yes** to retrieve [usage and popularity metrics](https://docs.atlan.com/llms/catalog/usage-and-popularity/interpret-usage-metrics/llms.txt) for your Amazon Redshift assets from query history:
 - For _Excluded Users_, type the names of users to be excluded while calculating [usage metrics](https://docs.atlan.com/llms/catalog/usage-and-popularity/interpret-usage-metrics/llms.txt) for Amazon Redshift assets. Press `enter` after each name to add more names.

## Run the miner

To run the Amazon Redshift miner, after completing the steps above:

1. To check for any [permissions or other configuration issues](https://docs.atlan.com/llms/connectors/amazon-redshift/preflight-checks-for-amazon-redshift/llms.txt) before running the miner, click **Preflight checks**.

2. You can either:
 - To run the miner once immediately, at the bottom of the screen, click the **Run** button.
 - To schedule the miner to run hourly, daily, weekly, or monthly, at the bottom of the screen, click the **Schedule Run** button.

Once the miner has completed running, you will see lineage for Amazon Redshift assets that were created in Amazon Redshift between the start time and when the miner ran! 🎉

---
