Aurora

Materialized Views

Create materialized views to pre-aggregate your data, based on your egress API

This demo will walk you through using Aurora tools to prompt your way to creating materialized views that pre-aggregate the aircraft telemetry data you’ve ingested.

Skip to prompt if you started with the ads-b template.

Prerequisites

Start with the ads-b template

Terminal
aurora init mvs-demo ads-b
Terminal
cd mvs-demo
npm install

Run the Moose Dev Server

Terminal
moose dev 

Open the project in Cursor

Initialize the Aurora MCP

Navigate to Cursor > Settings > Cursor Settings > Tools and Integrations then toggle on the Aurora MCP tool.

For best results, set the LLM to claude-4-sonnet

Gemini 2.5 and o3 are also reasonably good, but claude-4-sonnet has the most consistent results.

Create an egress API

You can skip this step if you’ve already completed the Egress Demo.

Can you create an API that returns every aircraft within X miles of Y,Z coordinates.

Prompt the LLM to create a materialized view

Given the egress API, can you create a materialized view that improves the performance of the query?

Action

The LLM should now use aurora tools to:

  1. analyze the Moose project and the egress API
  2. create a Materialized View that pre-aggregates the data

You’ll know it is succeeding if:

  1. the LLM successfully creates the materialized view
  2. the LLM sees that the materialized view was created in the ClickHouse database

Optional further prompts

Can you create a new egress API that leverages the materialized view to improve the performance of the query?

Can you test both APIs to see what the performance difference is? I want to see the difference in speed, number of rows read, amount of data read, compute, and other vectors you think are pertinent.