> For the complete documentation index, see [llms.txt](https://v2.dataos.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v2.dataos.info/build/stage-2-productize/explore-recipes/model-selection.md).

# Model selection

In large projects, a single model change can affect many downstream models, making a full plan slow. Model selection lets you filter which models to include in a plan, so you can iterate on specific models quickly without touching everything else.

***

## How selection works

A `vulcan plan` automatically detects which models have changed and which downstream models depend on those changes. Model selection filters which **directly modified** models are included. Vulcan still automatically includes all **indirect dependencies** (downstream models) of any selected model.

**Example dependency graph:**

The orders-analytics dependency graph looks like this:

```
bronze.orders
bronze.customers        -->  silver.fct_daily_sales  -->  gold.sales_funnel_analysis
bronze.order_items
bronze.products
bronze.regions

bronze.customers        -->  silver.dim_customer_profile  -->  gold.rfm_customer_segmentation
bronze.orders
bronze.order_items
bronze.regions
bronze.shipments
```

If you select `silver.fct_daily_sales`, Vulcan includes it and automatically includes `gold.sales_funnel_analysis` (because it depends on `fct_daily_sales`). The bronze models are upstream, so they are not re-evaluated unless you select them directly.

***

## Basic selector syntax

Use `--select-model` with `vulcan plan`:

```bash
# Select a single model by name
vulcan plan dev --select-model "analytics.daily_sales"

# Select multiple models
vulcan plan dev --select-model "analytics.daily_sales" --select-model "analytics.customers"
```

***

## Pattern selectors

Select all models in a schema:

```bash
vulcan plan dev --select-model "analytics.*"
```

Select models matching a name fragment:

```bash
vulcan plan dev --select-model "*daily*"
```

***

## Tag selectors

Select models by tag. Tags are defined in the `MODEL` block using `tags`:

```bash
vulcan plan dev --select-model "tag:silver"
vulcan plan dev --select-model "tag:daily"
```

In the model definition:

```sql
MODEL (
  name analytics.daily_sales,
  kind FULL,
  tags ('silver', 'daily', 'sales')
);
```

***

## Ancestor and descendant selectors

Select a model and all its upstream dependencies:

```bash
# analytics.daily_sales AND everything it depends on
vulcan plan dev --select-model "+analytics.daily_sales"
```

Select a model and all its downstream dependents:

```bash
# analytics.daily_sales AND everything that depends on it
vulcan plan dev --select-model "analytics.daily_sales+"
```

Select only direct ancestors (one level up):

```bash
vulcan plan dev --select-model "1+analytics.daily_sales"
```

***

## Combining selectors

Run multiple selectors together. Vulcan unions the results:

```bash
vulcan plan dev \
  --select-model "analytics.daily_sales" \
  --select-model "tag:customers"
```

***

## Practical examples

**Iterating on a single model while developing a new silver model:**

```bash
vulcan plan dev --select-model "silver.fct_daily_sales" --auto-apply
```

Run this while editing `fct_daily_sales.sql`. Vulcan plans only that model and its downstream dependents.

**Re-running all bronze models after a source schema change:**

```bash
vulcan plan dev --select-model "bronze.*" --auto-apply
```

Apply all changes in the bronze schema without touching silver or gold models.

**Deploying only the lookup seed:**

```bash
vulcan plan dev --select-model "bronze.order_status_lookup" --auto-apply
```

Use this after editing `seeds/order_status_lookup.csv` to reload only the seed.

**Selecting models by tag:**

```bash
vulcan plan dev --select-model "tag:gold" --auto-apply
```

All models in `orders-analytics` tagged `gold` (`rfm_customer_segmentation`, `sales_funnel_analysis`) will be selected.

**Selecting models changed in git since the last plan:**

```bash
vulcan plan dev --select-model "state:modified" --auto-apply
```

This selects only models changed since your last plan. Useful for CI/CD pipelines where you want to deploy only what changed in a pull request.

***

## Excluding models

Use `--exclude-model` to skip specific models or namespaces:

```bash
# Select all analytics models except the large one
vulcan plan dev \
  --select-model "analytics.*" \
  --exclude-model "analytics.large_events" \
  --auto-apply
```

***

## Production selectors

The same selectors work for production plans:

```bash
# Deploy only daily_sales and its downstream dependents to production
vulcan plan prod \
  --select-model "analytics.daily_sales+" \
  --auto-apply
```

***

## When to use selection

| Scenario                        | Selector approach                               |
| ------------------------------- | ----------------------------------------------- |
| Developing a single model       | `--select-model "schema.model_name"`            |
| Testing a DAG layer             | `--select-model "schema.*"`                     |
| Deploying only tagged models    | `--select-model "tag:tag_name"`                 |
| CI/CD: only deploy changes      | `--select-model "state:modified"`               |
| Debugging without touching prod | `--select-model "schema.model_name" --no-apply` |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://v2.dataos.info/build/stage-2-productize/explore-recipes/model-selection.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
