For the complete documentation index, see llms.txt. This page is also available as Markdown.

Query your datamart

One query language per job - and how to pick between them.

Your goal

Get an answer out of the datamart, with the right tool for the question you are asking.

Expected outcome

Queries that return what you expect, fast enough for the context they run in.

One language per job

The datamart exposes several query languages, each designed for a different job.

Language
Use it to
Typical context

GraphQL

Query the local graph of a single user, in real time

Real-time personalisation, a lookup on one person

OTQL

Query the whole object graph in a couple of seconds, even with billions of data points

Audience segmentation, data exploration, volumetry

SQL

Run analysis of your behavioural data

Activities analytics - see Data cube (Activities Analytics)

OTQL is an extension to GraphQL. It is based on the same schema and adds features for querying a graph of millions or billions of objects. If you know one, the other is not far.

Which fields you can query, and which you can filter on, is entirely determined by your schema. A field without @TreeIndex can be selected but not used in a WHERE clause.

Choose by the question

The question
The tool

"What do we know about this user, right now?"

GraphQL queries - a single request returns profile, activities, segments, and identifiers for one UserPoint.

"How many users match these criteria?"

"Which users match, so I can put them in a segment?"

OTQL - segment definitions are OTQL.

"How did conversions evolve by category last month?"

"I want to explore, interactively"

"I want this to run from my code"

"I need the answer as a file"

Export - built on a saved OTQL query.

In this section

Last updated

Was this helpful?