Sub topic 5
Static and dynamic segments
This chapter assumes you can write a segment rule with conditions, boolean logic and time windows, as covered in the previous chapter. The SQL examples use PostgreSQL and the subscribers and events tables from earlier chapters. SQL is optional if your email service provider (ESP) has a visual rule builder, because the concepts are the same.
Two ways a segment can hold members
A segment is a rule plus a list of members. The difference between the two types is when the rule runs.
- A static segment is a fixed list. The rule runs once, or you upload the list by hand, and the members stay the same until you change them.
- A dynamic segment stores the rule and re-evaluates it. Membership is recalculated, often at send time, so people enter and leave as their data changes.
Most ESPs call these "lists" and "segments", or "static" and "smart" or "live" segments. Check your tool's documentation for how often it recalculates, because some refresh only every few hours.
Seeing the difference in SQL
A dynamic segment behaves like a database view. The query runs each time you read it, so the answer always reflects current data.
-- PostgreSQL: dynamic segment, recalculated on every read
CREATE OR REPLACE VIEW seg_recent_clickers AS
SELECT s.id AS subscriber_id
FROM subscribers s
WHERE s.status = 'subscribed'
AND EXISTS (
SELECT 1
FROM events e
WHERE e.subscriber_id = s.id
AND e.event_type = 'email_click'
AND e.occurred_at >= now() - interval '30 days'
);A static segment behaves like a table you fill once. It is a snapshot of the same rule at one moment.
-- PostgreSQL: static segment, a snapshot taken now
CREATE TABLE seg_recent_clickers_2026_11_26 AS
SELECT subscriber_id, now() AS captured_at
FROM seg_recent_clickers;A week later the view returns different people. The snapshot table returns the same people it did on the day you created it, including anyone who has since unsubscribed.
Choosing between them
| Situation | Better fit | Reason |
|---|---|---|
| Ongoing lifecycle stages such as "new subscriber" | Dynamic | People must move out automatically after 14 days |
| Automations triggered by behaviour | Dynamic | Entry depends on current events |
| Event attendees from a fixed date | Static | The group is defined by a past fact |
| Holdout or control group for a test | Static | Members must not change during the test |
| Audience for a one-off audit or export | Static | You need a reproducible record of who was targeted |
A rule of thumb: if the question is "who is like this now?", use a dynamic segment. If the question is "who was in this group at that moment?", use a static one.
Common errors
- Using a static segment for a time-based rule. A snapshot of "clicked in the last 30 days" is accurate on day one and wrong by day 31.
- Forgetting consent at send time. A static list can contain people who unsubscribed after the snapshot. Your ESP normally suppresses them, but confirm this, and never rely on your own copy of the list for sending.
- Assuming dynamic means instant. Some tools refresh membership on a schedule. A subscriber who buys at 09:00 may still get a "come back and buy" email at 09:30.
- Letting a dynamic segment change mid-test. If the audience shifts while you measure results, you cannot compare groups fairly.
- Treating stored counts as current. The size shown for a dynamic segment may be cached. Recheck it just before sending.
A hybrid approach
You can combine both. Build the audience with a dynamic rule, then freeze it into a static copy when you need stability. This is a common way to create a test audience: evaluate the rule once, split the snapshot into a treatment group and a holdout, and keep both fixed for the duration of the test. The SQL above does the first step. Later chapters on measurement return to this pattern.
When a campaign needs to be explained afterwards, keep the snapshot and its captured_at timestamp. You can then show exactly who was targeted, even if the dynamic rule would now return a different group.
Exercise
You run a welcome series for people who joined in the last 14 days, and a separate "attendees of the March webinar" re-engagement email. Which segment type fits each, and why?
Show answer
Use a dynamic segment for the welcome series, because membership depends on the current date and people must leave the group automatically after 14 days. Use a static segment for the webinar attendees, because the group is defined by a past event that will not change. Apply the subscription-status check at send time for the static list.
Exercise
Your team built a static segment of "clicked in the last 30 days" three weeks ago and plans to send to it today. Name two problems with sending to it as it stands.
Show answer
First, the rule is time-based, so the list no longer matches "last 30 days": recent clickers are missing and some listed people clicked more than 30 days ago. Second, some members may have unsubscribed since the snapshot, so you must rely on send-time suppression. The better fix is to switch to a dynamic segment, or to rebuild the snapshot just before sending.