Action Scheduler indexes

This document describes indexes defined in the Action Scheduler schema and how they support common queries. Indexes are defined in the CREATE TABLE statements in classes/schema/.

actionscheduler_actions

Index nameColumnsPurpose
PRIMARYaction_idFast lookup by action ID.
hook_status_scheduled_date_gmthook (prefix 163), status, scheduled_date_gmtEfficient selection of actions by hook and status ordered by scheduled date (uses hook prefix for index length constraints).
status_scheduled_date_gmtstatus, scheduled_date_gmtFast retrieval of actions by status and scheduled time window.
scheduled_date_gmtscheduled_date_gmtRange queries on scheduled time regardless of status.
argsargs (prefix 191)Lookup/filter by args payloads that fit the indexed prefix.
group_idgroup_idFilter actions by group.
last_attempt_gmtlast_attempt_gmtRange queries over last attempt time.
claim_id_status_priority_scheduled_date_gmtclaim_id, status, priority, scheduled_date_gmtFetch claimed actions with a given status, ordered by priority and scheduled time.
status_last_attempt_gmtstatus, last_attempt_gmtFind failed/in-progress actions with last attempt time constraints.
status_claim_idstatus, claim_idQuickly find unclaimed or claimed actions per status.

actionscheduler_claims

Index nameColumnsPurpose
PRIMARYclaim_idFast lookup by claim ID.
date_created_gmtdate_created_gmtRange queries on claim creation time (cleanup/expiry).

actionscheduler_groups

Index nameColumnsPurpose
PRIMARYgroup_idFast lookup by group ID.
slugslug (prefix 191)Fast lookup by group slug.

actionscheduler_logs

Index nameColumnsPurpose
PRIMARYlog_idFast lookup by log ID.
action_idaction_idRetrieve logs for a specific action.
log_date_gmtlog_date_gmtRange queries over log timestamps.