1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
SQLite format 3 @ $ : $ $ .zp � 1��
���G
� $^!��L:e�� � � I]7 indexsqlite_autoindex_later_partition_lease_1later_partition_lease�<E3�
indexlater_partition_job_head_idxlater_partition_jobCREATE INDEX later_partition_job_head_idx
ON later_partition_job (namespace, topic, partition_id, sequence, earliest_run_at)�I3�Oindexlater_partition_job_job_id_idxlater_partition_jobCREATE UNIQUE INDEX later_partition_job_job_id_idx
ON later_partition_job (namespace, job_id)�j33�{tablelater_partition_joblater_partition_jobCREATE TABLE later_partition_job (
namespace TEXT NOT NULL,
topic TEXT NOT NULL,
partition_id INTEGER NOT NULL,
sequence INTEGER NOT NULL,
job_id TEXT NOT NULL,
payload_type TEXT NOT NULL,
earliest_run_at INTEGER NOT NULL,
PRIMARY KEY (namespace, topic, partition_id, sequence)
)EY3 indexsqlite_autoindex_later_partition_job_1later_partition_job�==�Otablelater_partition_sequencelater_partition_sequenceCREATE TABLE later_partition_sequence (
namespace TEXT NOT NULL,
topic TEXT NOT NULL,
partition_id INTEGER NOT NULL,
next_sequence INTEGER NOT NULL DEFAULT 1,
PRIMARY KEY (namespace, topic, partition_id)
)Oc= indexsqlite_autoindex_later_partition_sequence_1later_partition_sequence�>##�Ctablelater_topiclater_topicCREATE TABLE later_topic (
namespace TEXT NOT NULL,
topic TEXT NOT NULL,
partition_count INTEGER NOT NULL,
PRIMARY KEY (namespace, topic)
)5I# indexsqlite_autoindex_later_topic_1later_topic�G3�Iindexlater_job_execution_lease_idxlater_job_executionCREATE INDEX later_job_execution_lease_idx
ON later_job_execution (namespace, lease_until)�s33�
tablelater_job_executionlater_job_execution
CREATE TABLE later_job_execution (
namespace TEXT NOT NULL,
job_id TEXT NOT NULL,
lease_owner TEXT NOT NULL,
lease_until INTEGER NOT NULL,
PRIMARY KEY (namespace, job_id)
)E
Y3 indexsqlite_autoindex_later_job_execution_1later_job_execution�CI5�indexlater_delivery_queue_claim_idxlater_delivery_queueCREATE INDEX later_delivery_queue_claim_idx
ON later_delivery_queue (namespace, queue_name, available_at, lease_until, sequence)�_
55�atablelater_delivery_queuelater_delivery_queueCREATE TABLE later_delivery_queue (
sequence INTEGER PRIMARY KEY AUTOINCREMENT,
namespace TEXT NOT NULL,
queue_name TEXT NOT NULL,
payload BLOB NOT NULL,
available_at INTEGER NOT NULL,
lease_owner TEXT,
lease_until INTEGER,
attempt_count INTEGER NOT NULL DEFAULT 0
)�> S3�indexlater_storage_range_date_expire_idxlater_storage_range
CREATE INDEX later_storage_range_date_expire_idx
ON later_storage_range (date_expire)
WHERE date_expire IS NOT NULL�-O3�eindexlater_storage_range_live_page_idxlater_storage_range CREATE INDEX later_storage_range_live_page_idx
ON later_storage_range (range_key, sequence, date_expire)�E3�Aindexlater_storage_range_page_idxlater_storage_rangeCREATE INDEX later_storage_range_page_idx
ON later_storage_range (range_key, sequence)P++Ytablesqlite_sequencesqlite_sequenceCREATE TABLE sqlite_sequence(name,seq)�t33�tablelater_storage_rangelater_storage_rangeCREATE TABLE later_storage_range (
sequence INTEGER PRIMARY KEY AUTOINCREMENT,
range_key TEXT NOT NULL,
value BLOB NOT NULL,
date_expire INTEGER,
UNIQUE (range_key, value)
)EY3 indexsqlite_autoindex_later_storage_range_1later_storage_range�&G'�kindexlater_storage_date_expire_idxlater_storageCREATE INDEX later_storage_date_expire_idx
ON later_storage (date_expire)
WHERE date_expire IS NOT NULL�q''�!tablelater_storagelater_storageCREATE TABLE later_storage (
key TEXT PRIMARY KEY NOT NULL,
value BLOB NOT NULL,
counter_value INTEGER,
date_created INTEGER NOT NULL,
date_updated INTEGER,
date_expire INTEGER
)9M' indexsqlite_autoindex_later_storage_1later_storag *
� �� �
���G
� $^!���j�e� � � I]7 indexsqlite_autoindex_later_partition_lease_1later_partition_ I]7 indexsqlite_autoindex_later_partition_lease_1later_partition_lease�<E3�
indexlater_partition_job_head_idxlater_partition_jobCREATE INDEX later_partition_job_head_idx
ON later_partition_job (namespace, topic, partition_id, sequence, earliest_run_at)�I3�Oindexlater_partition_job_job_id_idxlater_partition_jobCREATE UNIQUE INDEX later_partition_job_job_id_idx
ON later_partition_job (namespace, job_id)EY3 indexsqlite_autoindex_later_partition_job_1later_partition_job�j33�{tablelater_partition_joblater_partition_jobCREATE TABLE later_partition_job (
namespace TEXT NOT NULL,
topic TEXT NOT NULL,
partition_id INTEGER NOT NULL,
sequence INTEGER NOT NULL,
job_id TEXT NOT NULL,
payload_type TEXT NOT NULL,
earliest_run_at INTEGER NOT NULL,
PRIMARY KEY (namespace, topic, partition_id, sequence)
)Oc= indexsqlite_autoindex_later_partition_sequence_1later_partition_sequence�==�Otablelater_partition_sequencelater_partition_sequenceCREATE TABLE later_partition_sequence (
namespace TEXT NOT NULL,
topic TEXT NOT NULL,
partition_id INTEGER NOT NULL,
next_sequence INTEGER NOT NULL DEFAULT 1,
PRIMARY KEY (namespace, topic, partition_id)
)5I# indexsqlite_autoindex_later_topic_1later_topic�>##�Ctablelater_topiclater_topicCREATE TABLE later_topic (
namespace TEXT NOT NULL,
topic TEXT NOT NULL,
partition_count INTEGER NOT NULL,
PRIMARY KEY (namespace, topic)
)�G3�Iindexlater_job_execution_lease_idxlater_job_executionCREATE INDEX later_job_execution_lease_idx
ON later_job_execution (namespace, lease_until)�s33�
tablelater_job_executionlater_job_execution
CREATE TABLE later_job_execution (
namespace TEXT NOT NULL,
job_id TEXT NOT NULL,
lease_owner TEXT NOT NULL,
lease_until INTEGER NOT NULL,
PRIMARY KEY (namespace, job_id)
)E
Y3 indexsqlite_autoindex_later_job_execution_1later_job_execution�CI5�indexlater_delivery_queue_claim_idxlater_delivery_queueCREATE INDEX later_delivery_queue_claim_idx
ON later_delivery_queue (namespace, queue_name, available_at, lease_until, sequence)�_
55�atablelater_delivery_queuelater_delivery_queueCREATE TABLE later_delivery_queue (
sequence INTEGER PRIMARY KEY AUTOINCREMENT,
namespace TEXT NOT NULL,
queue_name TEXT NOT NULL,
payload BLOB NOT NULL,
available_at INTEGER NOT NULL,
lease_owner TEXT,
lease_until INTEGER,
attempt_count INTEGER NOT NULL DEFAULT 0
)�> S3�indexlater_storage_range_date_expire_idxlater_storage_range
CREATE INDEX later_storage_range_date_expire_idx
ON later_storage_range (date_expire)
WHERE date_expire IS NOT NULL�-O3�eindexlater_storage_range_live_page_idxlater_storage_range CREATE INDEX later_storage_range_live_page_idx
ON later_storage_range (range_key, sequence, date_expire)�E3�Aindexlater_storage_range_page_idxlater_storage_rangeCREATE INDEX later_storage_range_page_idx
ON later_storage_range (range_key, sequence)P++Ytablesqlite_sequencesqlite_sequenceCREATE TABLE sqlite_sequence(name,seq)�t33�tablelater_storage_rangelater_storage_rangeCREATE TABLE later_storage_range (
sequence INTEGER PRIMARY KEY AUTOINCREMENT,
range_key TEXT NOT NULL,
value BLOB NOT NULL,
date_expire INTEGER,
UNIQUE (range_key, value)
)EY3 indexsqlite_autoindex_later_storage_range_1later_storage_range�&G'�kindexlater_storage_date_expire_idxlater_storageCREATE INDEX later_storage_date_expire_idx
ON later_storage (date_expire)
WHERE date_expire IS NOT NULL�q''�!tablelater_storagelater_storageCREATE TABLE later_storage (
key TEXT PRIMARY KEY NOT NULL,
value BLOB NOT NULL,
counter_value INTEGER,
date_created INTEGER NOT NULL,
date_updated INTEGER,
date_expire INTEGER
)9M' indexsqlite_autoindex_later_storage_1later_storage
X � K `[�>��AQ � D
�
� ��s� GX G O+c= indexsqlite_autoindex_later_log_consumer_lease_1later_log_consumer_lease.�e"--�}tablelater_log_recordlater_log_record%CREATE TABLE later_log_record (
namespace TEXT NOT NULL,
topic TEXT NOT NULL,
partition_id INTEGER NOT NULL,
record_offset INTEGER NOT NULL,
record_key BLOB NOT NULL,
payload BLOB NOT NULL,
created_at INTEGER NOT NULL,
PRIMARY KEY (namespace, topic, partition_id, record_offset)
)?#S- indexsqlite_autoindex_later_log_record_1later_log_record&�
33�Atablelater_log_partitionlater_log_partition#CREATE TABLE later_log_partition (
namespace TEXT NOT NULL,
topic TEXT NOT NULL,
partition_id INTEGER NOT NULL,
next_offset INTEGER NOT NULL DEFAULT 1,
PRIMARY KEY (namespace, topic, partition_id)
)E!Y3 indexsqlite_autoindex_later_log_partition_1later_log_partition$�#I5�Uindexlater_partition_head_ready_idxlater_partition_head"CREATE INDEX later_partition_head_ready_idx
ON later_partition_head (namespace, earliest_run_at)�C55�)tablelater_partition_headlater_partition_head CREATE TABLE later_partition_head (
namespace TEXT NOT NULL,
topic TEXT NOT NULL,
partition_id INTEGER NOT NULL,
sequence INTEGER NOT NULL,
job_id TEXT NOT NULL,
earliest_run_at INTEGER NOT NULL,
PRIMARY KEY (namespace, topic, partition_id)
)G[5 indexsqlite_autoindex_later_partition_head_1later_partition_head!�A%�=indexlater_worker_heartbeat_idxlater_workerCREATE INDEX later_worker_heartbeat_idx
ON later_worker (namespace, heartbeat_until)�A%%�Etablelater_workerlater_workerCREATE TABLE later_worker (
namespace TEXT NOT NULL,
owner TEXT NOT NULL,
heartbeat_until INTEGER NOT NULL,
PRIMARY KEY (namespace, owner)
)7K% indexsqlite_autoindex_later_worker_1later_worker � �K7�Eindexlater_partition_lease_owner_idxlater_partition_leaseCREATE INDEX later_partition_lease_owner_idx
ON later_partition_lease (namespace, owner)I]7 indexsqlite_autoindex_later_partition_lease_1later_partition_lease�N77�;tablelater_partition_leaselater_partition_leaseCREATE TABLE later_partition_lease (
namespace TEXT NOT NULL,
topic TEXT NOT NULL,
partition_id INTEGER NOT NULL,
owner TEXT NOT NULL,
lease_until INTEGER NOT NULL,
lease_epoch INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (namespace, topic, partition_id)
) *E3�
indexlater_partition_job_head_id�C'[?�yindexlater_log_consumer_offset_partition_idxlater_log_consumer_offset*CREATE INDEX later_log_consumer_offset_partition_idx
ON later_log_consumer_offset (namespace, topic, partition_id)Q&e? indexsqlite_autoindex_later_log_consumer_offset_1later_log_consumer_offset)�b%??�Stablelater_log_consumer_offsetlater_log_consumer_offset(CREATE TABLE later_log_consumer_offset (
namespace TEXT NOT NULL,
topic TEXT NOT NULL,
group_name TEXT NOT NULL,
partition_id INTEGER NOT NULL,
next_offset INTEGER NOT NULL,
committed_at INTEGER NOT NULL,
PRIMARY KEY (namespace, topic, group_name, partition_id)
)�$$?-�iindexlater_log_record_read_idxlater_log_record'CREATE INDEX later_log_record_read_idx
ON later_log_record (namespace, topic, partition_id, record_offset)�*==�tablelater_log_consumer_leaselater_log_consumer_lease-CREATE TABLE later_log_consumer_lease (
namespace TEXT NOT NULL,
topic TEXT NOT NULL,
group_name TEXT NOT NULL,
partition_id INTEGER NOT NULL,
member_id TEXT NOT NULL,
lease_until INTEGER NOT NULL,
lease_epoch INTEGER NOT NULL DEFAULT 1,
PRIMARY KEY (namespace, topic, group_name, partition_id)
)Q)e? indexsqlite_autoindex_later_log_consumer_member_1later_log_consumer_member,�7(??�}tablelater_log_consumer_memberlater_log_consumer_member+CREATE TABLE later_log_consumer_member (
namespace TEXT NOT NULL,
topic TEXT NOT NULL,
group_name TEXT NOT NULL,
member_id TEXT NOT NULL,
heartbeat_at INTEGER NOT NULL,
PRIMARY KEY (namespace, topic, group_name, member_id)
)
, r 4�� rj�
?f��
� �)/I-�iindexlater_jobs_index_partition_idxlater_jobs_index3CREATE INDEX later_jobs_index_partition_idx
ON later_jobs_index (namespace, topic, partition_id, sequence)� .A-�_indexlater_jobs_index_stage_idxlater_jobs_index2CREATE INDEX later_jobs_index_stage_idx
ON later_jobs_index (namespace, stage, stage_date_ms, job_id)�',--�tablelater_jobs_indexlater_jobs_index/CREATE TABLE later_jobs_index (
namespace TEXT NOT NULL,
job_id TEXT NOT NULL,
payload_type TEXT NOT NULL,
stage TEXT NOT NULL,
stage_date_ms INTEGER NOT NULL,
-- `job.previous_stages.len()` at write time - a monotonic per-job
-- revision counter. `job_index_upsert` only applies a write whose
-- revision is >= the stored one, so two writes for the same job that
-- arrive out of order (a real possibility - see
-- `later::stats::Stats::record_transition`'s own doc comment) can never
-- let an older one clobber a newer one. This is enforced atomically as
-- part of the same upsert statement, unlike the old range-key model's
-- read-then-write check, which could itself race and is exactly what
-- let a stage's dashboard listing and its count silently disagree.
revision INTEGER NOT NULL,
-- Set once, when the job's very first stage was recorded, and never
-- touched again - backs the listing view's "duration" column (total
-- elapsed time since the job was created), which needs a fixed start
-- point rather than a moving one.
created_at_ms INTEGER NOT NULL,
-- Set once, on the transition into Running, and left untouched by every
-- later transition of the same job - see the "wait metrics" table below
-- for why a live "current stage" column can't answer "how long did jobs
-- recently wait" on its own.
wait_ms INTEGER,
wait_mode TEXT,
topic TEXT,
partition_id INTEGER,
sequence INTEGER,
-- Non-NULL only while this job is in Stage::Waiting on another job -
-- lets a continuation lookup be a plain indexed query instead of its
-- own range key per parent.
parent_job_id TEXT,
date_expire INTEGER,
PRIMARY KEY (namespace, job_id)
)?-S- indexsqlite_autoindex_later_jobs_index_1later_jobs_index0 � O+c= indexsqlite_autoindex_later_log_consumer_lease_1later_log_consumer_lease. F==�tablelater_log_consumer_leaselater_log_consumer_lease-CREATE TABLE later_log_consumer_lease (
namespace TEXT NOT NULL,
topic TEXT NOT NULL,
group_name TEXT NOT NULL,
partition_id INTEGER NOT NULL,
member_id TEXT NOT NULL,
lease_until INTEGER NOT NULL,
lease_epoch INTEGER NOT NULL DEFAULT�C6I5�indexlater_delivery_queue_order_idxlater_delivery_queue:CREATE INDEX later_delivery_queue_order_idx
ON later_delivery_queue (namespace, queue_name, sequence, available_at, lease_until)�^499�Wtablelater_job_wait_metricslater_job_wait_metrics8CREATE TABLE later_job_wait_metrics (
namespace TEXT NOT NULL,
mode TEXT NOT NULL,
minute_bucket INTEGER NOT NULL,
count INTEGER NOT NULL DEFAULT 0,
sum_ms INTEGER NOT NULL DEFAULT 0,
max_ms INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (namespace, mode, minute_bucket)
)K5_9 indexsqlite_autoindex_later_job_wait_metrics_1later_job_wait_metrics9�$2EE�Ktablelater_job_transition_metricslater_job_transition_metrics6CREATE TABLE later_job_transition_metrics (
namespace TEXT NOT NULL,
stage TEXT NOT NULL,
minute_bucket INTEGER NOT NULL,
count INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (namespace, stage, minute_bucket)
)W3kE indexsqlite_autoindex_later_job_transition_metrics_1later_job_transition_metrics7�(1C-�mindexlater_jobs_index_expire_idxlater_jobs_index5CREATE INDEX later_jobs_index_expire_idx
ON later_jobs_index (date_expire)
WHERE date_expire IS NOT NULL�0C-�Cindexlater_jobs_index_parent_idxlater_jobs_index4CREATE INDEX later_jobs_index_parent_idx
ON later_jobs_index (namespace, parent_job_id)