> ## Documentation Index
> Fetch the complete documentation index at: https://confidence-auth-testing.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Materialized Segment

> Learn how to create a materialized segment that loads units from BigQuery.

export const HowToSchema = ({name, description, steps = []}) => {
  const schema = {
    "@context": "https://schema.org",
    "@type": "HowTo",
    name,
    description
  };
  if (steps.length > 0) {
    schema.step = steps.map((s, i) => ({
      "@type": "HowToStep",
      position: i + 1,
      name: typeof s === "string" ? s : s.name,
      text: typeof s === "string" ? s : s.text || s.name
    }));
  }
  return <script type="application/ld+json" dangerouslySetInnerHTML={{
    __html: JSON.stringify(schema)
  }} />;
};

<HowToSchema
  name="Create Materialized Segment"
  description="Learn how to create a materialized segment that loads units from BigQuery."
  steps={[
{
  name: "Navigate to Segments",
  text: "Navigate to the Flags page in the left menu, then click Segments.",
},
{
  name: "Select the Materialized segments tab",
  text: "Click the Materialized segments tab.",
},
{
  name: "Click + Create",
  text: "Click + Create to create a new materialized segment.",
},
{
  name: "Give the segment a name",
  text: "Enter a descriptive name for your segment.",
},
{
  name: "Define the SQL query",
  text: "Click + Load Entities and enter a SQL query that returns the entity IDs you want to include in the segment.",
},
{
  name: "Run the query and select the column",
  text: "Run the query and select the correct column from the response that contains your entity IDs.",
},
{
  name: "Create the load job",
  text: "Click + Create load job to start loading units into the segment.",
},
]}
/>

A [materialized segment](/docs/flags/materialized-segments) loads its list of units from your BigQuery instance using a SQL query.

## Create a Materialized Segment

<Steps>
  <Step title="Navigate to Segments">
    Navigate to the **Flags** page in the left menu, then click **Segments**.
  </Step>

  <Step title="Select the Materialized segments tab">
    Click the **Materialized segments** tab.
  </Step>

  <Step title="Click + Create">
    Click **+ Create** to create a new materialized segment.
  </Step>

  <Step title="Give the segment a name">
    Enter a descriptive name for your segment.
  </Step>

  <Step title="Define the SQL query">
    Click **+ Load Entities** and enter a SQL query that returns the entity IDs you want to include in the segment.
  </Step>

  <Step title="Run the query and select the column">
    Run the query and select the correct column from the response that contains your entity IDs.
  </Step>

  <Step title="Create the load job">
    Click **+ Create load job** to start loading units into the segment.
  </Step>
</Steps>

## Related Resources

<CardGroup cols={2}>
  <Card title="Materialized Segments Reference" href="/docs/flags/materialized-segments">
    Learn when and why to use materialized segments
  </Card>

  <Card title="Create Segments" href="/docs/how-to-guides/create-segments">
    Create standard attribute-based segments
  </Card>

  <Card title="BigQuery Setup" href="/docs/warehouse-setup/bigquery">
    Configure your BigQuery connection
  </Card>

  <Card title="Materialized Segments API" href="/docs/api/how-to-guides/flags/create-materialized-segment">
    API reference for materialized segments
  </Card>
</CardGroup>
