Structure
The assignment table in Confidence Flags has the following core structure:assignment_time | unit | flag | rule | variant | assignment_id |
|---|---|---|---|---|---|
| 2023-05-20 00:04:25 | user5125 | flags/test-flag | flags/test-flag/rules/rule123 | flags/test-flag/variants/control | control |
| 2023-05-20 05:01:21 | user7231 | flags/test-flag | flags/test-flag/rules/rule123 | flags/test-flag/variants/treatment | treatment |
| 2023-05-20 23:13:53 | user3512 | flags/other-test-flag | flags/other-test-flag/rules/rule123 | flags/other-test-flag/variants/treatment | control |
- A timestamp column that records the time of the assignment. The
assignment_timecolumn in the example table. - One or more entity columns that hold the identifier of the entity the assignment happened for. The
unitcolumn in the example table. - An exposure key column to use to filter out the assignments that belong to the
experiment. The
rulecolumn in the example table. You could also use theflagcolumn if there is a 1-1 mapping of an experiment to a flag. Confidence represents an experiment as a rule on the flag. - A variant key column that identifies a specific variant. The
assignment_idcolumn in the example table. Use theassignment_idcolumn and not thevariantcolumn as Confidence supports fall-through variants that allow multiple variants to be part of the same assignment.
Configuration
SQL Query
You need to input the SQL that selects your assignment rows. After you’ve entered your SQL you can click Run Query. Confidence then executes your query with a limit to check that everything is in order and show you some sample rows. You should write resource efficient queries. The result frequency of your experiment determines how often the queries run. For example, an experiment with hourly calculations runs the assignment table query once an hour. Here is a checklist of things to consider when writing the query for your assignment data:- ✅ Always have an index (also called Time partitioning in BigQuery) on the timestamp column to ensure that Confidence only queries the data within a partition, without this each query may require a full table scan.
- ✅ If you can, also set up an index on the entity columns (also called Clustered Table in BigQuery), this helps improve the performance of the join that Confidence does between your exposures and facts.
- ✅ If you can, perform heavy transformations in an upstream step and store the result in an intermediate table to avoid potentially redoing the transformations.
You have some placeholders at your disposal if you need to specify what
partition you’re querying:
{START_TIME} and {END_TIME}. These two
parameters vary depending on the requirements of the metric that uses
the assignment table. You don’t need
to use them as Confidence always filters on your timestamp column, but
sometimes your table format includes the date. These placeholders have the
same Timestamp type as the timestamp column in your data warehouse.Data Delivery Cadence
For configuring data delivery cadence, see the data delivery cadence page.Timestamp Column
The timestamp column is the column that identifies the time that the assignment occurred. This column can either be a timestamp with a specific time point for the assignment, or you can select a date column. Selecting a date column means that any exposure calculation that includes the end of this day should include this assignment. It’s the same as specifying a time for the date that is at 23:59:59.Entities
You need to specify the entity that this assignment is for. This has to be the same identifier that you use for the facts.Exposure Key and Variant Key Columns
The exposure and variant keys must, at a given time, uniquely identify a single treatment group.- Confidence Flags
- External Feature Flagging
When using Confidence Flags:
- exposure key is the name of the rule
- the variant key is the
assignment_id

