Skip to content

Absence as a filter

An item appears in an index only if it has the index's key, so leaving the key off filters it out.

Why

An item is copied into a secondary index only if it has every attribute in that index's key. In this table only open tickets are given a gsi1pk, so only open tickets exist in the by-assignee index.

Scan the index, then the table. The index is a ready-made list of open work, with no filter expression and nothing wasted. Close a ticket by removing its gsi1pk and it drops out of the index on its own.

A sparse index uses absence as a global filter: only the items you care about ever appear in it.

Try it. Then change it.

Predict what each request will do. Run it, inspect the response, then change a value in the workbench and try again.

  1. Scan the by-assignee index. Only OPEN tickets carry gsi1pk, so closed tickets are simply not here, even though they exist in the table.

  2. Scan the base table for comparison: the closed tickets are here. The index holds fewer items than the table.

Built on this

TicketsDynamoDB workbench
Ready to run
Explore an access patternSelect to load & run

Scan the by-assignee index. Only OPEN tickets carry gsi1pk, so closed tickets are simply not here, even though they exist in the table.

Request
Execute against the local Dynoxide engine
ReturnedFiltered outChanged
pk(pk)
sk(sk)
title
status
gsi1pk
PROJECT#web
TICKET#101S
Fix the footerS
openS
USER#adaS
PROJECT#web
TICKET#102S
Dark modeS
openS
USER#graceS
PROJECT#web
TICKET#103S
Old redirectS
closedS
—
PROJECT#web
TICKET#104S
Mobile navS
openS
USER#adaS
PROJECT#web
TICKET#105S
FaviconS
closedS
—
PROJECT#web
TICKET#106S
Cookie bannerS
openS
USER#samS
PROJECT#api
TICKET#201S
Rate limitS
openS
USER#adaS
PROJECT#api
TICKET#202S
Retire v1S
closedS
—
PROJECT#api
TICKET#203S
PaginationS
openS
USER#graceS
PROJECT#api
TICKET#204S
Audit logS
closedS
—
PROJECT#api
TICKET#205S
WebhooksS
openS
USER#adaS
PROJECT#mobile
TICKET#301S
Push notificationsS
openS
USER#adaS
PROJECT#mobile
TICKET#302S
Crash on launchS
closedS
—
PROJECT#mobile
TICKET#303S
Offline modeS
openS
USER#samS
PROJECT#mobile
TICKET#304S
Biometric loginS
closedS
—
PROJECT#data
TICKET#401S
Nightly exportS
openS
USER#graceS
PROJECT#data
TICKET#402S
Schema driftS
closedS
—
PROJECT#data
TICKET#403S
Backfill ordersS
openS
USER#adaS
PROJECT#data
TICKET#404S
Dedupe usersS
closedS
—
PROJECT#data
TICKET#405S
Archive logsS
openS
USER#samS
Awaiting request
Your next query starts here.

Choose an access pattern above, or build your own request. See what comes back and what it costs.

Powered by DynoxideWASMStarts on your first run · Runs locally in your browser