Skip to main content
Adrià García
← Back to the simulators

Query Service · Data Distiller

SQL in AEP

Almost anything in AEP can be pulled with SQL, but not in the same way. An ad hoc query, a batch query that writes a dataset, a computed attribute and an audience created with SQL each have their own limits and costs. Choose what the business asks for and see which tool fits.

Scenario

What the business asks for

Where the result has to end up picks the tool before the SQL does.

If it is a value on each profile

To personalise in AJO and build audiences.

If it is a list of people

Illustrative scenario ↑ Back to the controls
Example assumptions

Example questions, datasets, table names and queries.

The request

What has to come out and how

The question, what defines it and the query with the tool that fits best.

Four tools

What fits and what does not

Green is the best option. Amber is possible at a cost. Red does not fit or falls short.

The limits that decide

Limits of each tool

Run time, rows, scheduling, window, where the result lands and cost.

The recommendation

First ask where the result has to end up

On someone's screen, in a dataset, on the profile or in a destination. That picks the tool before the complexity of the SQL does.

  1. 01

    Explore with ad hoc queries

    To answer a question and validate data. If it has to be repeated or returns many rows, move to batch.

  2. 02

    Computed attributes before SQL

    If it fits in a simple aggregation over events and within 6 months, do not spend compute hours or maintain a scheduled query.

  3. 03

    Derived datasets for what does not fit

    Deciles, lifetime spend, business rules across several tables. Scheduled and enabled for Profile when they need to be activated.

  4. 04

    Watch the compute hours

    Every scheduled batch query uses compute hours per year. Review what runs, how often and whether anyone uses the result.

Architecture note · 10 Profile is for activation; the data lake is for memory What goes into Profile and how long it stays is an architecture decision. It also decides what counts towards the licence. Read the note →

Explore this decision