-
Notifications
You must be signed in to change notification settings - Fork 1
/
sqlx-data.json
749 lines (749 loc) · 33.6 KB
/
sqlx-data.json
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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
{
"db": "PostgreSQL",
"0089a81e2c471ceefb6c1cff763d23941dce606379af7502541bca4c73c4d791": {
"describe": {
"columns": [
{
"name": "wallet",
"ordinal": 0,
"type_info": "Text"
}
],
"nullable": [
false
],
"parameters": {
"Left": [
"Int4",
"Int4",
"Int8",
"Int8"
]
}
},
"query": "\n SELECT wallet \n FROM network_monitoring_users\n WHERE run_id = $1\n AND secondary2spid = $2\n ORDER BY user_id \n OFFSET $3\n LIMIT $4; \n "
},
"058ebc6a1ca1ea4563a742a90926375f34a406882ffe26261c47b87634e131ae": {
"describe": {
"columns": [
{
"name": "wallet",
"ordinal": 0,
"type_info": "Text"
}
],
"nullable": [
false
],
"parameters": {
"Left": [
"Int4",
"Int4",
"Int8",
"Int8"
]
}
},
"query": "\n SELECT wallet \n FROM network_monitoring_users\n WHERE run_id = $1\n AND primaryspid = $2\n ORDER BY user_id \n OFFSET $3\n LIMIT $4; \n "
},
"084b7428c9bb80bff90565e61177f851bdf3b4163bd0283c83ebc893916b8b06": {
"describe": {
"columns": [
{
"name": "user_count",
"ordinal": 0,
"type_info": "Int8"
}
],
"nullable": [
null
],
"parameters": {
"Left": [
"Int4",
"Int4Array"
]
}
},
"query": "\n SELECT COUNT(*) as user_count\n FROM network_monitoring_users\n WHERE\n run_id = $1\n AND \n primaryspid != ALL( $2 )\n AND\n secondary1spid != ALL( $2 )\n AND \n secondary2spid != ALL( $2 );\n "
},
"0b0e04a5fded48de4a484faa64251fb45fe9508321904c351b723e9630b236eb": {
"describe": {
"columns": [
{
"name": "user_count",
"ordinal": 0,
"type_info": "Int8"
}
],
"nullable": [
null
],
"parameters": {
"Left": [
"Int4",
"Int4Array"
]
}
},
"query": "\n SELECT COUNT(*) as user_count\n FROM network_monitoring_users\n WHERE\n run_id = $1\n AND \n primaryspid = ANY( $2 )\n AND\n secondary1spid = ANY( $2 )\n AND \n secondary2spid = ANY( $2 ); \n "
},
"0e0475819a25d1179b545be7dcb2389157f56641541601fbb879ff8484158f95": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n INSERT INTO network_monitoring_cids_from_discovery (cid, run_id, ctype, user_id)\n SELECT metadata_multihash, $1, 'metadata', owner_id\n FROM discovery.tracks\n WHERE metadata_multihash IS NOT NULL\n AND is_current = TRUE;\n "
},
"15cb84e5ba4a16c7ca6cb444bf273b6c8fca5bbc93fb9bdabfcdf8f54a68800e": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n DELETE FROM network_monitoring_index_blocks\n WHERE run_id < $1; \n "
},
"1e27ddeddc588984a9a83889727fa75e3764d86cf2fafc9ae23617a9d9c734bc": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n UPDATE network_monitoring_index_blocks \n SET is_current = FALSE\n WHERE blocknumber != $1;\n "
},
"20f32d0f6c9573583392ecde77cc200f07274f0fa7bd6c16b08b7bf9421f79a9": {
"describe": {
"columns": [
{
"name": "run_id",
"ordinal": 0,
"type_info": "Int4"
}
],
"nullable": [
false
],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n INSERT INTO network_monitoring_index_blocks (\n is_current, \n blocknumber, \n is_complete,\n created_at\n ) VALUES (\n TRUE,\n $1,\n FALSE,\n NOW()\n )\n RETURNING run_id; \n "
},
"2210ca5695404e388c5577666816e5f62f09bf4f48cb69409fad26958e6532a3": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n INSERT INTO network_monitoring_cids_from_discovery (cid, run_id, ctype, user_id)\n SELECT\n jsonb_array_elements(track_segments) -> 'multihash',\n $1,\n 'track',\n owner_id\n FROM discovery.tracks\n WHERE track_segments IS NOT NULL\n AND is_current = TRUE;\n "
},
"22d12668eca4d93d8cf79924511bff01ffdce3d0610cc5c5088002d48424c9d1": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int4",
"TextArray",
"Int4Array"
]
}
},
"query": "\n UPDATE network_monitoring_users as nm_users\n SET secondary2_clock_value = tmp.clock\n FROM UNNEST($2::text[], $3::int[]) AS tmp(wallet, clock)\n WHERE nm_users.wallet = tmp.wallet\n AND nm_users.run_id = $1;\n "
},
"246f0157c1a14dffd2cbec4d33ea15c91c46317225043a9bea1c01e770fb3dda": {
"describe": {
"columns": [
{
"name": "user_count",
"ordinal": 0,
"type_info": "Int8"
}
],
"nullable": [
null
],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n SELECT COUNT(*) as user_count\n FROM network_monitoring_users\n WHERE \n run_id = $1\n AND (\n primary_clock_value = -2\n OR\n secondary1_clock_value = -2\n OR \n secondary2_clock_value = -2\n );\n "
},
"24927607451b3ef6dac72293ac7a73df79987e5493e2d7f94dd7dfc3f864416f": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n INSERT INTO network_monitoring_cids_from_discovery (cid, run_id, ctype, user_id)\n SELECT cover_art, $1, 'image', owner_id\n FROM discovery.tracks\n WHERE cover_art IS NOT NULL\n AND is_current = TRUE;\n "
},
"2ea6e633f481122ea5ce7254f1caaf7f726310a30e7d1d00edc3c34aef7ec197": {
"describe": {
"columns": [
{
"name": "spid",
"ordinal": 0,
"type_info": "Int4"
},
{
"name": "endpoint",
"ordinal": 1,
"type_info": "Varchar"
},
{
"name": "fully_synced_count",
"ordinal": 2,
"type_info": "Int8"
},
{
"name": "partially_synced_count",
"ordinal": 3,
"type_info": "Int8"
},
{
"name": "unsynced_count",
"ordinal": 4,
"type_info": "Int8"
}
],
"nullable": [
false,
false,
null,
null,
null
],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n SELECT fully_synced.spid, cnodes.endpoint, fully_synced.fully_synced_count, partially_synced.partially_synced_count, unsynced.unsynced_count\n FROM (\n SELECT primaryspid AS spid, COUNT(*) as fully_synced_count\n FROM network_monitoring_users\n WHERE\n run_id = $1\n AND \n primary_clock_value IS NOT NULL\n AND\n primary_clock_value = secondary1_clock_value\n AND\n secondary1_clock_value = secondary2_clock_value\n GROUP BY primaryspid\n ) AS fully_synced\n JOIN (\n SELECT primaryspid AS SPID, COUNT(*) AS partially_synced_count\n FROM network_monitoring_users\n WHERE \n run_id = $1\n AND \n primary_clock_value IS NOT NULL\n AND ( \n primary_clock_value = secondary1_clock_value\n OR\n primary_clock_value = secondary2_clock_value\n )\n AND \n secondary1_clock_value != secondary2_clock_value\n GROUP BY primaryspid\n ) AS partially_synced\n ON fully_synced.spid = partially_synced.spid\n JOIN (\n SELECT primaryspid AS spid, COUNT(*) AS unsynced_count\n FROM network_monitoring_users\n WHERE \n run_id = $1\n AND \n primary_clock_value IS NOT NULL\n AND \n primary_clock_value != secondary1_clock_value\n AND\n primary_clock_value != secondary2_clock_value\n GROUP BY primaryspid\n ) AS unsynced\n ON fully_synced.spid = unsynced.spid\n JOIN (\n SELECT spid, endpoint\n FROM network_monitoring_content_nodes\n WHERE\n run_id = $1\n ) AS cnodes\n ON cnodes.spid = fully_synced.spid\n ORDER BY fully_synced.spid; \n "
},
"3c1afce9998dd2f64b45ecd8f96776fd298b3635e0bb4ad9f36a69f5caf6bfa8": {
"describe": {
"columns": [
{
"name": "user_count",
"ordinal": 0,
"type_info": "Int8"
}
],
"nullable": [
null
],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n SELECT COUNT(*) as user_count\n FROM network_monitoring_users\n WHERE \n run_id = $1\n AND \n primary_clock_value IS NOT NULL\n AND \n primary_clock_value != -2\n AND ( \n primary_clock_value = secondary1_clock_value\n OR\n primary_clock_value = secondary2_clock_value\n )\n AND \n secondary1_clock_value != secondary2_clock_value; \n "
},
"48e897bb8855616f347a3c67df8c8df6f4dc43a53aa91cb1a4d256ddd805bafa": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n INSERT INTO network_monitoring_cids_from_discovery (cid, run_id, ctype, user_id)\n SELECT metadata_multihash, $1, 'metadata', user_id\n FROM discovery.users\n WHERE metadata_multihash IS NOT NULL\n AND is_current = TRUE;\n "
},
"4a9f5398abf05515a513dd57468d7209613d1afdaf9b447d828d0ea9112b2014": {
"describe": {
"columns": [
{
"name": "user_count",
"ordinal": 0,
"type_info": "Int8"
}
],
"nullable": [
null
],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n SELECT COUNT(*) as user_count\n FROM network_monitoring_users\n WHERE \n run_id = $1\n AND \n primary_clock_value IS NULL; \n "
},
"59b756254842a4c3a0892e13903dd4e3d8ef7b742e14deb7501b8fe4d9656f7b": {
"describe": {
"columns": [
{
"name": "endpoint",
"ordinal": 0,
"type_info": "Varchar"
},
{
"name": "count",
"ordinal": 1,
"type_info": "Int8"
}
],
"nullable": [
false,
null
],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n SELECT \n joined.endpoint AS endpoint, COUNT(*) AS count\n FROM (\n (SELECT * FROM network_monitoring_users WHERE run_id = $1) AS current_users\n JOIN\n (SELECT * FROM network_monitoring_content_nodes WHERE run_id = $1) AS cnodes\n ON\n current_users.primaryspid = cnodes.spid\n ) AS joined\n GROUP BY \n joined.endpoint \n "
},
"5da0708585db842b9c0a7ddbbd5be748969455f2a425363695287cdfc7bdd136": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n INSERT INTO network_monitoring_cids_from_discovery (cid, run_id, ctype, user_id)\n SELECT cover_photo, $1, 'image', user_id\n FROM discovery.users\n WHERE cover_photo IS NOT NULL\n AND is_current = TRUE;\n "
},
"68a9cc63f2ebe73cb2639bb12020e87e2dd63cb204453ca2509dade26b86988e": {
"describe": {
"columns": [
{
"name": "number",
"ordinal": 0,
"type_info": "Int4"
}
],
"nullable": [
true
],
"parameters": {
"Left": []
}
},
"query": "\n SELECT number FROM discovery.blocks WHERE is_current = TRUE LIMIT 1;\n "
},
"723c1cb0d6d763a129fdb61e66144947319b6abce7117b98bb190b6b8d7514c0": {
"describe": {
"columns": [
{
"name": "spid",
"ordinal": 0,
"type_info": "Int4"
},
{
"name": "endpoint",
"ordinal": 1,
"type_info": "Varchar"
},
{
"name": "fully_synced_count",
"ordinal": 2,
"type_info": "Numeric"
},
{
"name": "partially_synced_count",
"ordinal": 3,
"type_info": "Numeric"
},
{
"name": "unsynced_count",
"ordinal": 4,
"type_info": "Numeric"
}
],
"nullable": [
false,
false,
null,
null,
null
],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n SELECT \n fully_synced.spid, \n cnodes.endpoint, \n fully_synced.fully_synced_count, \n partially_synced.partially_synced_count, \n unsynced.unsynced_count\n FROM (\n SELECT \n fully_synced_primary.spid AS spid, \n (SUM(fully_synced_primary.fully_synced_count) +\n SUM(fully_synced_secondary1.fully_synced_count) +\n SUM(fully_synced_secondary2.fully_synced_count)) AS fully_synced_count\n FROM (\n SELECT primaryspid AS spid, COUNT(*) as fully_synced_count\n FROM network_monitoring_users\n WHERE\n run_id = $1\n AND \n primary_clock_value IS NOT NULL\n AND\n primary_clock_value = secondary1_clock_value\n AND\n secondary1_clock_value = secondary2_clock_value\n GROUP BY primaryspid\n ) AS fully_synced_primary\n JOIN (\n SELECT secondary1spid AS spid, COUNT(*) as fully_synced_count\n FROM network_monitoring_users\n WHERE\n run_id = $1\n AND \n primary_clock_value IS NOT NULL\n AND\n primary_clock_value = secondary1_clock_value\n AND\n secondary1_clock_value = secondary2_clock_value\n GROUP BY secondary1spid\n ) AS fully_synced_secondary1\n ON fully_synced_primary.spid = fully_synced_secondary1.spid\n JOIN (\n SELECT secondary2spid AS spid, COUNT(*) as fully_synced_count\n FROM network_monitoring_users\n WHERE\n run_id = $1\n AND \n primary_clock_value IS NOT NULL\n AND\n primary_clock_value = secondary1_clock_value\n AND\n secondary1_clock_value = secondary2_clock_value\n GROUP BY secondary2spid\n ) AS fully_synced_secondary2\n ON fully_synced_primary.spid = fully_synced_secondary2.spid\n GROUP BY fully_synced_primary.spid\n ) AS fully_synced\n JOIN (\n SELECT \n partially_synced_primary.spid AS spid, \n (SUM(partially_synced_primary.partially_synced_count) +\n SUM(partially_synced_secondary1.partially_synced_count) +\n SUM(partially_synced_secondary2.partially_synced_count)) AS partially_synced_count\n FROM (\n SELECT primaryspid AS SPID, COUNT(*) AS partially_synced_count\n FROM network_monitoring_users\n WHERE \n run_id = $1\n AND \n primary_clock_value IS NOT NULL\n AND ( \n primary_clock_value = secondary1_clock_value\n OR\n primary_clock_value = secondary2_clock_value\n )\n AND \n secondary1_clock_value != secondary2_clock_value\n GROUP BY primaryspid\n ) AS partially_synced_primary\n JOIN (\n SELECT secondary1spid AS SPID, COUNT(*) AS partially_synced_count\n FROM network_monitoring_users\n WHERE \n run_id = $1\n AND \n primary_clock_value IS NOT NULL\n AND ( \n primary_clock_value = secondary1_clock_value\n OR\n primary_clock_value = secondary2_clock_value\n )\n AND \n secondary1_clock_value != secondary2_clock_value\n GROUP BY secondary1spid\n ) AS partially_synced_secondary1\n ON partially_synced_primary.spid = partially_synced_secondary1.spid\n JOIN (\n SELECT secondary2spid AS SPID, COUNT(*) AS partially_synced_count\n FROM network_monitoring_users\n WHERE \n run_id = $1\n AND \n primary_clock_value IS NOT NULL\n AND ( \n primary_clock_value = secondary1_clock_value\n OR\n primary_clock_value = secondary2_clock_value\n )\n AND \n secondary1_clock_value != secondary2_clock_value\n GROUP BY secondary2spid\n ) AS partially_synced_secondary2\n ON partially_synced_primary.spid = partially_synced_secondary2.spid\n GROUP BY partially_synced_primary.spid\n ) AS partially_synced\n ON fully_synced.spid = partially_synced.spid\n JOIN (\n SELECT \n unsynced_primary.spid AS spid, \n (SUM(unsynced_primary.unsynced_count) +\n SUM(unsynced_secondary1.unsynced_count) +\n SUM(unsynced_secondary2.unsynced_count)) AS unsynced_count\n FROM (\n SELECT primaryspid AS spid, COUNT(*) AS unsynced_count\n FROM network_monitoring_users\n WHERE \n run_id = $1\n AND \n primary_clock_value IS NOT NULL\n AND \n primary_clock_value != secondary1_clock_value\n AND\n primary_clock_value != secondary2_clock_value\n GROUP BY primaryspid\n ) AS unsynced_primary\n JOIN (\n SELECT secondary1spid AS spid, COUNT(*) AS unsynced_count\n FROM network_monitoring_users\n WHERE \n run_id = $1\n AND \n primary_clock_value IS NOT NULL\n AND \n primary_clock_value != secondary1_clock_value\n AND\n primary_clock_value != secondary2_clock_value\n GROUP BY secondary1spid\n ) AS unsynced_secondary1\n ON unsynced_primary.spid = unsynced_secondary1.spid\n JOIN (\n SELECT secondary2spid AS spid, COUNT(*) AS unsynced_count\n FROM network_monitoring_users\n WHERE \n run_id = $1\n AND \n primary_clock_value IS NOT NULL\n AND \n primary_clock_value != secondary1_clock_value\n AND\n primary_clock_value != secondary2_clock_value\n GROUP BY secondary2spid\n ) AS unsynced_secondary2\n ON unsynced_primary.spid = unsynced_secondary2.spid\n GROUP BY unsynced_primary.spid\n ) AS unsynced\n ON fully_synced.spid = unsynced.spid\n JOIN (\n SELECT spid, endpoint\n FROM network_monitoring_content_nodes\n WHERE\n run_id = $1 \n ) AS cnodes\n ON cnodes.spid = fully_synced.spid\n ORDER BY fully_synced.spid;\n "
},
"79fdfa29a887c40001918e142a356b38fea3dcef9a78c26c7b218cfc430fa40d": {
"describe": {
"columns": [
{
"name": "created_at",
"ordinal": 0,
"type_info": "Timestamptz"
}
],
"nullable": [
false
],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n SELECT created_at\n FROM \n network_monitoring_index_blocks\n WHERE\n run_id = $1\n "
},
"7ada7305aa2ccbe5c1eac6011c54b50a1b27be328383b4df696f38dae0cbd3eb": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": []
}
},
"query": "\n CREATE EXTENSION IF NOT EXISTS postgres_fdw;\n "
},
"82cf5acc58966af3a3fba799a8c0cc0858add20f8bc5b57136dff6d0a6199c0a": {
"describe": {
"columns": [
{
"name": "user_count",
"ordinal": 0,
"type_info": "Int8"
}
],
"nullable": [
null
],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n SELECT COUNT(*) as user_count\n FROM network_monitoring_users\n WHERE \n run_id = $1\n AND \n primary_clock_value IS NOT NULL\n AND \n primary_clock_value != -2\n AND \n primary_clock_value != secondary1_clock_value\n AND\n primary_clock_value != secondary2_clock_value; \n "
},
"86ad8b31216cdbdf53cb74b2924d6a0b45a130b1a8672b7c803350d53745886a": {
"describe": {
"columns": [
{
"name": "endpoint",
"ordinal": 0,
"type_info": "Varchar"
},
{
"name": "count",
"ordinal": 1,
"type_info": "Int8"
}
],
"nullable": [
false,
null
],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n SELECT joined.endpoint AS endpoint, COUNT(*) AS count\n FROM (\n (SELECT * FROM network_monitoring_content_nodes WHERE run_id = $1) AS cnodes\n JOIN\n (\n SELECT user_id, unnest(string_to_array(replica_set, ',')) AS user_endpoint \n FROM network_monitoring_users\n WHERE run_id = $1\n ) as unnested_users\n ON\n cnodes.endpoint = unnested_users.user_endpoint\n ) AS joined\n GROUP BY \n joined.endpoint; \n "
},
"8895d60fb3acdaac64ce7a5dd170c6a0df5c7e9cb6b8742c167bd103c712e472": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n INSERT INTO network_monitoring_users (\n user_id,\n wallet,\n replica_set,\n run_id,\n primarySpID,\n secondary1SpID,\n secondary2SpID\n )\n SELECT\n user_id,\n wallet,\n creator_node_endpoint AS replica_set,\n $1,\n primary_id as primarySpID,\n secondary_ids[1] as secondary1SpID,\n secondary_ids[2] as secondary2SpID\n FROM discovery.users\n WHERE is_current = TRUE;\n "
},
"8ba07fdc1401a2486f0d1e8ebae45577a742f3f59fa08df1b9c1d6f9130cb5d0": {
"describe": {
"columns": [
{
"name": "spid",
"ordinal": 0,
"type_info": "Int4"
},
{
"name": "endpoint",
"ordinal": 1,
"type_info": "Varchar"
}
],
"nullable": [
false,
false
],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n SELECT spid, endpoint\n FROM network_monitoring_content_nodes\n WHERE run_id = $1; \n "
},
"8bef028ac8c2e732b07f15c5b789f859665cc35fc951768ab629f81270c52480": {
"describe": {
"columns": [
{
"name": "spid",
"ordinal": 0,
"type_info": "Int4"
},
{
"name": "primary_count",
"ordinal": 1,
"type_info": "Int8"
},
{
"name": "secondary1_count",
"ordinal": 2,
"type_info": "Int8"
},
{
"name": "secondary2_count",
"ordinal": 3,
"type_info": "Int8"
}
],
"nullable": [
false,
null,
null,
null
],
"parameters": {
"Left": [
"Int4",
"Int4"
]
}
},
"query": "\n SELECT primary_group.spid as spid, primary_count, secondary1_count, secondary2_count\n FROM (\n (\n SELECT primaryspid AS spid, COUNT(*) AS primary_count\n FROM network_monitoring_users \n WHERE run_id = $1\n GROUP BY primaryspid\n ) as primary_group\n JOIN \n (\n SELECT secondary1spid AS spid, COUNT(*) AS secondary1_count \n FROM network_monitoring_users \n WHERE run_id = $1\n GROUP BY secondary1spid\n ) secondary1_group\n ON primary_group.spid = secondary1_group.spid\n JOIN\n (\n SELECT secondary2spid AS spid, COUNT(*) AS secondary2_count \n FROM network_monitoring_users \n WHERE run_id = $1\n GROUP BY secondary2spid\n ) secondary2_group\n ON primary_group.spid = secondary2_group.spid\n )\n WHERE primary_group.spid = $2; \n "
},
"967d1dae4ec8f491f01a0bce00f69ec9398b3f70cdfc33568129dd4026d9a972": {
"describe": {
"columns": [
{
"name": "user_count",
"ordinal": 0,
"type_info": "Int8"
}
],
"nullable": [
null
],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n SELECT COUNT(*) as user_count\n FROM network_monitoring_users\n WHERE\n run_id = $1\n AND \n primary_clock_value IS NOT NULL\n AND \n primary_clock_value != -2\n AND\n primary_clock_value = secondary1_clock_value\n AND\n secondary1_clock_value = secondary2_clock_value; \n "
},
"98e1d6d06069d3dc7095b9864960d0bbc150b961642a239accb2182dd2feb918": {
"describe": {
"columns": [
{
"name": "user_count",
"ordinal": 0,
"type_info": "Int8"
}
],
"nullable": [
null
],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n SELECT COUNT(*) as user_count\n FROM network_monitoring_users\n WHERE run_id = $1\n "
},
"a99f8841477a648e36b15823a637e1dac5075874b4916f319eb5882e4d67fa74": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int4",
"TextArray",
"Int4Array"
]
}
},
"query": "\n UPDATE network_monitoring_users as nm_users\n SET secondary1_clock_value = tmp.clock\n FROM UNNEST($2::text[], $3::int[]) AS tmp(wallet, clock)\n WHERE nm_users.wallet = tmp.wallet\n AND nm_users.run_id = $1;\n "
},
"be244fdf46a47897fd954e274ed06f097edeaa9baaa51a1a10cebdb60859f8e0": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n INSERT INTO network_monitoring_cids_from_discovery (cid, run_id, ctype, user_id)\n SELECT download -> 'cid' as cid, $1, 'track', owner_id\n FROM discovery.tracks\n WHERE download -> 'cid' != 'null'\n AND is_current = TRUE;\n "
},
"cde9625ab5b6b0bff681d06a3203242e510d55e71d1f84c0fd6eb55b3ea8f5ea": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int4",
"TextArray",
"Int4Array"
]
}
},
"query": "\n UPDATE network_monitoring_users as nm_users\n SET primary_clock_value = tmp.clock\n FROM UNNEST($2::text[], $3::int[]) AS tmp(wallet, clock)\n WHERE nm_users.wallet = tmp.wallet\n AND nm_users.run_id = $1;\n "
},
"d4f48dec146a4db05973d31f0a0d0a51902e6afd533113820ad915eedd083e98": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n INSERT INTO network_monitoring_cids_from_discovery (cid, run_id, ctype, user_id)\n SELECT cover_art_sizes, $1, 'dir', owner_id\n FROM discovery.tracks\n WHERE cover_art_sizes IS NOT NULL\n AND is_current = TRUE;\n "
},
"dc4c5909a6ea159554fb8765f8e763c2b9fe29d29fe730b67ef54b039fd7dce5": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": []
}
},
"query": "\n IMPORT FOREIGN SCHEMA \"public\"\n LIMIT\n TO (users, tracks, blocks, ursm_content_nodes)\n FROM\n SERVER fdw_server_connection INTO discovery; \n "
},
"dd117e01ab6be61c56a1c3215c267c3c0d764af9ac6672051e5c83d5e075b46a": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int4",
"Int4",
"Varchar"
]
}
},
"query": "\n INSERT INTO network_monitoring_content_nodes (run_id, spid, endpoint)\n VALUES (\n $1,\n $2,\n $3\n );\n "
},
"dd3329af9e97a44fe0e9e07274c2792276a67772ccf52872124e66394da669fa": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": []
}
},
"query": "\n DROP SCHEMA IF EXISTS discovery CASCADE;\n "
},
"ddd5ad17051e8b1bf67683c07e0b43692d73be9dd03b7bf0b3d7750ab1c6e928": {
"describe": {
"columns": [
{
"name": "wallet",
"ordinal": 0,
"type_info": "Text"
}
],
"nullable": [
false
],
"parameters": {
"Left": [
"Int4",
"Int4",
"Int8",
"Int8"
]
}
},
"query": "\n SELECT wallet \n FROM network_monitoring_users\n WHERE run_id = $1\n AND secondary1spid = $2\n ORDER BY user_id \n OFFSET $3\n LIMIT $4; \n "
},
"ef1875993a3b828ae0f793f26935b51c0cc891fe4d461db2ac91e185165a1ab3": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": []
}
},
"query": "\n CREATE SCHEMA discovery;\n "
},
"ef58c67355a4d92c5a294b40a87e6c75e8ab208829e2691b2ab98a0d83b4c644": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n INSERT INTO network_monitoring_cids_from_discovery (cid, run_id, ctype, user_id)\n SELECT profile_picture, $1, 'image', user_id\n FROM discovery.users\n WHERE profile_picture IS NOT NULL\n AND profile_picture != '0'\n AND user_id IS NOT NULL\n AND is_current = TRUE;\n "
},
"efbdcd0dbed6c8ddbf882edea33618844a495850d06b4ccbcd724f1bd10a3b19": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n INSERT INTO network_monitoring_cids_from_discovery (cid, run_id, ctype, user_id)\n SELECT cover_photo_sizes, $1, 'dir', user_id\n FROM discovery.users\n WHERE cover_photo_sizes IS NOT NULL\n AND is_current = TRUE;\n "
},
"f2697016b57f6cf1b7833b053ad07f77735ca915b5cc8b20e480d7aedf4a388d": {
"describe": {
"columns": [],
"nullable": [],
"parameters": {
"Left": [
"Int4"
]
}
},
"query": "\n INSERT INTO network_monitoring_cids_from_discovery (cid, run_id, ctype, user_id)\n SELECT profile_picture_sizes, $1, 'dir', user_id\n FROM discovery.users\n WHERE profile_picture_sizes IS NOT NULL\n AND is_current = TRUE;\n "
}
}