-
Global information
- Generated on Sun Dec 7 04:37:31 2025
- Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log , ..., ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.9.gz
- Parsed 22,335,541 log entries in 37m29s
- Log start from 2025-11-30 00:00:01 to 2025-12-06 23:59:55
-
Overview
Global Stats
- 1,737 Number of unique normalized queries
- 2,657,596 Number of queries
- 2h54m9s Total query duration
- 2025-11-30 00:00:01 First query
- 2025-12-06 23:59:48 Last query
- 1,508 queries/s at 2025-12-05 13:00:03 Query peak
- 2h54m9s Total query duration
- 3m56s Prepare/parse total duration
- 5m51s Bind total duration
- 2h44m20s Execute total duration
- 239,960 Number of events
- 8 Number of unique normalized events
- 239,162 Max number of times the same event was reported
- 0 Number of cancellation
- 3,042 Total number of automatic vacuums
- 3,363 Total number of automatic analyzes
- 46,863 Number temporary file
- 14.36 MiB Max size of temporary file
- 2.08 MiB Average size of temporary file
- 107,755 Total number of sessions
- 3 sessions at 2025-12-04 21:53:22 Session peak
- 6h3m41s Total duration of sessions
- 202ms Average duration of sessions
- 24 Average queries per session
- 96ms Average queries duration per session
- 105ms Average idle time per session
- 107,755 Total number of connections
- 15 connections/s at 2025-12-01 17:02:04 Connection peak
- 3 Total number of databases
SQL Traffic
Key values
- 1,508 queries/s Query Peak
- 2025-12-05 13:00:03 Date
SELECT Traffic
Key values
- 1,502 queries/s Query Peak
- 2025-12-05 13:00:03 Date
INSERT/UPDATE/DELETE Traffic
Key values
- 1,364 queries/s Query Peak
- 2025-12-06 23:35:17 Date
Queries duration
Key values
- 2h54m9s Total query duration
Prepared queries ratio
Key values
- 0.00 Ratio of bind vs prepare
- 0.00 % Ratio between prepared and "usual" statements
General Activity
↑ Back to the top of the General Activity tableDay Hour Count Min duration Max duration Avg duration Latency Percentile(90) Latency Percentile(95) Latency Percentile(99) Nov 30 00 7,552 0ms 36ms 0ms 7ms 37ms 996ms 01 6,444 0ms 29ms 0ms 6ms 7ms 127ms 02 6,420 0ms 1ms 0ms 7ms 7ms 7ms 03 6,420 0ms 1ms 0ms 7ms 7ms 8ms 04 6,420 0ms 1ms 0ms 7ms 7ms 8ms 05 16,201 0ms 6m6s 28ms 1s329ms 3s174ms 6m6s 06 15,132 0ms 1s364ms 1ms 1s299ms 1s359ms 1s515ms 07 15,035 0ms 1s368ms 1ms 1s335ms 1s416ms 1s490ms 08 13,742 0ms 1s567ms 1ms 1s341ms 1s553ms 1s676ms 09 13,766 0ms 1s500ms 1ms 1s326ms 1s409ms 1s597ms 10 13,932 0ms 1s352ms 1ms 1s316ms 1s407ms 1s494ms 11 14,604 0ms 1s569ms 1ms 1s351ms 1s455ms 1s666ms 12 13,779 0ms 1s527ms 1ms 1s341ms 1s473ms 1s628ms 13 14,847 0ms 1s459ms 1ms 1s326ms 1s493ms 1s558ms 14 13,959 0ms 1s243ms 1ms 1s280ms 1s321ms 1s464ms 15 17,341 0ms 1s410ms 0ms 1s362ms 1s455ms 1s583ms 16 13,704 0ms 1s351ms 1ms 1s322ms 1s372ms 1s531ms 17 14,248 0ms 9m19s 46ms 1s428ms 2s339ms 9m19s 18 14,499 0ms 1s300ms 1ms 1s350ms 1s363ms 1s458ms 19 13,759 0ms 1s333ms 1ms 1s327ms 1s386ms 1s430ms 20 13,704 0ms 1s459ms 1ms 1s348ms 1s503ms 1s555ms 21 14,444 0ms 1s423ms 1ms 1s317ms 1s416ms 1s526ms 22 17,660 0ms 1s358ms 0ms 1s300ms 1s404ms 1s567ms 23 19,206 0ms 2s845ms 1ms 1s416ms 2s137ms 2s938ms Dec 01 00 7,123 0ms 19ms 0ms 7ms 7ms 902ms 01 6,444 0ms 1ms 0ms 7ms 7ms 10ms 02 6,420 0ms 1ms 0ms 7ms 8ms 10ms 03 6,420 0ms 2ms 0ms 7ms 8ms 11ms 04 6,420 0ms 2ms 0ms 7ms 7ms 7ms 05 14,569 0ms 9m35s 47ms 1s333ms 2s948ms 9m35s 06 15,916 0ms 1s311ms 0ms 1s330ms 1s406ms 1s513ms 07 18,566 0ms 1s399ms 0ms 1s417ms 1s495ms 1s602ms 08 18,481 0ms 1s387ms 0ms 1s360ms 1s502ms 1s605ms 09 43,877 0ms 1s320ms 0ms 1s511ms 1s694ms 1s919ms 10 30,354 0ms 1s453ms 0ms 1s459ms 1s713ms 2s262ms 11 21,532 0ms 1s323ms 0ms 1s370ms 1s517ms 1s807ms 12 21,682 0ms 1s339ms 0ms 1s326ms 1s586ms 1s966ms 13 16,955 0ms 1s280ms 0ms 1s319ms 1s366ms 1s576ms 14 20,211 0ms 1s344ms 0ms 1s383ms 1s447ms 1s690ms 15 15,962 0ms 1s729ms 1ms 1s326ms 1s376ms 1s827ms 16 18,827 0ms 1s801ms 0ms 1s380ms 1s438ms 1s917ms 17 14,161 0ms 9m20s 47ms 1s469ms 34s830ms 9m20s 18 37,929 0ms 1s412ms 0ms 1s370ms 2s21ms 2s97ms 19 21,478 0ms 1s338ms 0ms 1s365ms 1s444ms 2s277ms 20 24,506 0ms 1s497ms 0ms 1s359ms 1s429ms 1s592ms 21 18,561 0ms 1s480ms 0ms 1s362ms 1s418ms 1s577ms 22 15,900 0ms 1s324ms 0ms 1s302ms 1s345ms 1s592ms 23 25,442 0ms 1s632ms 0ms 1s379ms 1s568ms 1s727ms Dec 02 00 7,123 0ms 13ms 0ms 7ms 7ms 794ms 01 6,444 0ms 1ms 0ms 6ms 7ms 10ms 02 6,433 0ms 5ms 0ms 7ms 7ms 13ms 03 6,475 0ms 3ms 0ms 6ms 7ms 18ms 04 6,420 0ms 1ms 0ms 6ms 7ms 7ms 05 15,620 0ms 9m19s 42ms 1s370ms 2s837ms 9m19s 06 15,934 0ms 1s397ms 1ms 1s363ms 1s453ms 1s633ms 07 19,911 0ms 1s389ms 0ms 1s319ms 1s590ms 1s660ms 08 28,127 0ms 1s497ms 0ms 1s413ms 1s662ms 2s575ms 09 34,500 0ms 1s275ms 0ms 1s361ms 1s398ms 1s554ms 10 23,110 0ms 1s511ms 0ms 1s412ms 1s479ms 1s699ms 11 21,988 0ms 1s316ms 0ms 1s432ms 1s528ms 1s548ms 12 22,070 0ms 1s381ms 0ms 1s363ms 1s513ms 1s587ms 13 24,637 0ms 1s727ms 0ms 1s398ms 1s516ms 1s960ms 14 19,470 0ms 1s362ms 0ms 1s420ms 1s461ms 1s470ms 15 16,814 0ms 1s327ms 0ms 1s361ms 1s410ms 1s450ms 16 16,053 0ms 1s380ms 1ms 1s404ms 1s467ms 1s503ms 17 17,192 0ms 6m6s 26ms 1s353ms 1s573ms 6m6s 18 14,789 0ms 1s368ms 1ms 1s304ms 1s414ms 1s468ms 19 13,637 0ms 1s352ms 1ms 1s317ms 1s385ms 1s447ms 20 13,637 0ms 1s298ms 1ms 1s298ms 1s386ms 1s512ms 21 14,552 0ms 1s459ms 1ms 1s369ms 1s413ms 1s570ms 22 13,637 0ms 1s339ms 1ms 1s367ms 1s438ms 1s484ms 23 20,531 0ms 1s701ms 0ms 1s430ms 1s554ms 1s877ms Dec 03 00 7,123 0ms 12ms 0ms 7ms 7ms 733ms 01 6,444 0ms 1ms 0ms 7ms 7ms 11ms 02 7,250 0ms 8ms 0ms 7ms 7ms 36ms 03 6,420 0ms 1ms 0ms 7ms 7ms 7ms 04 6,420 0ms 1ms 0ms 7ms 7ms 8ms 05 14,831 0ms 1s443ms 1ms 1s419ms 1s547ms 7s685ms 06 16,415 0ms 1s353ms 0ms 1s401ms 1s460ms 1s523ms 07 22,876 0ms 1s473ms 0ms 1s353ms 1s501ms 1s589ms 08 36,771 0ms 2s224ms 0ms 1s478ms 1s669ms 2s580ms 09 34,677 0ms 1s356ms 0ms 1s460ms 1s824ms 2s212ms 10 22,100 0ms 1s418ms 0ms 1s408ms 1s441ms 1s603ms 11 28,107 0ms 1s404ms 0ms 1s460ms 1s513ms 1s835ms 12 24,605 0ms 1s617ms 0ms 1s379ms 1s548ms 1s873ms 13 19,174 0ms 1s496ms 0ms 1s445ms 1s516ms 1s906ms 14 17,903 0ms 1s379ms 0ms 1s339ms 1s585ms 2s166ms 15 19,350 0ms 1s323ms 0ms 1s352ms 1s411ms 1s424ms 16 16,884 0ms 1s353ms 0ms 1s369ms 1s413ms 1s623ms 17 16,037 0ms 9m12s 41ms 1s458ms 1s794ms 9m12s 18 14,686 0ms 1m12s 8ms 1s586ms 5s819ms 1m16s 19 15,732 0ms 1s364ms 1ms 1s328ms 1s391ms 1s578ms 20 15,361 0ms 1s354ms 1ms 1s351ms 1s433ms 1s533ms 21 13,667 0ms 1s375ms 1ms 1s300ms 1s414ms 1s529ms 22 17,630 0ms 1s347ms 0ms 1s369ms 1s441ms 1s488ms 23 22,656 0ms 1s435ms 0ms 1s386ms 1s515ms 1s774ms Dec 04 00 7,123 0ms 12ms 0ms 7ms 7ms 886ms 01 6,444 0ms 1ms 0ms 7ms 7ms 11ms 02 6,420 0ms 1ms 0ms 7ms 7ms 7ms 03 6,420 0ms 1ms 0ms 7ms 7ms 8ms 04 6,420 0ms 2ms 0ms 7ms 8ms 8ms 05 16,259 0ms 6m3s 27ms 1s348ms 3s15ms 6m3s 06 15,902 0ms 1s535ms 1ms 1s449ms 1s501ms 1s662ms 07 17,221 0ms 1s349ms 0ms 1s323ms 1s385ms 1s629ms 08 23,931 0ms 1s377ms 0ms 1s382ms 1s489ms 1s688ms 09 33,426 0ms 2s244ms 0ms 1s571ms 1s687ms 2s340ms 10 20,438 0ms 1s742ms 0ms 1s315ms 1s430ms 1s860ms 11 17,493 0ms 1s373ms 0ms 1s446ms 1s498ms 1s570ms 12 18,625 0ms 1s998ms 0ms 1s350ms 1s431ms 2s325ms 13 21,723 0ms 2s10ms 0ms 1s391ms 1s456ms 2s122ms 14 19,756 0ms 1s574ms 0ms 1s327ms 1s619ms 1s732ms 15 17,412 0ms 1s281ms 0ms 1s328ms 1s378ms 1s496ms 16 21,349 0ms 1s877ms 0ms 1s404ms 1s560ms 1s973ms 17 14,707 0ms 6m9s 30ms 1s405ms 1s985ms 6m9s 18 14,103 0ms 1s294ms 1ms 1s296ms 1s362ms 1s540ms 19 13,755 0ms 1s544ms 1ms 1s303ms 1s420ms 1s640ms 20 13,755 0ms 1s470ms 1ms 1s380ms 1s441ms 1s578ms 21 14,899 0ms 2s331ms 1ms 1s348ms 1s680ms 2s424ms 22 13,755 0ms 1s339ms 1ms 1s367ms 1s429ms 1s571ms 23 21,482 0ms 1s655ms 0ms 1s430ms 1s574ms 1s751ms Dec 05 00 7,453 0ms 19ms 0ms 7ms 7ms 997ms 01 6,444 0ms 36ms 0ms 7ms 7ms 136ms 02 6,420 0ms 1ms 0ms 7ms 7ms 7ms 03 6,420 0ms 1ms 0ms 7ms 7ms 7ms 04 6,420 0ms 1ms 0ms 7ms 7ms 7ms 05 16,502 0ms 9m19s 40ms 1s445ms 34s979ms 9m19s 06 16,649 0ms 1s288ms 0ms 1s319ms 1s373ms 1s528ms 07 20,338 0ms 1s570ms 0ms 1s428ms 1s452ms 1s668ms 08 20,508 0ms 2s147ms 0ms 1s322ms 1s469ms 2s241ms 09 23,442 0ms 2s153ms 0ms 1s361ms 1s591ms 2s247ms 10 20,122 0ms 1s458ms 0ms 1s543ms 1s709ms 1s877ms 11 21,033 0ms 2s326ms 0ms 1s327ms 1s457ms 2s452ms 12 18,358 0ms 2s317ms 0ms 1s315ms 1s461ms 2s419ms 13 23,623 0ms 1s482ms 0ms 1s396ms 1s424ms 1s964ms 14 16,899 0ms 1s753ms 1ms 1s377ms 1s567ms 1s847ms 15 13,920 0ms 1s325ms 1ms 1s285ms 1s389ms 1s492ms 16 13,665 0ms 1s640ms 1ms 1s310ms 1s407ms 1s742ms 17 14,562 0ms 9m21s 46ms 1s386ms 1s444ms 9m21s 18 14,519 0ms 1s328ms 1ms 1s347ms 1s421ms 1s438ms 19 15,850 0ms 1s367ms 0ms 1s365ms 1s420ms 1s486ms 20 14,440 0ms 1s359ms 1ms 1s305ms 1s435ms 1s500ms 21 13,660 0ms 1s316ms 1ms 1s349ms 1s395ms 1s496ms 22 13,660 0ms 1s698ms 1ms 1s380ms 1s496ms 1s928ms 23 20,381 0ms 1s362ms 0ms 1s391ms 1s461ms 1s963ms Dec 06 00 7,551 0ms 18ms 0ms 7ms 7ms 996ms 01 6,444 0ms 15ms 0ms 7ms 7ms 48ms 02 6,420 0ms 1ms 0ms 7ms 7ms 7ms 03 6,420 0ms 1ms 0ms 7ms 7ms 7ms 04 6,420 0ms 3ms 0ms 7ms 7ms 10ms 05 16,275 0ms 6m12s 28ms 1s380ms 2s943ms 6m12s 06 15,776 0ms 1s956ms 1ms 1s341ms 1s420ms 2s48ms 07 13,737 0ms 1s439ms 1ms 1s338ms 1s388ms 1s540ms 08 14,320 0ms 1s636ms 1ms 1s403ms 1s494ms 1s731ms 09 14,561 0ms 1s345ms 1ms 1s303ms 1s369ms 1s516ms 10 13,822 0ms 1s489ms 1ms 1s267ms 1s435ms 1s612ms 11 14,492 0ms 1s427ms 1ms 1s293ms 1s421ms 1s527ms 12 14,948 0ms 1s400ms 1ms 1s391ms 1s437ms 1s502ms 13 15,829 0ms 1s336ms 0ms 1s300ms 1s373ms 1s444ms 14 14,574 0ms 1s313ms 1ms 1s354ms 1s387ms 1s426ms 15 13,727 0ms 2s56ms 1ms 1s390ms 1s519ms 2s155ms 16 13,727 0ms 1s567ms 1ms 1s315ms 1s613ms 1s697ms 17 16,937 0ms 9m24s 40ms 1s415ms 35s413ms 9m24s 18 18,042 0ms 1s287ms 0ms 1s303ms 1s342ms 1s519ms 19 14,170 0ms 1s328ms 1ms 1s339ms 1s414ms 1s422ms 20 14,749 0ms 1s293ms 0ms 1s312ms 1s345ms 1s390ms 21 14,385 0ms 1s375ms 1ms 1s291ms 1s432ms 1s722ms 22 14,135 0ms 1s440ms 1ms 1s369ms 1s468ms 1s568ms 23 21,252 0ms 1s663ms 0ms 1s312ms 1s479ms 1s802ms Day Hour SELECT COPY TO Average Duration Latency Percentile(90) Latency Percentile(95) Latency Percentile(99) Nov 30 00 6,818 0 0ms 6ms 6ms 18ms 01 6,024 0 0ms 5ms 6ms 6ms 02 6,000 0 0ms 6ms 6ms 6ms 03 6,000 0 0ms 5ms 6ms 6ms 04 6,000 0 0ms 6ms 6ms 7ms 05 12,732 0 0ms 83ms 90ms 420ms 06 13,544 0 0ms 65ms 86ms 90ms 07 14,137 0 0ms 28ms 88ms 113ms 08 12,891 0 0ms 21ms 89ms 100ms 09 12,913 0 0ms 21ms 87ms 107ms 10 13,076 0 0ms 21ms 88ms 96ms 11 13,722 0 0ms 22ms 87ms 125ms 12 12,922 0 0ms 19ms 91ms 112ms 13 13,942 0 0ms 22ms 85ms 108ms 14 13,064 0 0ms 20ms 86ms 88ms 15 16,365 0 0ms 51ms 93ms 176ms 16 12,861 0 0ms 22ms 88ms 99ms 17 12,450 0 0ms 18ms 88ms 224ms 18 13,612 0 0ms 44ms 88ms 226ms 19 12,903 0 0ms 20ms 87ms 90ms 20 12,861 0 0ms 23ms 87ms 99ms 21 13,591 0 0ms 19ms 86ms 95ms 22 16,754 0 0ms 30ms 86ms 101ms 23 12,509 0 0ms 23ms 86ms 88ms Dec 01 00 6,402 0 0ms 6ms 6ms 11ms 01 6,024 0 0ms 6ms 6ms 7ms 02 6,000 0 0ms 6ms 6ms 8ms 03 6,000 0 0ms 6ms 6ms 7ms 04 6,000 0 0ms 6ms 6ms 6ms 05 11,718 0 0ms 6ms 88ms 504ms 06 14,094 0 0ms 84ms 90ms 184ms 07 17,607 0 0ms 107ms 239ms 342ms 08 17,483 0 0ms 86ms 122ms 290ms 09 41,987 0 0ms 287ms 435ms 552ms 10 29,105 0 0ms 262ms 421ms 485ms 11 20,577 0 0ms 207ms 307ms 361ms 12 20,674 0 0ms 151ms 281ms 532ms 13 15,905 0 0ms 87ms 92ms 437ms 14 19,053 0 0ms 86ms 126ms 302ms 15 15,053 0 0ms 52ms 88ms 485ms 16 17,801 0 0ms 40ms 90ms 157ms 17 12,363 0 0ms 19ms 92ms 229ms 18 36,124 0 0ms 328ms 747ms 928ms 19 20,469 0 0ms 89ms 123ms 322ms 20 23,471 0 0ms 88ms 164ms 837ms 21 17,622 0 0ms 85ms 90ms 434ms 22 15,020 0 0ms 71ms 87ms 257ms 23 18,597 0 0ms 84ms 118ms 333ms Dec 02 00 6,402 0 0ms 5ms 6ms 7ms 01 6,024 0 0ms 5ms 6ms 6ms 02 6,009 0 0ms 5ms 6ms 6ms 03 6,042 0 0ms 5ms 6ms 6ms 04 6,000 0 0ms 5ms 6ms 6ms 05 12,258 0 0ms 6ms 87ms 373ms 06 14,194 0 0ms 84ms 88ms 227ms 07 18,871 0 0ms 90ms 296ms 486ms 08 26,860 0 0ms 173ms 295ms 842ms 09 33,241 0 0ms 116ms 246ms 633ms 10 21,983 0 0ms 103ms 267ms 525ms 11 21,001 0 0ms 118ms 202ms 281ms 12 21,000 0 0ms 88ms 235ms 377ms 13 23,566 0 0ms 156ms 274ms 493ms 14 18,477 0 0ms 88ms 120ms 331ms 15 15,841 0 0ms 85ms 89ms 201ms 16 15,103 0 0ms 73ms 98ms 222ms 17 15,281 0 0ms 85ms 96ms 423ms 18 13,874 0 0ms 21ms 88ms 106ms 19 12,794 0 0ms 18ms 87ms 95ms 20 12,794 0 0ms 22ms 85ms 90ms 21 13,662 0 0ms 21ms 88ms 101ms 22 12,794 0 0ms 21ms 89ms 105ms 23 13,787 0 0ms 24ms 93ms 116ms Dec 03 00 6,402 0 0ms 6ms 6ms 7ms 01 6,024 0 0ms 6ms 6ms 7ms 02 6,801 0 0ms 6ms 6ms 19ms 03 6,000 0 0ms 6ms 6ms 6ms 04 6,000 0 0ms 6ms 6ms 6ms 05 12,446 0 0ms 40ms 91ms 380ms 06 14,740 0 0ms 68ms 93ms 224ms 07 21,569 0 0ms 105ms 138ms 377ms 08 35,403 0 0ms 318ms 367ms 527ms 09 32,746 0 0ms 306ms 505ms 826ms 10 20,704 0 0ms 90ms 139ms 470ms 11 26,783 0 0ms 183ms 390ms 764ms 12 23,370 0 0ms 119ms 224ms 423ms 13 18,010 0 0ms 75ms 93ms 222ms 14 16,812 0 0ms 63ms 89ms 391ms 15 18,288 0 0ms 85ms 92ms 142ms 16 15,918 0 0ms 55ms 100ms 124ms 17 14,188 0 0ms 24ms 89ms 458ms 18 13,447 184 7ms 87ms 108ms 18s960ms 19 14,834 0 0ms 82ms 86ms 220ms 20 14,455 0 0ms 24ms 88ms 96ms 21 12,824 0 0ms 22ms 86ms 97ms 22 16,703 0 0ms 30ms 88ms 125ms 23 15,801 0 0ms 39ms 88ms 107ms Dec 04 00 6,402 0 0ms 6ms 6ms 6ms 01 6,024 0 0ms 6ms 6ms 6ms 02 6,000 0 0ms 6ms 6ms 6ms 03 6,000 0 0ms 6ms 6ms 6ms 04 6,000 0 0ms 6ms 6ms 7ms 05 12,762 0 0ms 73ms 87ms 399ms 06 14,147 0 0ms 38ms 94ms 215ms 07 16,328 0 0ms 104ms 175ms 236ms 08 22,515 0 0ms 142ms 180ms 365ms 09 32,068 0 0ms 252ms 302ms 396ms 10 19,277 0 0ms 88ms 164ms 334ms 11 16,496 0 0ms 87ms 103ms 230ms 12 17,584 0 0ms 89ms 117ms 385ms 13 20,582 0 0ms 90ms 160ms 210ms 14 18,711 0 0ms 86ms 95ms 248ms 15 16,444 0 0ms 84ms 105ms 250ms 16 20,251 0 0ms 87ms 218ms 332ms 17 12,886 0 0ms 23ms 88ms 232ms 18 13,232 0 0ms 40ms 87ms 135ms 19 12,912 0 0ms 22ms 87ms 91ms 20 12,912 0 0ms 18ms 88ms 101ms 21 14,026 0 0ms 41ms 89ms 146ms 22 12,912 0 0ms 23ms 88ms 96ms 23 14,678 0 0ms 77ms 90ms 146ms Dec 05 00 6,719 0 0ms 5ms 6ms 21ms 01 6,024 0 0ms 5ms 6ms 6ms 02 6,000 0 0ms 5ms 6ms 6ms 03 6,000 0 0ms 5ms 5ms 6ms 04 6,000 0 0ms 5ms 6ms 6ms 05 13,140 0 0ms 85ms 109ms 981ms 06 14,879 0 0ms 78ms 91ms 145ms 07 19,310 0 0ms 104ms 189ms 606ms 08 19,546 0 0ms 99ms 166ms 408ms 09 22,414 0 0ms 120ms 183ms 530ms 10 18,902 0 0ms 90ms 206ms 313ms 11 19,938 0 0ms 88ms 218ms 381ms 12 17,345 0 0ms 65ms 89ms 183ms 13 22,597 0 0ms 162ms 219ms 428ms 14 15,988 0 0ms 88ms 220ms 467ms 15 13,045 0 0ms 21ms 89ms 123ms 16 12,822 0 0ms 18ms 89ms 92ms 17 12,738 0 0ms 18ms 87ms 208ms 18 13,612 0 0ms 18ms 87ms 104ms 19 14,930 0 0ms 23ms 88ms 120ms 20 13,571 0 0ms 26ms 87ms 99ms 21 12,817 0 0ms 21ms 89ms 105ms 22 12,817 0 0ms 21ms 89ms 103ms 23 13,626 0 0ms 21ms 87ms 98ms Dec 06 00 6,817 0 0ms 5ms 6ms 15ms 01 6,024 0 0ms 5ms 6ms 7ms 02 6,000 0 0ms 5ms 6ms 6ms 03 6,000 0 0ms 5ms 6ms 6ms 04 6,000 0 0ms 6ms 6ms 6ms 05 12,763 0 0ms 79ms 87ms 356ms 06 13,918 0 0ms 69ms 87ms 103ms 07 12,894 0 0ms 18ms 87ms 98ms 08 13,433 0 0ms 20ms 86ms 140ms 09 13,692 0 0ms 20ms 88ms 99ms 10 12,967 0 0ms 19ms 89ms 186ms 11 13,631 0 0ms 28ms 87ms 97ms 12 14,061 0 0ms 27ms 87ms 251ms 13 14,940 0 0ms 27ms 88ms 119ms 14 13,691 0 0ms 20ms 87ms 112ms 15 12,884 0 0ms 18ms 88ms 96ms 16 12,884 0 0ms 19ms 87ms 92ms 17 15,084 0 0ms 54ms 90ms 435ms 18 17,085 0 0ms 49ms 88ms 94ms 19 13,296 0 0ms 22ms 88ms 105ms 20 13,870 0 0ms 19ms 89ms 110ms 21 13,515 0 0ms 19ms 88ms 93ms 22 13,265 0 0ms 20ms 89ms 97ms 23 14,454 0 0ms 21ms 87ms 125ms Day Hour INSERT UPDATE DELETE COPY FROM Average Duration Latency Percentile(90) Latency Percentile(95) Latency Percentile(99) Nov 30 00 102 1 0 0 0ms 0ms 0ms 1ms 01 0 0 0 0 0ms 0ms 0ms 0ms 02 0 0 0 0 0ms 0ms 0ms 0ms 03 0 0 0 0 0ms 0ms 0ms 0ms 04 0 0 0 0 0ms 0ms 0ms 0ms 05 623 195 0 0 1ms 0ms 2ms 191ms 06 154 216 0 0 0ms 3ms 3ms 55ms 07 18 100 0 0 1ms 3ms 4ms 6ms 08 12 94 0 0 1ms 3ms 3ms 4ms 09 12 95 0 0 1ms 3ms 3ms 4ms 10 11 96 0 0 1ms 3ms 3ms 6ms 11 16 98 0 0 1ms 3ms 4ms 7ms 12 13 95 0 0 1ms 3ms 3ms 4ms 13 20 100 0 0 1ms 3ms 4ms 7ms 14 21 98 0 0 1ms 3ms 3ms 6ms 15 30 107 0 0 1ms 3ms 4ms 13ms 16 10 94 0 0 1ms 3ms 3ms 4ms 17 9 86 0 0 1ms 3ms 3ms 5ms 18 11 102 0 0 1ms 3ms 4ms 6ms 19 12 96 0 0 1ms 3ms 3ms 4ms 20 10 94 0 0 1ms 3ms 4ms 4ms 21 10 96 0 0 1ms 3ms 3ms 5ms 22 19 100 0 0 1ms 3ms 3ms 5ms 23 10 94 0 0 1ms 3ms 4ms 4ms Dec 01 00 100 0 0 0 0ms 0ms 0ms 0ms 01 0 0 0 0 0ms 0ms 0ms 0ms 02 0 0 0 0 0ms 0ms 0ms 0ms 03 0 0 0 0 0ms 0ms 0ms 0ms 04 0 0 0 0 0ms 0ms 0ms 0ms 05 415 150 0 0 0ms 0ms 0ms 5ms 06 231 295 0 0 0ms 3ms 4ms 46ms 07 26 96 0 0 1ms 3ms 3ms 6ms 08 28 116 0 0 4ms 3ms 5ms 11ms 09 169 229 0 0 1ms 6ms 9ms 56ms 10 48 152 0 0 1ms 4ms 8ms 14ms 11 15 103 0 0 1ms 3ms 4ms 7ms 12 24 114 0 0 1ms 3ms 4ms 10ms 13 39 111 0 0 1ms 3ms 6ms 11ms 14 59 120 0 0 1ms 4ms 6ms 12ms 15 20 102 0 0 1ms 3ms 4ms 7ms 16 38 109 0 0 1ms 4ms 5ms 8ms 17 9 86 0 0 1ms 3ms 3ms 4ms 18 121 266 0 0 1ms 6ms 11ms 60ms 19 16 120 0 0 1ms 3ms 6ms 11ms 20 24 114 0 0 1ms 3ms 4ms 8ms 21 17 105 0 0 1ms 3ms 4ms 9ms 22 14 97 0 0 1ms 3ms 3ms 5ms 23 26 106 0 0 1ms 3ms 3ms 7ms Dec 02 00 100 0 0 0 0ms 0ms 0ms 0ms 01 0 0 0 0 0ms 0ms 0ms 0ms 02 1 0 0 0 5ms 0ms 0ms 0ms 03 2 2 0 0 1ms 0ms 0ms 0ms 04 0 0 0 0 0ms 0ms 0ms 0ms 05 623 168 0 0 0ms 0ms 2ms 60ms 06 186 249 0 0 0ms 3ms 4ms 32ms 07 68 117 0 0 2ms 4ms 5ms 38ms 08 95 190 0 0 1ms 3ms 5ms 35ms 09 61 133 0 0 1ms 3ms 6ms 14ms 10 34 124 0 0 1ms 3ms 5ms 11ms 11 23 106 0 0 1ms 3ms 4ms 8ms 12 39 121 0 0 1ms 3ms 5ms 13ms 13 31 126 0 0 1ms 3ms 4ms 10ms 14 26 113 0 0 1ms 3ms 4ms 11ms 15 24 108 0 0 1ms 3ms 4ms 8ms 16 27 101 0 0 1ms 3ms 4ms 7ms 17 23 98 0 0 1ms 3ms 4ms 5ms 18 22 105 0 0 1ms 3ms 4ms 8ms 19 10 94 0 0 1ms 3ms 3ms 4ms 20 10 94 0 0 1ms 3ms 4ms 4ms 21 17 99 0 0 1ms 3ms 4ms 5ms 22 10 94 0 0 1ms 3ms 3ms 4ms 23 13 97 0 0 1ms 3ms 4ms 5ms Dec 03 00 100 0 0 0 0ms 0ms 0ms 0ms 01 0 0 0 0 0ms 0ms 0ms 0ms 02 3 4 0 0 1ms 0ms 0ms 1ms 03 0 0 0 0 0ms 0ms 0ms 0ms 04 0 0 0 0 0ms 0ms 0ms 0ms 05 564 189 0 0 0ms 0ms 3ms 41ms 06 172 232 0 0 0ms 3ms 4ms 18ms 07 90 172 0 0 1ms 4ms 7ms 31ms 08 73 162 0 0 1ms 5ms 7ms 15ms 09 203 179 0 0 1ms 7ms 11ms 31ms 10 116 168 0 0 1ms 5ms 9ms 27ms 11 97 178 0 0 1ms 5ms 8ms 43ms 12 70 134 0 0 1ms 4ms 7ms 13ms 13 65 161 0 0 1ms 3ms 8ms 40ms 14 64 110 0 0 1ms 4ms 5ms 9ms 15 36 127 0 0 1ms 3ms 6ms 9ms 16 26 105 0 0 1ms 3ms 4ms 8ms 17 15 91 0 0 1ms 3ms 4ms 4ms 18 15 101 0 0 1ms 3ms 4ms 8ms 19 16 99 0 0 1ms 3ms 3ms 7ms 20 20 99 0 0 1ms 3ms 4ms 7ms 21 10 94 0 0 1ms 3ms 3ms 4ms 22 23 101 0 0 1ms 3ms 4ms 7ms 23 25 119 0 0 1ms 3ms 4ms 8ms Dec 04 00 100 0 0 0 0ms 0ms 0ms 0ms 01 0 0 0 0 0ms 0ms 0ms 0ms 02 0 0 0 0 0ms 0ms 0ms 0ms 03 0 0 0 0 0ms 0ms 0ms 0ms 04 0 0 0 0 0ms 0ms 0ms 0ms 05 660 208 0 0 0ms 0ms 2ms 96ms 06 176 251 0 0 0ms 3ms 3ms 17ms 07 10 96 0 0 1ms 2ms 3ms 4ms 08 118 124 0 0 1ms 5ms 6ms 10ms 09 89 175 0 0 1ms 6ms 9ms 38ms 10 66 160 0 0 1ms 3ms 6ms 48ms 11 34 106 0 0 1ms 3ms 4ms 8ms 12 42 121 0 0 1ms 3ms 5ms 10ms 13 58 141 0 0 1ms 4ms 5ms 14ms 14 42 108 0 0 1ms 3ms 4ms 8ms 15 24 104 0 0 1ms 2ms 4ms 6ms 16 40 139 0 0 3ms 3ms 5ms 54ms 17 10 90 0 0 1ms 2ms 3ms 5ms 18 12 99 0 0 1ms 3ms 4ms 5ms 19 10 94 0 0 1ms 2ms 3ms 5ms 20 10 94 0 0 1ms 2ms 3ms 4ms 21 13 98 0 0 1ms 3ms 3ms 5ms 22 10 94 0 0 1ms 2ms 3ms 4ms 23 23 108 0 0 1ms 3ms 3ms 15ms Dec 05 00 102 1 0 0 0ms 0ms 0ms 1ms 01 0 0 0 0 0ms 0ms 0ms 0ms 02 0 0 0 0 0ms 0ms 0ms 0ms 03 0 0 0 0 0ms 0ms 0ms 0ms 04 0 0 0 0 0ms 0ms 0ms 0ms 05 589 180 0 0 2ms 0ms 3ms 202ms 06 181 268 0 0 1ms 3ms 4ms 77ms 07 28 120 0 0 4ms 3ms 5ms 18ms 08 19 100 0 0 1ms 3ms 3ms 7ms 09 24 109 0 0 1ms 3ms 4ms 16ms 10 80 164 0 0 3ms 3ms 16ms 98ms 11 41 122 0 0 1ms 3ms 5ms 10ms 12 36 112 0 0 1ms 3ms 4ms 7ms 13 23 108 0 0 1ms 3ms 4ms 7ms 14 15 101 0 0 1ms 3ms 4ms 7ms 15 16 96 0 0 1ms 2ms 3ms 5ms 16 10 94 0 0 1ms 2ms 3ms 4ms 17 12 90 0 0 1ms 2ms 3ms 7ms 18 21 99 0 0 1ms 3ms 3ms 6ms 19 22 100 0 0 1ms 3ms 3ms 6ms 20 13 97 0 0 1ms 3ms 3ms 4ms 21 10 94 0 0 1ms 2ms 3ms 4ms 22 10 94 0 0 1ms 3ms 3ms 4ms 23 14 98 0 0 1ms 2ms 3ms 5ms Dec 06 00 102 1 0 0 0ms 0ms 0ms 1ms 01 0 0 0 0 0ms 0ms 0ms 0ms 02 0 0 0 0 0ms 0ms 0ms 0ms 03 0 0 0 0 0ms 0ms 0ms 0ms 04 0 0 0 0 0ms 0ms 0ms 0ms 05 634 231 0 0 0ms 0ms 2ms 98ms 06 219 282 0 0 0ms 3ms 4ms 28ms 07 10 94 0 0 1ms 2ms 3ms 4ms 08 17 98 0 0 1ms 3ms 4ms 7ms 09 13 97 0 0 1ms 2ms 3ms 5ms 10 11 97 0 0 1ms 2ms 3ms 4ms 11 11 98 0 0 1ms 2ms 3ms 4ms 12 14 99 0 0 1ms 3ms 3ms 6ms 13 15 101 0 0 1ms 2ms 3ms 4ms 14 17 97 0 0 1ms 2ms 3ms 5ms 15 10 94 0 0 1ms 2ms 3ms 3ms 16 10 94 0 0 1ms 2ms 3ms 4ms 17 11 94 0 0 1ms 2ms 3ms 7ms 18 26 104 0 0 1ms 3ms 3ms 11ms 19 14 98 0 0 1ms 3ms 3ms 5ms 20 15 98 0 0 1ms 2ms 3ms 5ms 21 14 97 0 0 1ms 3ms 3ms 4ms 22 14 97 0 0 1ms 3ms 4ms 5ms 23 22 101 0 0 1ms 3ms 4ms 6ms Day Hour Prepare Bind Bind/Prepare Percentage of prepare Nov 30 00 6,741 6,741 1.00 94.58% 01 5,820 5,820 1.00 96.61% 02 5,820 5,820 1.00 97.00% 03 5,820 5,820 1.00 97.00% 04 5,820 5,820 1.00 97.00% 05 13,342 13,342 1.00 84.65% 06 13,751 13,751 1.00 93.88% 07 14,092 14,092 1.00 96.93% 08 12,834 12,834 1.00 96.82% 09 12,857 12,857 1.00 96.81% 10 13,020 13,020 1.00 96.85% 11 13,673 13,673 1.00 96.90% 12 12,867 12,867 1.00 96.80% 13 13,899 13,899 1.00 96.86% 14 13,020 13,020 1.00 96.67% 15 16,339 16,339 1.00 97.12% 16 12,802 12,802 1.00 96.84% 17 12,343 12,343 1.00 89.62% 18 13,565 13,565 1.00 96.90% 19 12,848 12,848 1.00 96.79% 20 12,802 12,802 1.00 96.84% 21 13,534 13,534 1.00 96.98% 22 16,710 16,710 1.00 97.39% 23 12,466 12,466 1.00 66.76% Dec 01 00 6,322 6,322 1.00 94.33% 01 5,820 5,820 1.00 96.61% 02 5,820 5,820 1.00 97.00% 03 5,820 5,820 1.00 97.00% 04 5,820 5,820 1.00 97.00% 05 12,074 12,074 1.00 85.43% 06 14,457 14,457 1.00 93.70% 07 17,566 17,566 1.00 97.48% 08 17,464 17,464 1.00 97.30% 09 42,222 42,222 1.00 98.19% 10 29,142 29,142 1.00 98.17% 11 20,532 20,532 1.00 97.90% 12 20,649 20,649 1.00 97.81% 13 15,892 15,892 1.00 97.00% 14 19,069 19,069 1.00 97.26% 15 15,012 15,012 1.00 97.13% 16 17,785 17,785 1.00 97.24% 17 12,256 12,256 1.00 89.56% 18 36,348 36,348 1.00 97.64% 19 20,442 20,442 1.00 97.70% 20 23,446 23,446 1.00 97.97% 21 17,581 17,581 1.00 97.48% 22 14,968 14,968 1.00 97.19% 23 18,582 18,582 1.00 74.81% Dec 02 00 6,322 6,322 1.00 94.33% 01 5,820 5,820 1.00 96.61% 02 5,830 5,830 1.00 96.97% 03 5,866 5,866 1.00 96.89% 04 5,820 5,820 1.00 97.00% 05 12,840 12,840 1.00 84.56% 06 14,466 14,466 1.00 93.67% 07 18,896 18,896 1.00 97.59% 08 26,982 26,982 1.00 98.05% 09 33,272 33,272 1.00 98.36% 10 21,979 21,979 1.00 97.68% 11 20,967 20,967 1.00 97.87% 12 20,997 20,997 1.00 97.67% 13 23,560 23,560 1.00 98.03% 14 18,453 18,453 1.00 97.52% 15 15,810 15,810 1.00 97.09% 16 15,068 15,068 1.00 97.00% 17 15,201 15,201 1.00 91.12% 18 13,838 13,838 1.00 96.80% 19 12,735 12,735 1.00 96.82% 20 12,735 12,735 1.00 96.82% 21 13,615 13,615 1.00 96.86% 22 12,735 12,735 1.00 96.82% 23 13,750 13,750 1.00 68.85% Dec 03 00 6,322 6,322 1.00 94.33% 01 5,820 5,820 1.00 96.61% 02 6,628 6,628 1.00 97.16% 03 5,820 5,820 1.00 97.00% 04 5,820 5,820 1.00 97.00% 05 13,021 13,021 1.00 90.52% 06 14,981 14,981 1.00 94.13% 07 21,668 21,668 1.00 97.24% 08 35,475 35,475 1.00 98.48% 09 32,967 32,967 1.00 97.47% 10 20,825 20,825 1.00 96.91% 11 26,896 26,896 1.00 97.96% 12 23,411 23,411 1.00 97.67% 13 18,073 18,073 1.00 97.07% 14 16,823 16,823 1.00 96.91% 15 18,289 18,289 1.00 97.36% 16 15,887 15,887 1.00 97.12% 17 14,092 14,092 1.00 90.66% 18 13,227 13,380 1.01 94.31% 19 14,789 14,789 1.00 97.13% 20 14,411 14,411 1.00 96.98% 21 12,765 12,765 1.00 96.83% 22 16,664 16,664 1.00 97.33% 23 15,798 15,798 1.00 71.60% Dec 04 00 6,322 6,322 1.00 94.33% 01 5,820 5,820 1.00 96.61% 02 5,820 5,820 1.00 97.00% 03 5,820 5,820 1.00 97.00% 04 5,820 5,820 1.00 97.00% 05 13,422 13,422 1.00 84.85% 06 14,408 14,408 1.00 93.49% 07 16,271 16,271 1.00 97.47% 08 22,597 22,597 1.00 97.19% 09 32,169 32,169 1.00 98.31% 10 19,340 19,340 1.00 97.23% 11 16,473 16,473 1.00 97.16% 12 17,584 17,584 1.00 97.25% 13 20,619 20,619 1.00 97.60% 14 18,698 18,698 1.00 97.37% 15 16,409 16,409 1.00 97.27% 16 20,267 20,267 1.00 97.56% 17 12,785 12,785 1.00 89.88% 18 13,180 13,180 1.00 96.82% 19 12,853 12,853 1.00 96.85% 20 12,853 12,853 1.00 96.85% 21 13,974 13,974 1.00 97.00% 22 12,853 12,853 1.00 96.85% 23 14,662 14,662 1.00 70.13% Dec 05 00 6,642 6,642 1.00 94.51% 01 5,820 5,820 1.00 96.61% 02 5,820 5,820 1.00 97.00% 03 5,820 5,820 1.00 97.00% 04 5,820 5,820 1.00 97.00% 05 13,700 13,700 1.00 85.32% 06 15,165 15,165 1.00 93.90% 07 19,296 19,296 1.00 97.59% 08 19,502 19,502 1.00 97.76% 09 22,384 22,384 1.00 97.99% 10 18,983 18,983 1.00 97.04% 11 19,938 19,938 1.00 97.47% 12 17,330 17,330 1.00 97.25% 13 22,566 22,566 1.00 98.01% 14 15,941 15,941 1.00 97.36% 15 12,994 12,994 1.00 96.78% 16 12,763 12,763 1.00 96.83% 17 12,638 12,638 1.00 89.75% 18 13,569 13,569 1.00 96.78% 19 14,892 14,892 1.00 97.06% 20 13,518 13,518 1.00 96.92% 21 12,758 12,758 1.00 96.83% 22 12,758 12,758 1.00 96.83% 23 13,591 13,591 1.00 68.58% Dec 06 00 6,740 6,740 1.00 94.58% 01 5,820 5,820 1.00 96.61% 02 5,820 5,820 1.00 97.00% 03 5,820 5,820 1.00 97.00% 04 5,820 5,820 1.00 97.00% 05 13,420 13,420 1.00 84.75% 06 14,256 14,256 1.00 93.23% 07 12,835 12,835 1.00 96.85% 08 13,385 13,385 1.00 96.82% 09 13,639 13,639 1.00 96.94% 10 12,912 12,912 1.00 96.82% 11 13,577 13,577 1.00 96.97% 12 14,011 14,011 1.00 96.98% 13 14,893 14,893 1.00 97.18% 14 13,642 13,642 1.00 96.89% 15 12,825 12,825 1.00 96.84% 16 12,825 12,825 1.00 96.84% 17 14,987 14,987 1.00 91.18% 18 17,052 17,052 1.00 97.31% 19 13,245 13,245 1.00 96.83% 20 13,820 13,820 1.00 96.94% 21 13,463 13,463 1.00 96.89% 22 13,213 13,213 1.00 96.83% 23 14,430 14,430 1.00 69.78% Day Hour Count Average / Second Nov 30 00 605 0.17/s 01 602 0.17/s 02 600 0.17/s 03 600 0.17/s 04 600 0.17/s 05 646 0.18/s 06 601 0.17/s 07 613 0.17/s 08 602 0.17/s 09 601 0.17/s 10 604 0.17/s 11 609 0.17/s 12 602 0.17/s 13 614 0.17/s 14 607 0.17/s 15 634 0.18/s 16 600 0.17/s 17 644 0.18/s 18 612 0.17/s 19 601 0.17/s 20 600 0.17/s 21 604 0.17/s 22 618 0.17/s 23 592 0.16/s Dec 01 00 601 0.17/s 01 602 0.17/s 02 600 0.17/s 03 600 0.17/s 04 600 0.17/s 05 644 0.18/s 06 603 0.17/s 07 662 0.18/s 08 649 0.18/s 09 993 0.28/s 10 784 0.22/s 11 676 0.19/s 12 687 0.19/s 13 687 0.19/s 14 720 0.20/s 15 622 0.17/s 16 654 0.18/s 17 644 0.18/s 18 819 0.23/s 19 670 0.19/s 20 690 0.19/s 21 642 0.18/s 22 616 0.17/s 23 663 0.18/s Dec 02 00 601 0.17/s 01 602 0.17/s 02 601 0.17/s 03 601 0.17/s 04 600 0.17/s 05 643 0.18/s 06 606 0.17/s 07 661 0.18/s 08 723 0.20/s 09 788 0.22/s 10 723 0.20/s 11 681 0.19/s 12 689 0.19/s 13 719 0.20/s 14 663 0.18/s 15 646 0.18/s 16 635 0.18/s 17 674 0.19/s 18 609 0.17/s 19 600 0.17/s 20 600 0.17/s 21 611 0.17/s 22 600 0.17/s 23 620 0.17/s Dec 03 00 601 0.17/s 01 602 0.17/s 02 608 0.17/s 03 600 0.17/s 04 600 0.17/s 05 618 0.17/s 06 616 0.17/s 07 708 0.20/s 08 866 0.24/s 09 970 0.27/s 10 727 0.20/s 11 765 0.21/s 12 752 0.21/s 13 671 0.19/s 14 660 0.18/s 15 681 0.19/s 16 641 0.18/s 17 661 0.18/s 18 606 0.17/s 19 619 0.17/s 20 618 0.17/s 21 600 0.17/s 22 624 0.17/s 23 651 0.18/s Dec 04 00 601 0.17/s 01 602 0.17/s 02 600 0.17/s 03 600 0.17/s 04 600 0.17/s 05 646 0.18/s 06 610 0.17/s 07 644 0.18/s 08 794 0.22/s 09 819 0.23/s 10 664 0.18/s 11 654 0.18/s 12 659 0.18/s 13 712 0.20/s 14 668 0.19/s 15 659 0.18/s 16 692 0.19/s 17 647 0.18/s 18 605 0.17/s 19 600 0.17/s 20 600 0.17/s 21 609 0.17/s 22 600 0.17/s 23 635 0.18/s Dec 05 00 605 0.17/s 01 602 0.17/s 02 600 0.17/s 03 600 0.17/s 04 600 0.17/s 05 653 0.18/s 06 614 0.17/s 07 680 0.19/s 08 676 0.19/s 09 714 0.20/s 10 675 0.19/s 11 693 0.19/s 12 654 0.18/s 13 713 0.20/s 14 642 0.18/s 15 610 0.17/s 16 600 0.17/s 17 649 0.18/s 18 614 0.17/s 19 620 0.17/s 20 608 0.17/s 21 600 0.17/s 22 600 0.17/s 23 622 0.17/s Dec 06 00 605 0.17/s 01 602 0.17/s 02 600 0.17/s 03 600 0.17/s 04 600 0.17/s 05 646 0.18/s 06 600 0.17/s 07 600 0.17/s 08 611 0.17/s 09 608 0.17/s 10 602 0.17/s 11 607 0.17/s 12 617 0.17/s 13 620 0.17/s 14 610 0.17/s 15 600 0.17/s 16 600 0.17/s 17 669 0.19/s 18 634 0.18/s 19 607 0.17/s 20 609 0.17/s 21 606 0.17/s 22 606 0.17/s 23 632 0.18/s Day Hour Count Average Duration Average idle time Nov 30 00 605 23ms 20ms 01 602 18ms 17ms 02 600 18ms 18ms 03 600 18ms 17ms 04 600 19ms 18ms 05 646 1s542ms 831ms 06 601 98ms 72ms 07 613 56ms 31ms 08 602 52ms 26ms 09 601 52ms 26ms 10 604 54ms 29ms 11 609 57ms 31ms 12 602 53ms 27ms 13 614 58ms 33ms 14 607 52ms 28ms 15 634 64ms 39ms 16 600 52ms 26ms 17 644 2s20ms 982ms 18 612 61ms 36ms 19 601 51ms 26ms 20 600 52ms 27ms 21 604 55ms 29ms 22 618 57ms 33ms 23 592 66ms 33ms Dec 01 00 601 21ms 18ms 01 602 18ms 18ms 02 600 18ms 18ms 03 600 18ms 18ms 04 600 18ms 17ms 05 644 2s170ms 1s86ms 06 603 95ms 68ms 07 662 79ms 52ms 08 649 80ms 53ms 09 993 109ms 85ms 10 784 104ms 77ms 11 676 87ms 59ms 12 687 85ms 57ms 13 687 63ms 38ms 14 720 77ms 53ms 15 622 62ms 35ms 16 654 71ms 46ms 17 644 2s32ms 992ms 18 819 137ms 106ms 19 670 79ms 53ms 20 690 79ms 51ms 21 642 69ms 43ms 22 616 59ms 34ms 23 663 72ms 44ms Dec 02 00 601 20ms 18ms 01 602 18ms 17ms 02 601 18ms 18ms 03 601 18ms 18ms 04 600 18ms 17ms 05 643 2s145ms 1s100ms 06 606 109ms 81ms 07 661 82ms 54ms 08 723 104ms 75ms 09 788 121ms 97ms 10 723 90ms 63ms 11 681 81ms 55ms 12 689 79ms 54ms 13 719 91ms 63ms 14 663 72ms 46ms 15 646 68ms 44ms 16 635 63ms 37ms 17 674 1s359ms 677ms 18 609 56ms 32ms 19 600 51ms 26ms 20 600 52ms 27ms 21 611 56ms 31ms 22 600 52ms 27ms 23 620 66ms 37ms Dec 03 00 601 20ms 19ms 01 602 19ms 18ms 02 608 23ms 22ms 03 600 18ms 18ms 04 600 18ms 17ms 05 618 227ms 189ms 06 616 107ms 80ms 07 708 90ms 64ms 08 866 122ms 94ms 09 970 97ms 71ms 10 727 93ms 68ms 11 765 95ms 67ms 12 752 82ms 57ms 13 671 74ms 48ms 14 660 77ms 51ms 15 681 74ms 50ms 16 641 67ms 43ms 17 661 1s956ms 948ms 18 606 229ms 34ms 19 619 59ms 33ms 20 618 57ms 32ms 21 600 51ms 26ms 22 624 61ms 36ms 23 651 74ms 47ms Dec 04 00 601 20ms 18ms 01 602 18ms 17ms 02 600 18ms 18ms 03 600 18ms 18ms 04 600 19ms 18ms 05 646 1s510ms 807ms 06 610 109ms 82ms 07 644 68ms 42ms 08 794 84ms 59ms 09 819 112ms 83ms 10 664 89ms 62ms 11 654 70ms 45ms 12 659 71ms 44ms 13 712 73ms 48ms 14 668 73ms 47ms 15 659 68ms 43ms 16 692 71ms 45ms 17 647 1s393ms 695ms 18 605 54ms 29ms 19 600 52ms 26ms 20 600 51ms 26ms 21 609 58ms 30ms 22 600 51ms 26ms 23 635 67ms 38ms Dec 05 00 605 21ms 19ms 01 602 18ms 17ms 02 600 17ms 17ms 03 600 17ms 17ms 04 600 18ms 17ms 05 653 2s143ms 1s111ms 06 614 107ms 81ms 07 680 91ms 62ms 08 676 84ms 57ms 09 714 99ms 71ms 10 675 87ms 58ms 11 693 94ms 67ms 12 654 72ms 46ms 13 713 99ms 71ms 14 642 69ms 42ms 15 610 52ms 28ms 16 600 51ms 25ms 17 649 2s18ms 983ms 18 614 54ms 29ms 19 620 56ms 31ms 20 608 54ms 29ms 21 600 51ms 26ms 22 600 53ms 26ms 23 622 63ms 36ms Dec 06 00 605 21ms 19ms 01 602 18ms 17ms 02 600 18ms 17ms 03 600 18ms 17ms 04 600 18ms 18ms 05 646 1s528ms 807ms 06 600 106ms 79ms 07 600 51ms 25ms 08 611 55ms 29ms 09 608 54ms 29ms 10 602 53ms 28ms 11 607 55ms 31ms 12 617 59ms 32ms 13 620 55ms 31ms 14 610 54ms 29ms 15 600 53ms 25ms 16 600 53ms 26ms 17 669 1s980ms 965ms 18 634 57ms 34ms 19 607 55ms 31ms 20 609 54ms 30ms 21 606 55ms 29ms 22 606 55ms 29ms 23 632 65ms 38ms -
Connections
Established Connections
Key values
- 15 connections Connection Peak
- 2025-12-01 17:02:04 Date
Connections per database
Key values
- celspac Main Database
- 107,755 connections Total
Connections per user
Key values
- tng_migration_user Main User
- 107,755 connections Total
-
Sessions
Simultaneous sessions
Key values
- 3 sessions Session Peak
- 2025-12-04 21:53:22 Date
Histogram of session times
Key values
- 104,972 0-500ms duration
Sessions per database
Key values
- celspac Main Database
- 107,755 sessions Total
Sessions per user
Key values
- tng_migration_user Main User
- 107,755 sessions Total
Sessions per host
Key values
- 127.0.0.1 Main Host
- 107,755 sessions Total
-
Checkpoints / Restartpoints
Checkpoints Buffers
Key values
- 9,653 buffers Checkpoint Peak
- 2025-12-03 17:09:33 Date
- 269.950 seconds Highest write time
- 0.746 seconds Sync time
Checkpoints Wal files
Key values
- 17 files Wal files usage Peak
- 2025-12-02 17:09:13 Date
Checkpoints distance
Key values
- 461.90 Mo Distance Peak
- 2025-12-06 05:07:51 Date
Checkpoints Activity
↑ Back to the top of the Checkpoint Activity tableDay Hour Written buffers Write time Sync time Total time Nov 30 00 2,435 243.35s 0.024s 243.404s 01 0 0s 0s 0s 02 0 0s 0s 0s 03 0 0s 0s 0s 04 0 0s 0s 0s 05 19,308 1,914.332s 0.097s 1,914.558s 06 20,316 2,384.277s 0.115s 2,384.574s 07 20,339 2,365.978s 0.107s 2,366.234s 08 20,295 2,358.169s 0.107s 2,358.414s 09 20,125 2,367.241s 0.108s 2,367.472s 10 20,174 2,371.032s 0.122s 2,372.283s 11 20,045 2,357.156s 0.115s 2,357.455s 12 20,286 2,380.273s 0.132s 2,380.604s 13 20,067 2,359.204s 0.124s 2,359.491s 14 20,136 2,391.165s 0.134s 2,391.471s 15 19,872 2,354.142s 0.125s 2,354.444s 16 20,368 2,407.783s 0.129s 2,408.093s 17 27,081 2,240.153s 0.166s 2,240.502s 18 20,444 2,405.97s 0.138s 2,406.268s 19 18,158 2,183.88s 0.111s 2,184.122s 20 20,386 2,411.518s 0.126s 2,411.777s 21 20,319 2,431.464s 0.158s 2,431.767s 22 18,060 2,186.763s 0.126s 2,187.211s 23 18,294 2,214.308s 0.139s 2,214.6s Dec 01 00 100 9.935s 0.006s 9.949s 01 0 0s 0s 0s 02 0 0s 0s 0s 03 0 0s 0s 0s 04 0 0s 0s 0s 05 18,720 1,649.721s 0.089s 1,649.916s 06 16,976 2,128.642s 0.094s 2,128.87s 07 17,603 2,169.003s 0.139s 2,169.29s 08 17,112 2,140.736s 0.117s 2,141.001s 09 18,835 2,346.866s 0.233s 2,347.341s 10 16,976 2,131.549s 0.122s 2,131.803s 11 19,404 2,391.993s 0.143s 2,392.279s 12 16,444 2,076.488s 0.137s 2,076.764s 13 18,925 2,360.449s 0.133s 2,360.75s 14 16,711 2,116.171s 0.119s 2,116.42s 15 16,836 2,140.43s 0.181s 2,140.766s 16 16,774 2,137.512s 0.555s 2,138.227s 17 24,971 1,964.946s 0.106s 1,965.198s 18 16,514 2,150.631s 0.116s 2,150.898s 19 16,670 2,115.446s 0.145s 2,115.721s 20 16,691 2,132.611s 0.132s 2,132.918s 21 16,746 2,134.418s 0.169s 2,134.751s 22 18,284 2,317.806s 0.124s 2,318.078s 23 16,767 2,169.055s 0.11s 2,169.286s Dec 02 00 370 36.623s 0.035s 36.68s 01 0 0s 0s 0s 02 12 1.104s 0.026s 1.139s 03 27 2.655s 0.012s 2.676s 04 0 0s 0s 0s 05 19,866 1,646.379s 0.084s 1,646.57s 06 16,163 2,124.131s 0.113s 2,124.375s 07 16,407 2,124.582s 0.134s 2,124.842s 08 16,314 2,169.733s 0.15s 2,170.023s 09 18,392 2,370.301s 0.164s 2,370.603s 10 18,296 2,385.028s 0.218s 2,385.38s 11 16,129 2,135.66s 0.135s 2,135.916s 12 16,077 2,140.506s 0.133s 2,140.793s 13 16,029 2,121.177s 0.132s 2,121.455s 14 16,062 2,176.408s 0.138s 2,176.686s 15 16,450 2,159.252s 0.118s 2,159.507s 16 18,031 2,365.463s 0.112s 2,365.717s 17 18,875 1,962.375s 0.16s 1,962.664s 18 15,950 2,137.84s 0.098s 2,138.111s 19 15,825 2,119.965s 0.092s 2,120.193s 20 15,780 2,120.874s 0.104s 2,121.127s 21 15,865 2,148.427s 0.092s 2,148.649s 22 15,861 2,141.138s 0.099s 2,141.356s 23 15,736 2,138.616s 0.099s 2,138.831s Dec 03 00 160 15.571s 0.015s 15.603s 01 0 0s 0s 0s 02 47 4.586s 0.015s 4.631s 03 0 0s 0s 0s 04 0 0s 0s 0s 05 12,532 1,423.08s 0.06s 1,423.229s 06 15,327 2,150.17s 0.091s 2,150.405s 07 17,318 2,385.487s 0.419s 2,386.064s 08 15,455 2,134.355s 0.147s 2,134.64s 09 15,419 2,165.626s 0.156s 2,165.93s 10 15,303 2,148.77s 0.171s 2,149.089s 11 15,331 2,154.754s 0.148s 2,155.037s 12 15,155 2,130.986s 0.234s 2,131.342s 13 18,246 2,406.096s 0.145s 2,406.395s 14 19,418 2,424.966s 0.132s 2,425.244s 15 20,780 2,419.785s 0.142s 2,420.066s 16 20,860 2,414.978s 0.124s 2,415.247s 17 26,037 2,201.129s 0.132s 2,201.487s 18 19,665 2,410.525s 0.142s 2,410.88s 19 20,670 2,404.131s 0.138s 2,404.398s 20 18,367 2,183.733s 0.126s 2,185.563s 21 18,071 2,157.025s 0.114s 2,157.314s 22 20,197 2,366.373s 0.106s 2,366.626s 23 20,176 2,368.866s 0.146s 2,369.164s Dec 04 00 127 12.362s 0.018s 12.396s 01 0 0s 0s 0s 02 0 0s 0s 0s 03 0 0s 0s 0s 04 0 0s 0s 0s 05 17,846 1,896.645s 0.125s 1,896.958s 06 14,618 1,598.744s 0.146s 1,599.046s 07 15,734 2,111.128s 0.103s 2,111.366s 08 15,751 2,117.366s 0.142s 2,117.637s 09 17,754 2,366.883s 0.129s 2,367.211s 10 15,802 2,130.708s 0.136s 2,131.004s 11 17,653 2,365.241s 0.122s 2,365.517s 12 15,635 2,123.472s 0.112s 2,123.745s 13 17,499 2,355.034s 0.127s 2,355.303s 14 17,424 2,365.232s 0.12s 2,365.512s 15 17,294 2,344.576s 0.118s 2,344.831s 16 15,609 2,128.783s 0.745s 2,129.7s 17 18,982 2,397.902s 0.116s 2,398.153s 18 17,273 2,349.707s 0.105s 2,349.968s 19 15,354 2,112.626s 0.093s 2,112.83s 20 15,420 2,132.148s 0.135s 2,132.471s 21 15,933 2,127.894s 0.123s 2,128.183s 22 15,305 2,114.76s 0.116s 2,115.179s 23 15,328 2,126.16s 0.116s 2,126.411s Dec 05 00 2,502 249.774s 0.029s 249.821s 01 0 0s 0s 0s 02 0 0s 0s 0s 03 0 0s 0s 0s 04 0 0s 0s 0s 05 21,078 1,731.059s 0.105s 1,731.297s 06 20,940 2,450.716s 0.149s 2,451.033s 07 20,836 2,444.314s 0.158s 2,444.659s 08 20,042 2,431.524s 0.135s 2,432.417s 09 20,461 2,440.064s 0.157s 2,440.416s 10 18,658 2,218.394s 0.203s 2,218.831s 11 18,374 2,202.075s 0.128s 2,202.366s 12 15,979 1,973.16s 0.123s 1,973.424s 13 15,756 1,968.828s 0.115s 1,969.073s 14 15,626 1,940.141s 0.099s 1,940.402s 15 15,653 1,929.239s 0.844s 1,930.205s 16 18,012 2,167.298s 0.125s 2,167.57s 17 25,169 1,996.6s 0.117s 1,996.856s 18 15,761 1,945.21s 0.108s 1,945.46s 19 17,953 2,172.668s 0.116s 2,172.921s 20 17,852 2,173.514s 0.118s 2,173.761s 21 15,334 1,909.139s 0.104s 1,909.385s 22 15,181 1,893.077s 0.1s 1,893.308s 23 15,386 1,915.655s 0.096s 1,915.875s Dec 06 00 2,458 245.412s 0.02s 245.453s 01 0 0s 0s 0s 02 0 0s 0s 0s 03 0 0s 0s 0s 04 0 0s 0s 0s 05 18,092 1,836.102s 0.09s 1,836.303s 06 15,038 1,917.03s 0.099s 1,917.266s 07 14,944 1,894.981s 0.091s 1,895.196s 08 14,973 1,908.683s 0.095s 1,908.895s 09 14,932 1,904.393s 0.097s 1,904.594s 10 14,900 1,905.854s 0.087s 1,906.057s 11 14,817 1,894.21s 0.094s 1,894.411s 12 14,802 1,895.758s 0.086s 1,895.955s 13 14,759 1,898.428s 0.09s 1,898.62s 14 14,751 1,914.818s 0.1s 1,915.044s 15 14,738 1,897.823s 0.172s 1,898.252s 16 14,819 1,908.715s 0.091s 1,909.147s 17 23,768 1,968.121s 0.221s 1,968.55s 18 14,661 1,901.015s 0.102s 1,901.234s 19 16,586 2,123.734s 0.096s 2,123.96s 20 16,591 2,125.249s 0.106s 2,125.477s 21 14,731 1,921.671s 0.102s 1,921.901s 22 14,588 1,906.094s 0.113s 1,906.347s 23 14,572 1,913.555s 0.114s 1,913.803s Day Hour Added Removed Recycled Synced files Longest sync Average sync Nov 30 00 0 0 0 122 0.004s 0.002s 01 0 0 0 0 0s 0s 02 0 0 0 0 0s 0s 03 0 0 0 0 0s 0s 04 0 0 0 0 0s 0s 05 0 0 34 742 0.003s 0.008s 06 0 8 13 790 0.008s 0.012s 07 0 3 18 730 0.005s 0.012s 08 0 1 20 725 0.005s 0.012s 09 0 0 21 726 0.004s 0.012s 10 0 0 20 728 0.005s 0.012s 11 0 1 20 737 0.004s 0.012s 12 0 0 21 744 0.008s 0.012s 13 0 0 21 742 0.006s 0.012s 14 0 0 21 774 0.008s 0.012s 15 0 1 20 726 0.007s 0.011s 16 0 0 21 694 0.012s 0.012s 17 0 0 32 862 0.028s 0.013s 18 0 6 14 722 0.008s 0.012s 19 0 2 19 693 0.006s 0.011s 20 0 0 21 686 0.005s 0.012s 21 0 0 21 726 0.012s 0.012s 22 0 0 21 715 0.010s 0.011s 23 0 0 21 709 0.009s 0.012s Dec 01 00 0 0 0 24 0.003s 0.001s 01 0 0 0 0 0s 0s 02 0 0 0 0 0s 0s 03 0 0 0 0 0s 0s 04 0 0 0 0 0s 0s 05 0 0 31 660 0.007s 0.007s 06 0 5 16 678 0.004s 0.01s 07 0 4 17 748 0.010s 0.012s 08 0 0 21 825 0.007s 0.011s 09 0 0 21 849 0.051s 0.011s 10 0 1 20 810 0.008s 0.011s 11 0 0 21 807 0.006s 0.013s 12 0 0 21 671 0.007s 0.01s 13 0 1 20 763 0.005s 0.012s 14 0 0 21 758 0.010s 0.011s 15 0 0 21 727 0.044s 0.012s 16 0 0 21 764 0.429s 0.018s 17 0 0 31 814 0.003s 0.01s 18 0 7 14 787 0.009s 0.011s 19 0 2 19 738 0.016s 0.011s 20 0 0 21 776 0.011s 0.011s 21 0 0 21 730 0.025s 0.011s 22 0 0 21 732 0.006s 0.012s 23 0 0 21 731 0.007s 0.011s Dec 02 00 0 0 0 64 0.014s 0.002s 01 0 0 0 0 0s 0s 02 0 0 0 12 0.021s 0.003s 03 0 0 0 27 0.007s 0.001s 04 0 0 0 0 0s 0s 05 0 0 32 677 0.005s 0.007s 06 0 5 16 675 0.007s 0.01s 07 0 4 16 788 0.005s 0.011s 08 0 0 21 921 0.008s 0.011s 09 0 0 21 871 0.006s 0.012s 10 0 0 21 860 0.099s 0.014s 11 0 0 21 728 0.010s 0.011s 12 0 0 21 772 0.011s 0.011s 13 0 1 20 732 0.009s 0.011s 14 0 0 21 770 0.013s 0.011s 15 0 0 21 793 0.005s 0.012s 16 0 0 21 783 0.005s 0.012s 17 0 0 33 901 0.008s 0.01s 18 0 10 11 704 0.003s 0.011s 19 0 2 19 654 0.003s 0.011s 20 0 1 20 652 0.005s 0.012s 21 0 0 21 668 0.004s 0.01s 22 0 0 20 659 0.003s 0.011s 23 0 0 21 681 0.004s 0.011s Dec 03 00 0 0 0 57 0.004s 0.002s 01 0 0 0 0 0s 0s 02 0 0 0 47 0.005s 0.002s 03 0 0 0 0 0s 0s 04 0 0 0 0 0s 0s 05 0 0 30 506 0.002s 0.006s 06 0 5 16 673 0.006s 0.01s 07 0 4 17 1,018 0.081s 0.015s 08 0 1 20 816 0.006s 0.011s 09 0 0 22 959 0.007s 0.011s 10 0 0 21 961 0.014s 0.011s 11 0 0 21 857 0.008s 0.011s 12 0 0 20 738 0.121s 0.012s 13 0 0 21 900 0.008s 0.012s 14 0 0 21 865 0.006s 0.012s 15 0 0 21 856 0.012s 0.012s 16 0 0 21 819 0.006s 0.012s 17 1 10 22 949 0.007s 0.011s 18 0 1 20 774 0.007s 0.012s 19 0 0 21 695 0.007s 0.012s 20 0 0 21 708 0.010s 0.011s 21 0 0 21 681 0.007s 0.011s 22 0 1 20 806 0.004s 0.012s 23 0 0 21 837 0.007s 0.012s Dec 04 00 0 0 0 55 0.006s 0.001s 01 0 0 0 0 0s 0s 02 0 0 0 0 0s 0s 03 0 0 0 0 0s 0s 04 0 0 0 0 0s 0s 05 0 10 23 791 0.012s 0.008s 06 0 2 19 701 0.016s 0.011s 07 0 1 20 623 0.005s 0.011s 08 0 0 21 736 0.036s 0.011s 09 0 0 21 868 0.010s 0.012s 10 0 0 21 847 0.007s 0.011s 11 0 0 21 844 0.007s 0.013s 12 0 0 21 723 0.005s 0.011s 13 0 1 20 807 0.006s 0.012s 14 0 0 21 823 0.006s 0.012s 15 0 0 21 748 0.006s 0.012s 16 0 0 21 762 0.581s 0.018s 17 0 1 33 874 0.003s 0.011s 18 0 7 14 712 0.006s 0.012s 19 0 0 20 654 0.004s 0.011s 20 0 0 21 644 0.019s 0.011s 21 0 0 21 680 0.009s 0.011s 22 0 0 21 646 0.011s 0.011s 23 0 0 21 674 0.005s 0.011s Dec 05 00 0 0 0 131 0.005s 0.002s 01 0 0 0 0 0s 0s 02 0 0 0 0 0s 0s 03 0 0 0 0 0s 0s 04 0 0 0 0 0s 0s 05 0 0 32 747 0.005s 0.009s 06 0 8 12 836 0.007s 0.012s 07 0 1 20 893 0.006s 0.012s 08 0 1 20 796 0.005s 0.012s 09 0 0 21 826 0.022s 0.012s 10 0 0 21 927 0.015s 0.011s 11 0 0 21 782 0.005s 0.011s 12 0 0 21 713 0.013s 0.01s 13 0 0 21 690 0.007s 0.01s 14 0 0 19 673 0.005s 0.01s 15 0 0 22 664 0.736s 0.021s 16 0 0 21 683 0.009s 0.011s 17 0 0 32 842 0.008s 0.01s 18 0 5 16 723 0.005s 0.01s 19 0 2 19 742 0.006s 0.011s 20 0 0 21 704 0.008s 0.011s 21 0 0 19 629 0.006s 0.01s 22 0 0 21 636 0.005s 0.01s 23 0 0 21 655 0.004s 0.01s Dec 06 00 0 0 2 130 0.002s 0.002s 01 0 0 0 0 0s 0s 02 0 0 0 0 0s 0s 03 0 0 0 0 0s 0s 04 0 0 0 0 0s 0s 05 0 0 31 684 0.004s 0.008s 06 0 5 16 673 0.003s 0.01s 07 0 4 17 630 0.005s 0.01s 08 0 0 21 650 0.008s 0.01s 09 0 0 21 657 0.005s 0.01s 10 0 1 20 654 0.005s 0.01s 11 0 0 21 650 0.004s 0.01s 12 0 0 21 672 0.002s 0.01s 13 0 0 20 631 0.003s 0.01s 14 0 0 21 685 0.006s 0.01s 15 0 0 21 629 0.024s 0.01s 16 0 0 21 628 0.008s 0.01s 17 1 10 22 851 0.022s 0.012s 18 0 0 21 708 0.004s 0.01s 19 0 2 19 700 0.004s 0.011s 20 0 0 21 715 0.005s 0.011s 21 0 0 21 654 0.007s 0.01s 22 0 0 22 692 0.005s 0.01s 23 0 0 21 739 0.005s 0.01s Day Hour Count Avg time (sec) Nov 30 00 0 0s 01 0 0s 02 0 0s 03 0 0s 04 0 0s 05 0 0s 06 0 0s 07 0 0s 08 0 0s 09 0 0s 10 0 0s 11 0 0s 12 0 0s 13 0 0s 14 0 0s 15 0 0s 16 0 0s 17 0 0s 18 0 0s 19 0 0s 20 0 0s 21 0 0s 22 0 0s 23 0 0s Dec 01 00 0 0s 01 0 0s 02 0 0s 03 0 0s 04 0 0s 05 0 0s 06 0 0s 07 0 0s 08 0 0s 09 0 0s 10 0 0s 11 0 0s 12 0 0s 13 0 0s 14 0 0s 15 0 0s 16 0 0s 17 0 0s 18 0 0s 19 0 0s 20 0 0s 21 0 0s 22 0 0s 23 0 0s Dec 02 00 0 0s 01 0 0s 02 0 0s 03 0 0s 04 0 0s 05 0 0s 06 0 0s 07 0 0s 08 0 0s 09 0 0s 10 0 0s 11 0 0s 12 0 0s 13 0 0s 14 0 0s 15 0 0s 16 0 0s 17 0 0s 18 0 0s 19 0 0s 20 0 0s 21 0 0s 22 0 0s 23 0 0s Dec 03 00 0 0s 01 0 0s 02 0 0s 03 0 0s 04 0 0s 05 0 0s 06 0 0s 07 0 0s 08 0 0s 09 0 0s 10 0 0s 11 0 0s 12 0 0s 13 0 0s 14 0 0s 15 0 0s 16 0 0s 17 0 0s 18 0 0s 19 0 0s 20 0 0s 21 0 0s 22 0 0s 23 0 0s Dec 04 00 0 0s 01 0 0s 02 0 0s 03 0 0s 04 0 0s 05 0 0s 06 0 0s 07 0 0s 08 0 0s 09 0 0s 10 0 0s 11 0 0s 12 0 0s 13 0 0s 14 0 0s 15 0 0s 16 0 0s 17 0 0s 18 0 0s 19 0 0s 20 0 0s 21 0 0s 22 0 0s 23 0 0s Dec 05 00 0 0s 01 0 0s 02 0 0s 03 0 0s 04 0 0s 05 0 0s 06 0 0s 07 0 0s 08 0 0s 09 0 0s 10 0 0s 11 0 0s 12 0 0s 13 0 0s 14 0 0s 15 0 0s 16 0 0s 17 0 0s 18 0 0s 19 0 0s 20 0 0s 21 0 0s 22 0 0s 23 0 0s Dec 06 00 0 0s 01 0 0s 02 0 0s 03 0 0s 04 0 0s 05 0 0s 06 0 0s 07 0 0s 08 0 0s 09 0 0s 10 0 0s 11 0 0s 12 0 0s 13 0 0s 14 0 0s 15 0 0s 16 0 0s 17 0 0s 18 0 0s 19 0 0s 20 0 0s 21 0 0s 22 0 0s 23 0 0s Day Hour Mean distance Mean estimate Nov 30 00 17,357.00 kB 52,814.00 kB 01 0.00 kB 0.00 kB 02 0.00 kB 0.00 kB 03 0.00 kB 0.00 kB 04 0.00 kB 0.00 kB 05 69,019.12 kB 181,974.88 kB 06 28,567.58 kB 87,267.25 kB 07 28,429.42 kB 45,074.58 kB 08 28,426.00 kB 34,147.17 kB 09 28,439.17 kB 33,641.50 kB 10 28,470.50 kB 33,668.75 kB 11 28,452.67 kB 33,659.00 kB 12 28,484.75 kB 33,647.83 kB 13 28,479.33 kB 33,667.17 kB 14 28,552.33 kB 33,823.92 kB 15 31,076.55 kB 34,011.73 kB 16 28,499.75 kB 33,748.67 kB 17 43,494.00 kB 143,480.33 kB 18 28,503.00 kB 66,136.42 kB 19 31,095.55 kB 45,018.64 kB 20 28,508.08 kB 47,118.08 kB 21 28,507.17 kB 34,647.33 kB 22 31,062.18 kB 39,479.73 kB 23 28,548.50 kB 52,969.25 kB Dec 01 00 358.00 kB 52,348.00 kB 01 0.00 kB 0.00 kB 02 0.00 kB 0.00 kB 03 0.00 kB 0.00 kB 04 0.00 kB 0.00 kB 05 74,079.43 kB 185,732.57 kB 06 34,272.80 kB 98,417.60 kB 07 28,559.75 kB 57,129.58 kB 08 31,143.64 kB 52,429.91 kB 09 31,237.09 kB 46,221.82 kB 10 31,204.55 kB 40,620.00 kB 11 26,400.92 kB 46,384.77 kB 12 34,122.80 kB 40,979.70 kB 13 28,548.67 kB 47,258.67 kB 14 31,122.91 kB 40,525.27 kB 15 31,131.36 kB 52,504.64 kB 16 31,185.09 kB 52,496.82 kB 17 52,011.10 kB 156,521.60 kB 18 31,297.36 kB 80,385.91 kB 19 31,144.27 kB 52,585.73 kB 20 31,160.00 kB 52,552.55 kB 21 31,134.45 kB 52,511.64 kB 22 28,553.33 kB 47,233.17 kB 23 31,141.09 kB 40,530.45 kB Dec 02 00 614.00 kB 55,231.00 kB 01 0.00 kB 0.00 kB 02 43.00 kB 47,112.00 kB 03 137.00 kB 42,414.00 kB 04 0.00 kB 0.00 kB 05 74,231.43 kB 187,388.29 kB 06 34,175.10 kB 99,058.00 kB 07 31,035.27 kB 57,179.73 kB 08 31,175.18 kB 52,507.18 kB 09 28,524.17 kB 47,151.00 kB 10 28,602.08 kB 34,701.25 kB 11 31,041.09 kB 39,421.18 kB 12 31,093.91 kB 52,429.27 kB 13 31,062.82 kB 52,429.91 kB 14 31,254.91 kB 52,583.00 kB 15 28,586.08 kB 52,959.00 kB 16 28,565.33 kB 45,288.08 kB 17 55,378.90 kB 166,681.00 kB 18 31,014.91 kB 77,193.91 kB 19 30,997.55 kB 52,398.73 kB 20 30,988.00 kB 52,410.73 kB 21 34,097.10 kB 51,850.80 kB 22 31,021.64 kB 52,411.18 kB 23 31,064.73 kB 52,417.55 kB Dec 03 00 481.50 kB 55,187.50 kB 01 0.00 kB 0.00 kB 02 96.50 kB 44,724.00 kB 03 0.00 kB 0.00 kB 04 0.00 kB 0.00 kB 05 82,339.50 kB 162,578.17 kB 06 34,271.30 kB 94,216.80 kB 07 28,696.83 kB 50,833.58 kB 08 31,179.45 kB 41,354.00 kB 09 31,462.73 kB 52,938.55 kB 10 31,310.18 kB 53,267.91 kB 11 31,283.27 kB 52,719.82 kB 12 31,176.09 kB 52,644.00 kB 13 28,636.67 kB 47,337.42 kB 14 28,614.83 kB 34,635.08 kB 15 28,627.58 kB 33,712.17 kB 16 28,648.67 kB 33,790.33 kB 17 47,481.09 kB 129,028.45 kB 18 28,522.08 kB 64,154.33 kB 19 28,542.50 kB 38,595.17 kB 20 31,117.18 kB 48,743.64 kB 21 31,094.27 kB 52,453.45 kB 22 28,552.42 kB 39,508.42 kB 23 28,577.08 kB 33,884.67 kB Dec 04 00 859.00 kB 31,142.00 kB 01 0.00 kB 0.00 kB 02 0.00 kB 0.00 kB 03 0.00 kB 0.00 kB 04 0.00 kB 0.00 kB 05 69,236.50 kB 151,191.62 kB 06 28,126.91 kB 79,396.73 kB 07 31,091.27 kB 52,122.00 kB 08 31,128.55 kB 52,760.45 kB 09 28,675.92 kB 36,929.33 kB 10 31,207.91 kB 52,374.18 kB 11 28,590.08 kB 36,973.17 kB 12 31,134.82 kB 52,231.55 kB 13 28,555.42 kB 36,917.33 kB 14 28,650.25 kB 33,982.17 kB 15 28,559.42 kB 33,817.42 kB 16 34,325.70 kB 53,431.40 kB 17 50,571.82 kB 150,366.64 kB 18 28,426.25 kB 71,304.58 kB 19 30,973.18 kB 53,224.09 kB 20 30,998.18 kB 52,649.18 kB 21 31,030.73 kB 52,745.64 kB 22 31,011.91 kB 52,555.55 kB 23 31,035.82 kB 52,712.09 kB Dec 05 00 17,478.00 kB 39,782.00 kB 01 0.00 kB 0.00 kB 02 0.00 kB 0.00 kB 03 0.00 kB 0.00 kB 04 0.00 kB 0.00 kB 05 54,157.78 kB 169,519.56 kB 06 28,539.58 kB 77,681.67 kB 07 28,543.25 kB 42,390.17 kB 08 28,469.42 kB 33,664.25 kB 09 28,532.25 kB 33,761.42 kB 10 31,237.00 kB 42,111.73 kB 11 31,082.09 kB 54,762.09 kB 12 34,257.10 kB 57,537.60 kB 13 34,187.00 kB 59,917.70 kB 14 34,262.30 kB 59,960.00 kB 15 34,178.70 kB 59,966.60 kB 16 31,087.18 kB 54,720.00 kB 17 52,351.50 kB 155,818.50 kB 18 34,244.00 kB 83,849.80 kB 19 31,151.91 kB 55,424.00 kB 20 31,138.64 kB 45,762.55 kB 21 34,164.10 kB 60,006.90 kB 22 34,147.30 kB 59,923.30 kB 23 34,200.00 kB 59,993.60 kB Dec 06 00 17,425.00 kB 53,020.50 kB 01 0.00 kB 0.00 kB 02 0.00 kB 0.00 kB 03 0.00 kB 0.00 kB 04 0.00 kB 0.00 kB 05 65,085.38 kB 179,925.25 kB 06 34,297.10 kB 93,917.60 kB 07 34,163.70 kB 61,642.50 kB 08 34,202.50 kB 59,969.60 kB 09 34,175.90 kB 59,965.40 kB 10 34,180.80 kB 59,966.80 kB 11 34,158.30 kB 59,917.60 kB 12 34,181.50 kB 59,975.00 kB 13 34,172.10 kB 59,927.60 kB 14 34,233.80 kB 59,953.50 kB 15 34,181.30 kB 59,956.00 kB 16 34,191.30 kB 59,990.60 kB 17 47,574.73 kB 150,768.73 kB 18 34,238.70 kB 77,925.80 kB 19 31,116.73 kB 52,757.09 kB 20 31,116.45 kB 52,515.18 kB 21 34,235.90 kB 59,983.80 kB 22 34,225.30 kB 59,997.00 kB 23 34,240.70 kB 60,008.60 kB -
Temporary Files
Size of temporary files
Key values
- 73.37 MiB Temp Files size Peak
- 2025-12-06 11:42:02 Date
Number of temporary files
Key values
- 36 per second Temp Files Peak
- 2025-11-30 21:54:02 Date
Temporary Files Activity
↑ Back to the top of the Temporary Files Activity tableDay Hour Count Total size Average size Nov 30 00 0 0 0 01 0 0 0 02 0 0 0 03 0 0 0 04 0 0 0 05 371 782.19 MiB 2.11 MiB 06 348 732.24 MiB 2.10 MiB 07 354 732.44 MiB 2.07 MiB 08 351 732.32 MiB 2.09 MiB 09 354 732.29 MiB 2.07 MiB 10 354 732.23 MiB 2.07 MiB 11 348 732.16 MiB 2.10 MiB 12 357 732.62 MiB 2.05 MiB 13 351 732.38 MiB 2.09 MiB 14 353 729.73 MiB 2.07 MiB 15 354 732.35 MiB 2.07 MiB 16 348 732.05 MiB 2.10 MiB 17 327 727.05 MiB 2.22 MiB 18 357 732.25 MiB 2.05 MiB 19 343 727.31 MiB 2.12 MiB 20 348 732.27 MiB 2.10 MiB 21 357 732.27 MiB 2.05 MiB 22 357 732.25 MiB 2.05 MiB 23 357 732.26 MiB 2.05 MiB Dec 01 00 0 0 0 01 0 0 0 02 0 0 0 03 0 0 0 04 0 0 0 05 332 732.29 MiB 2.21 MiB 06 353 729.91 MiB 2.07 MiB 07 345 732.14 MiB 2.12 MiB 08 354 732.48 MiB 2.07 MiB 09 357 732.48 MiB 2.05 MiB 10 354 732.46 MiB 2.07 MiB 11 351 732.74 MiB 2.09 MiB 12 357 732.33 MiB 2.05 MiB 13 360 732.47 MiB 2.03 MiB 14 357 732.50 MiB 2.05 MiB 15 357 732.59 MiB 2.05 MiB 16 351 732.42 MiB 2.09 MiB 17 328 729.60 MiB 2.22 MiB 18 348 732.42 MiB 2.10 MiB 19 354 732.23 MiB 2.07 MiB 20 354 732.54 MiB 2.07 MiB 21 354 732.51 MiB 2.07 MiB 22 357 732.47 MiB 2.05 MiB 23 351 732.49 MiB 2.09 MiB Dec 02 00 0 0 0 01 0 0 0 02 0 0 0 03 0 0 0 04 0 0 0 05 337 729.55 MiB 2.16 MiB 06 345 732.45 MiB 2.12 MiB 07 351 732.55 MiB 2.09 MiB 08 357 732.71 MiB 2.05 MiB 09 360 732.44 MiB 2.03 MiB 10 345 732.59 MiB 2.12 MiB 11 351 732.63 MiB 2.09 MiB 12 360 732.62 MiB 2.04 MiB 13 354 732.63 MiB 2.07 MiB 14 348 732.31 MiB 2.10 MiB 15 360 732.62 MiB 2.04 MiB 16 354 732.80 MiB 2.07 MiB 17 365 782.33 MiB 2.14 MiB 18 354 732.50 MiB 2.07 MiB 19 354 732.73 MiB 2.07 MiB 20 353 730.09 MiB 2.07 MiB 21 357 732.38 MiB 2.05 MiB 22 357 732.52 MiB 2.05 MiB 23 345 732.24 MiB 2.12 MiB Dec 03 00 0 0 0 01 0 0 0 02 0 0 0 03 0 0 0 04 0 0 0 05 370 778.83 MiB 2.10 MiB 06 350 730.20 MiB 2.09 MiB 07 354 732.62 MiB 2.07 MiB 08 351 732.52 MiB 2.09 MiB 09 357 732.47 MiB 2.05 MiB 10 354 732.66 MiB 2.07 MiB 11 354 732.71 MiB 2.07 MiB 12 357 732.58 MiB 2.05 MiB 13 353 730.17 MiB 2.07 MiB 14 354 732.45 MiB 2.07 MiB 15 354 732.57 MiB 2.07 MiB 16 354 732.52 MiB 2.07 MiB 17 334 730.05 MiB 2.19 MiB 18 351 732.66 MiB 2.09 MiB 19 353 730.09 MiB 2.07 MiB 20 357 732.68 MiB 2.05 MiB 21 360 732.76 MiB 2.04 MiB 22 348 732.53 MiB 2.10 MiB 23 351 732.65 MiB 2.09 MiB Dec 04 00 0 0 0 01 0 0 0 02 0 0 0 03 0 0 0 04 0 0 0 05 365 782.34 MiB 2.14 MiB 06 357 732.80 MiB 2.05 MiB 07 360 732.61 MiB 2.04 MiB 08 342 732.70 MiB 2.14 MiB 09 348 732.80 MiB 2.11 MiB 10 357 732.79 MiB 2.05 MiB 11 357 732.64 MiB 2.05 MiB 12 351 732.71 MiB 2.09 MiB 13 357 732.73 MiB 2.05 MiB 14 348 732.66 MiB 2.11 MiB 15 360 732.73 MiB 2.04 MiB 16 348 732.77 MiB 2.11 MiB 17 366 786.50 MiB 2.15 MiB 18 348 732.63 MiB 2.11 MiB 19 351 732.57 MiB 2.09 MiB 20 357 732.88 MiB 2.05 MiB 21 357 732.79 MiB 2.05 MiB 22 357 732.84 MiB 2.05 MiB 23 339 732.68 MiB 2.16 MiB Dec 05 00 0 0 0 01 0 0 0 02 0 0 0 03 0 0 0 04 0 0 0 05 334 730.52 MiB 2.19 MiB 06 351 732.90 MiB 2.09 MiB 07 351 732.76 MiB 2.09 MiB 08 354 732.70 MiB 2.07 MiB 09 357 733.16 MiB 2.05 MiB 10 345 732.88 MiB 2.12 MiB 11 354 732.96 MiB 2.07 MiB 12 348 732.62 MiB 2.11 MiB 13 357 732.80 MiB 2.05 MiB 14 354 732.90 MiB 2.07 MiB 15 354 732.99 MiB 2.07 MiB 16 348 732.97 MiB 2.11 MiB 17 337 730.44 MiB 2.17 MiB 18 348 732.78 MiB 2.11 MiB 19 354 732.73 MiB 2.07 MiB 20 344 730.19 MiB 2.12 MiB 21 354 733.02 MiB 2.07 MiB 22 354 732.90 MiB 2.07 MiB 23 354 732.67 MiB 2.07 MiB Dec 06 00 0 0 0 01 0 0 0 02 0 0 0 03 0 0 0 04 0 0 0 05 365 783.13 MiB 2.15 MiB 06 357 733.09 MiB 2.05 MiB 07 351 733.00 MiB 2.09 MiB 08 354 732.75 MiB 2.07 MiB 09 351 732.91 MiB 2.09 MiB 10 354 732.84 MiB 2.07 MiB 11 357 732.95 MiB 2.05 MiB 12 348 733.00 MiB 2.11 MiB 13 351 732.88 MiB 2.09 MiB 14 357 732.90 MiB 2.05 MiB 15 360 733.11 MiB 2.04 MiB 16 351 732.97 MiB 2.09 MiB 17 340 730.69 MiB 2.15 MiB 18 351 732.93 MiB 2.09 MiB 19 348 732.91 MiB 2.11 MiB 20 357 733.07 MiB 2.05 MiB 21 350 730.45 MiB 2.09 MiB 22 348 732.90 MiB 2.11 MiB 23 350 730.66 MiB 2.09 MiB Queries generating the most temporary files (N)
Rank Count Total size Min size Max size Avg size Query 1 46,650 94.55 GiB 632.00 KiB 10.52 MiB 2.08 MiB refresh materialized view core.mv_subject_form with data;-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-30 23:48:04 Duration: 2s845ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-12-04 21:42:04 Duration: 2s331ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-12-05 11:30:04 Duration: 2s326ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
2 56 13.74 MiB 8.00 KiB 920.00 KiB 251.29 KiB alter table "celspac"."dbt_stg"."stg_celspac_admin__subject" add primary key (id);-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ ALTER TABLE "celspac"."dbt_stg"."stg_celspac_admin__subject" ADD PRIMARY KEY (id);
Date: 2025-11-30 05:02:23 Duration: 94ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ ALTER TABLE "celspac"."dbt_stg"."stg_celspac_admin__subject" ADD PRIMARY KEY (id);
Date: 2025-12-05 05:02:20 Duration: 62ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ ALTER TABLE "celspac"."dbt_stg"."stg_celspac_admin__subject" ADD PRIMARY KEY (id);
Date: 2025-12-05 17:02:19 Duration: 51ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
3 56 85.34 MiB 8.00 KiB 3.67 MiB 1.52 MiB alter table "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" add primary key (id);-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject_inform_consent"} */ ALTER TABLE "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" ADD PRIMARY KEY (id);
Date: 2025-12-04 17:02:05 Duration: 304ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject_inform_consent"} */ ALTER TABLE "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" ADD PRIMARY KEY (id);
Date: 2025-12-02 05:02:04 Duration: 175ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject_inform_consent"} */ ALTER TABLE "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" ADD PRIMARY KEY (id);
Date: 2025-12-06 17:02:05 Duration: 173ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
4 43 297.86 MiB 2.49 MiB 14.36 MiB 6.93 MiB create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( with ranked_table_con as ( select *, row_number() over (partition by subject_id, type_code order by priority desc ) as ranked_row from "celspac"."core"."contact" where value -> ? = ?), ranked_table_contact as ( select *, row_number() over (partition by subject_id, type_code order by priority desc ) as ranked_row from "celspac"."core"."contact"), max_prio_perm as ( select * from ranked_table_con where ranked_row = ?), contact_table_max_prio as ( select * from ranked_table_contact where ranked_row = ?), contact_d as ( select distinct subject_id, replace((value -> ?)::text, ?, ? ) AS city, replace((value -> ?)::text, ?, ? ) as postal_code, replace((value -> ?)::text, ?, ? ) AS country, replace((value -> ?)::text, ?, ? ) as street, replace((value -> ?)::text, ?, ? ) AS street_number, replace((value -> ?)::text, ?, ? ) as permanent from max_prio_perm con where con.type_code = ?), contact_d_c as ( select distinct subject_id, replace((value -> ?)::text, ?, ? ) AS city, replace((value -> ?)::text, ?, ? ) as postal_code, replace((value -> ?)::text, ?, ? ) AS country, replace((value -> ?)::text, ?, ? ) as street, replace((value -> ?)::text, ?, ? ) AS street_number, replace((value -> ?)::text, ?, ? ) as permanent from contact_table_max_prio con where con.type_code = ?), con_email as ( select subject_id, replace(value::text, ?, ? ) AS email FROM contact_table_max_prio con WHERE con.type_code = ?), con_ph AS ( SELECT subject_id, replace(value::text, ?, ? ) as phone_number from contact_table_max_prio where type_code = ? ) select s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number as street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street as street_contact, con_d_c.street_number as street_number_contact, con_d_c.city as city_contact, con_d_c.postal_code as postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* from "celspac"."core"."subject" s left join "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se on se.subject_id = s.id left join "celspac"."core"."subject_dead" s_dead on s.id = s_dead.subject_id left join contact_d con_d on con_d.subject_id = s.id left join contact_d_c con_d_c on con_d_c.subject_id = s.id left join con_email c_e on c_e.subject_id = s.id left join con_ph c_p on c_p.subject_id = s.id );-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );
Date: 2025-12-05 05:02:20 Duration: 1s619ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );
Date: 2025-12-03 05:02:20 Duration: 1s382ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );
Date: 2025-12-04 05:02:19 Duration: 1s299ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
5 28 253.95 MiB 6.91 MiB 11.60 MiB 9.07 MiB create table "celspac"."dbt_stg"."inte_unique_subject_extend_array__dbt_tmp" as ( select subject_id, array_agg(extend_template order by subcohort_id ) as extend_template, array_agg(extend order by subcohort_id ) as extend, array_agg(description order by subcohort_id ) as description, array_agg(description_internal order by subcohort_id ) as description_internal, array_agg(subcohort_id order by subcohort_id ) as subcohort_id, array_agg(subcohort_name order by subcohort_id ) as subcohort_name, array_agg(column_prefix order by subcohort_id ) as column_prefix from "celspac"."dbt_stg"."inte_subject_extend" group by subject_id );-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.inte_unique_subject_extend_array"} */ create table "celspac"."dbt_stg"."inte_unique_subject_extend_array__dbt_tmp" as ( SELECT subject_id, array_agg(extend_template ORDER BY subcohort_id ) AS extend_template, array_agg(extend ORDER BY subcohort_id ) AS extend, array_agg(description ORDER BY subcohort_id ) AS description, array_agg(description_internal ORDER BY subcohort_id ) AS description_internal, array_agg(subcohort_id ORDER BY subcohort_id ) AS subcohort_id, array_agg(subcohort_name ORDER BY subcohort_id ) AS subcohort_name, array_agg(column_prefix ORDER BY subcohort_id ) AS column_prefix FROM "celspac"."dbt_stg"."inte_subject_extend" GROUP BY subject_id );
Date: 2025-12-05 17:02:04 Duration: 631ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.inte_unique_subject_extend_array"} */ create table "celspac"."dbt_stg"."inte_unique_subject_extend_array__dbt_tmp" as ( SELECT subject_id, array_agg(extend_template ORDER BY subcohort_id ) AS extend_template, array_agg(extend ORDER BY subcohort_id ) AS extend, array_agg(description ORDER BY subcohort_id ) AS description, array_agg(description_internal ORDER BY subcohort_id ) AS description_internal, array_agg(subcohort_id ORDER BY subcohort_id ) AS subcohort_id, array_agg(subcohort_name ORDER BY subcohort_id ) AS subcohort_name, array_agg(column_prefix ORDER BY subcohort_id ) AS column_prefix FROM "celspac"."dbt_stg"."inte_subject_extend" GROUP BY subject_id );
Date: 2025-11-30 05:02:09 Duration: 595ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.inte_unique_subject_extend_array"} */ create table "celspac"."dbt_stg"."inte_unique_subject_extend_array__dbt_tmp" as ( SELECT subject_id, array_agg(extend_template ORDER BY subcohort_id ) AS extend_template, array_agg(extend ORDER BY subcohort_id ) AS extend, array_agg(description ORDER BY subcohort_id ) AS description, array_agg(description_internal ORDER BY subcohort_id ) AS description_internal, array_agg(subcohort_id ORDER BY subcohort_id ) AS subcohort_id, array_agg(subcohort_name ORDER BY subcohort_id ) AS subcohort_name, array_agg(column_prefix ORDER BY subcohort_id ) AS column_prefix FROM "celspac"."dbt_stg"."inte_subject_extend" GROUP BY subject_id );
Date: 2025-12-06 17:02:04 Duration: 588ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
6 17 167.64 MiB 2.76 MiB 11.91 MiB 9.86 MiB create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-12-01 05:11:55 Duration: 9m35s Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-12-06 17:11:48 Duration: 9m24s Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-12-05 17:11:46 Duration: 9m21s Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
7 13 49.11 MiB 3.78 MiB 3.78 MiB 3.78 MiB create table "celspac"."dbt_marts_dbt_all"."export_proband_all__dbt_tmp" as ( select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, ct.* from ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code || ? || subject_role_code || ? || activity_state_code as state_role from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as state_role ("subject_id" int, "celspac_pr_celspac_p01" text, "celspac_pr_elspac_p01" text, "celspac_pr_zajemci_p01" text, "covid_p01" text, "covid_p02" text, "covid_p03" text, "dust_p01_tng_p09" text, "dust_p01_tng_p10" text, "dust_p01_tng_p11" text, "hapiee_p01" text, "hapiee_p02" text, "hba_p01" text, "horpark" text, "horpark_patients" text, "parents_p01" text, "parents_p02" text, "psycap_p01_hba_p01" text, "psycap_p01_ya_p01" text, "psycap_p01_ya_p02" text, "psycap_p01_ya_p03" text, "psycap_p02_new_hba_p01" text, "psycap_p02_new_ya_p03" text, "psycap_p02_old_hba_p01" text, "psycap_p02_old_ya_p01" text, "psycap_p02_old_ya_p02" text, "psycap_p02_old_ya_p03" text, "tng_4mi_p1" text, "tng_4mi_p2" text, "tng_children_p1" text, "tng_children_p1_chibra" text, "tng__monitor" text, "tng_p01" text, "tng_p02" text, "tng_p03" text, "tng_p04" text, "tng_p05" text, "tng_p06" text, "tng_p07" text, "tng_p08" text, "tng_p08_test" text, "tng_p09" text, "tng_p10" text, "tng_p10_test_tp" text, "tng_p11" text, "tng_p11_monitor" text, "tng_p12" text, "tng_p12_monitor" text, "tng_p13" text, "tng_p13_monitor" text, "tng_pilot_8__monitor" text, "tng_pilot_9__form_fix_2019_06" text, "tng_pilot_9__form_fix_mm38p01_v2_v2" text, "tng_pilot_9__form_fix_mm38p02_v2_v2" text, "tng_pilot_9__form_fix_mm38p03_v2_v2" text, "tng_pilot_9__form_fix_mm38p04_v2_v2" text, "tng_pilot_9__monitor" text, "vulde" text, "ya_p01" text, "ya_p01_digi_ya03v2" text, "ya_p01_digi_ya04v2" text, "ya_p01_digi_ya05v2" text, "ya_p01_test" text, "ya_p02" text, "ya_p02_digi_ya03v2" text, "ya_p02_digi_ya04v2" text, "ya_p02_digi_ya05v2" text, "ya_p02_test" text, "ya_p03" text, "ya_p03_digi_ya03v2" text, "ya_p03_digi_ya04v2" text, "ya_p03_digi_ya05v2" text, "ya_p04" text)) ct join "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj on sbj.id = ct.subject_id );-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_all"} */ create table "celspac"."dbt_marts_dbt_all"."export_proband_all__dbt_tmp" as ( SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, ct.* FROM ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code || ';' || subject_role_code || ';' || activity_state_code AS state_role FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01'), ('celspac_pr_zajemci_p01'), ('covid_p01'), ('covid_p02'), ('covid_p03'), ('dust_p01_tng_p09'), ('dust_p01_tng_p10'), ('dust_p01_tng_p11'), ('hapiee_p01'), ('hapiee_p02'), ('hba_p01'), ('horpark'), ('horpark_patients'), ('parents_p01'), ('parents_p02'), ('psycap_p01_hba_p01'), ('psycap_p01_ya_p01'), ('psycap_p01_ya_p02'), ('psycap_p01_ya_p03'), ('psycap_p02_new_hba_p01'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_hba_p01'), ('psycap_p02_old_ya_p01'), ('psycap_p02_old_ya_p02'), ('psycap_p02_old_ya_p03'), ('tng_4mi_p1'), ('tng_4mi_p2'), ('tng_children_p1'), ('tng_children_p1_chibra'), ('tng__monitor'), ('tng_p01'), ('tng_p02'), ('tng_p03'), ('tng_p04'), ('tng_p05'), ('tng_p06'), ('tng_p07'), ('tng_p08'), ('tng_p08_test'), ('tng_p09'), ('tng_p10'), ('tng_p10_test_tp'), ('tng_p11'), ('tng_p11_monitor'), ('tng_p12'), ('tng_p12_monitor'), ('tng_p13'), ('tng_p13_monitor'), ('tng_pilot_8__monitor'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor'), ('vulde'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2'), ('ya_p04') $$ ) AS state_role ("subject_id" int, "celspac_pr_celspac_p01" text, "celspac_pr_elspac_p01" text, "celspac_pr_zajemci_p01" text, "covid_p01" text, "covid_p02" text, "covid_p03" text, "dust_p01_tng_p09" text, "dust_p01_tng_p10" text, "dust_p01_tng_p11" text, "hapiee_p01" text, "hapiee_p02" text, "hba_p01" text, "horpark" text, "horpark_patients" text, "parents_p01" text, "parents_p02" text, "psycap_p01_hba_p01" text, "psycap_p01_ya_p01" text, "psycap_p01_ya_p02" text, "psycap_p01_ya_p03" text, "psycap_p02_new_hba_p01" text, "psycap_p02_new_ya_p03" text, "psycap_p02_old_hba_p01" text, "psycap_p02_old_ya_p01" text, "psycap_p02_old_ya_p02" text, "psycap_p02_old_ya_p03" text, "tng_4mi_p1" text, "tng_4mi_p2" text, "tng_children_p1" text, "tng_children_p1_chibra" text, "tng__monitor" text, "tng_p01" text, "tng_p02" text, "tng_p03" text, "tng_p04" text, "tng_p05" text, "tng_p06" text, "tng_p07" text, "tng_p08" text, "tng_p08_test" text, "tng_p09" text, "tng_p10" text, "tng_p10_test_tp" text, "tng_p11" text, "tng_p11_monitor" text, "tng_p12" text, "tng_p12_monitor" text, "tng_p13" text, "tng_p13_monitor" text, "tng_pilot_8__monitor" text, "tng_pilot_9__form_fix_2019_06" text, "tng_pilot_9__form_fix_mm38p01_v2_v2" text, "tng_pilot_9__form_fix_mm38p02_v2_v2" text, "tng_pilot_9__form_fix_mm38p03_v2_v2" text, "tng_pilot_9__form_fix_mm38p04_v2_v2" text, "tng_pilot_9__monitor" text, "vulde" text, "ya_p01" text, "ya_p01_digi_ya03v2" text, "ya_p01_digi_ya04v2" text, "ya_p01_digi_ya05v2" text, "ya_p01_test" text, "ya_p02" text, "ya_p02_digi_ya03v2" text, "ya_p02_digi_ya04v2" text, "ya_p02_digi_ya05v2" text, "ya_p02_test" text, "ya_p03" text, "ya_p03_digi_ya03v2" text, "ya_p03_digi_ya04v2" text, "ya_p03_digi_ya05v2" text, "ya_p04" text)) ct JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj ON sbj.id = ct.subject_id );
Date: 2025-11-30 17:02:19 Duration: 822ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_all"} */ create table "celspac"."dbt_marts_dbt_all"."export_proband_all__dbt_tmp" as ( SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, ct.* FROM ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code || ';' || subject_role_code || ';' || activity_state_code AS state_role FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01'), ('celspac_pr_zajemci_p01'), ('covid_p01'), ('covid_p02'), ('covid_p03'), ('dust_p01_tng_p09'), ('dust_p01_tng_p10'), ('dust_p01_tng_p11'), ('hapiee_p01'), ('hapiee_p02'), ('hba_p01'), ('horpark'), ('horpark_patients'), ('parents_p01'), ('parents_p02'), ('psycap_p01_hba_p01'), ('psycap_p01_ya_p01'), ('psycap_p01_ya_p02'), ('psycap_p01_ya_p03'), ('psycap_p02_new_hba_p01'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_hba_p01'), ('psycap_p02_old_ya_p01'), ('psycap_p02_old_ya_p02'), ('psycap_p02_old_ya_p03'), ('tng_4mi_p1'), ('tng_4mi_p2'), ('tng_children_p1'), ('tng_children_p1_chibra'), ('tng__monitor'), ('tng_p01'), ('tng_p02'), ('tng_p03'), ('tng_p04'), ('tng_p05'), ('tng_p06'), ('tng_p07'), ('tng_p08'), ('tng_p08_test'), ('tng_p09'), ('tng_p10'), ('tng_p10_test_tp'), ('tng_p11'), ('tng_p11_monitor'), ('tng_p12'), ('tng_p12_monitor'), ('tng_p13'), ('tng_p13_monitor'), ('tng_pilot_8__monitor'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor'), ('vulde'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2'), ('ya_p04') $$ ) AS state_role ("subject_id" int, "celspac_pr_celspac_p01" text, "celspac_pr_elspac_p01" text, "celspac_pr_zajemci_p01" text, "covid_p01" text, "covid_p02" text, "covid_p03" text, "dust_p01_tng_p09" text, "dust_p01_tng_p10" text, "dust_p01_tng_p11" text, "hapiee_p01" text, "hapiee_p02" text, "hba_p01" text, "horpark" text, "horpark_patients" text, "parents_p01" text, "parents_p02" text, "psycap_p01_hba_p01" text, "psycap_p01_ya_p01" text, "psycap_p01_ya_p02" text, "psycap_p01_ya_p03" text, "psycap_p02_new_hba_p01" text, "psycap_p02_new_ya_p03" text, "psycap_p02_old_hba_p01" text, "psycap_p02_old_ya_p01" text, "psycap_p02_old_ya_p02" text, "psycap_p02_old_ya_p03" text, "tng_4mi_p1" text, "tng_4mi_p2" text, "tng_children_p1" text, "tng_children_p1_chibra" text, "tng__monitor" text, "tng_p01" text, "tng_p02" text, "tng_p03" text, "tng_p04" text, "tng_p05" text, "tng_p06" text, "tng_p07" text, "tng_p08" text, "tng_p08_test" text, "tng_p09" text, "tng_p10" text, "tng_p10_test_tp" text, "tng_p11" text, "tng_p11_monitor" text, "tng_p12" text, "tng_p12_monitor" text, "tng_p13" text, "tng_p13_monitor" text, "tng_pilot_8__monitor" text, "tng_pilot_9__form_fix_2019_06" text, "tng_pilot_9__form_fix_mm38p01_v2_v2" text, "tng_pilot_9__form_fix_mm38p02_v2_v2" text, "tng_pilot_9__form_fix_mm38p03_v2_v2" text, "tng_pilot_9__form_fix_mm38p04_v2_v2" text, "tng_pilot_9__monitor" text, "vulde" text, "ya_p01" text, "ya_p01_digi_ya03v2" text, "ya_p01_digi_ya04v2" text, "ya_p01_digi_ya05v2" text, "ya_p01_test" text, "ya_p02" text, "ya_p02_digi_ya03v2" text, "ya_p02_digi_ya04v2" text, "ya_p02_digi_ya05v2" text, "ya_p02_test" text, "ya_p03" text, "ya_p03_digi_ya03v2" text, "ya_p03_digi_ya04v2" text, "ya_p03_digi_ya05v2" text, "ya_p04" text)) ct JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj ON sbj.id = ct.subject_id );
Date: 2025-11-30 05:02:24 Duration: 821ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_all"} */ create table "celspac"."dbt_marts_dbt_all"."export_proband_all__dbt_tmp" as ( SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, ct.* FROM ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code || ';' || subject_role_code || ';' || activity_state_code AS state_role FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01'), ('celspac_pr_zajemci_p01'), ('covid_p01'), ('covid_p02'), ('covid_p03'), ('dust_p01_tng_p09'), ('dust_p01_tng_p10'), ('dust_p01_tng_p11'), ('hapiee_p01'), ('hapiee_p02'), ('hba_p01'), ('horpark'), ('horpark_patients'), ('parents_p01'), ('parents_p02'), ('psycap_p01_hba_p01'), ('psycap_p01_ya_p01'), ('psycap_p01_ya_p02'), ('psycap_p01_ya_p03'), ('psycap_p02_new_hba_p01'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_hba_p01'), ('psycap_p02_old_ya_p01'), ('psycap_p02_old_ya_p02'), ('psycap_p02_old_ya_p03'), ('tng_4mi_p1'), ('tng_4mi_p2'), ('tng_children_p1'), ('tng_children_p1_chibra'), ('tng__monitor'), ('tng_p01'), ('tng_p02'), ('tng_p03'), ('tng_p04'), ('tng_p05'), ('tng_p06'), ('tng_p07'), ('tng_p08'), ('tng_p08_test'), ('tng_p09'), ('tng_p10'), ('tng_p10_test_tp'), ('tng_p11'), ('tng_p11_monitor'), ('tng_p12'), ('tng_p12_monitor'), ('tng_p13'), ('tng_p13_monitor'), ('tng_pilot_8__monitor'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor'), ('vulde'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2'), ('ya_p04') $$ ) AS state_role ("subject_id" int, "celspac_pr_celspac_p01" text, "celspac_pr_elspac_p01" text, "celspac_pr_zajemci_p01" text, "covid_p01" text, "covid_p02" text, "covid_p03" text, "dust_p01_tng_p09" text, "dust_p01_tng_p10" text, "dust_p01_tng_p11" text, "hapiee_p01" text, "hapiee_p02" text, "hba_p01" text, "horpark" text, "horpark_patients" text, "parents_p01" text, "parents_p02" text, "psycap_p01_hba_p01" text, "psycap_p01_ya_p01" text, "psycap_p01_ya_p02" text, "psycap_p01_ya_p03" text, "psycap_p02_new_hba_p01" text, "psycap_p02_new_ya_p03" text, "psycap_p02_old_hba_p01" text, "psycap_p02_old_ya_p01" text, "psycap_p02_old_ya_p02" text, "psycap_p02_old_ya_p03" text, "tng_4mi_p1" text, "tng_4mi_p2" text, "tng_children_p1" text, "tng_children_p1_chibra" text, "tng__monitor" text, "tng_p01" text, "tng_p02" text, "tng_p03" text, "tng_p04" text, "tng_p05" text, "tng_p06" text, "tng_p07" text, "tng_p08" text, "tng_p08_test" text, "tng_p09" text, "tng_p10" text, "tng_p10_test_tp" text, "tng_p11" text, "tng_p11_monitor" text, "tng_p12" text, "tng_p12_monitor" text, "tng_p13" text, "tng_p13_monitor" text, "tng_pilot_8__monitor" text, "tng_pilot_9__form_fix_2019_06" text, "tng_pilot_9__form_fix_mm38p01_v2_v2" text, "tng_pilot_9__form_fix_mm38p02_v2_v2" text, "tng_pilot_9__form_fix_mm38p03_v2_v2" text, "tng_pilot_9__form_fix_mm38p04_v2_v2" text, "tng_pilot_9__monitor" text, "vulde" text, "ya_p01" text, "ya_p01_digi_ya03v2" text, "ya_p01_digi_ya04v2" text, "ya_p01_digi_ya05v2" text, "ya_p01_test" text, "ya_p02" text, "ya_p02_digi_ya03v2" text, "ya_p02_digi_ya04v2" text, "ya_p02_digi_ya05v2" text, "ya_p02_test" text, "ya_p03" text, "ya_p03_digi_ya03v2" text, "ya_p03_digi_ya04v2" text, "ya_p03_digi_ya05v2" text, "ya_p04" text)) ct JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj ON sbj.id = ct.subject_id );
Date: 2025-12-06 05:02:20 Duration: 807ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
Queries generating the largest temporary files
Rank Size Query 1 14.36 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );[ Date: 2025-12-05 17:02:19 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
2 14.36 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );[ Date: 2025-12-06 05:02:19 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
3 14.36 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );[ Date: 2025-12-06 17:02:19 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
4 14.36 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );[ Date: 2025-12-04 17:02:19 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
5 14.36 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );[ Date: 2025-12-05 05:02:20 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
6 14.36 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );[ Date: 2025-12-03 17:02:19 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
7 14.36 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );[ Date: 2025-12-04 05:02:19 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
8 14.36 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );[ Date: 2025-12-02 17:02:18 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
9 14.36 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );[ Date: 2025-12-03 05:02:20 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
10 14.36 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );[ Date: 2025-11-30 05:02:23 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
11 14.36 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );[ Date: 2025-11-30 17:02:18 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
12 14.36 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );[ Date: 2025-12-01 05:02:18 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
13 14.36 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );[ Date: 2025-12-01 17:02:19 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
14 14.36 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );[ Date: 2025-12-02 05:02:18 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
15 11.91 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-11-30 17:11:42 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
16 11.91 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-12-01 05:11:55 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
17 11.91 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-12-01 17:11:44 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
18 11.91 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-12-02 05:11:43 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
19 11.91 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-12-03 17:11:33 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
20 11.91 MiB /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-12-05 05:11:44 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
-
Vacuums
Vacuums / Analyzes Distribution
Key values
- 2.40 sec Highest CPU-cost vacuum
Table pg_catalog.pg_attribute
Database celspac - 2025-12-04 17:09:20 Date
- 0 sec Highest CPU-cost analyze
Table
Database celspac - Date
Average Autovacuum Duration
Key values
- 2.40 sec Highest CPU-cost vacuum
Table pg_catalog.pg_attribute
Database celspac - 2025-12-04 17:09:20 Date
Analyzes per table
Key values
- core.mv_subject_form (1322) Main table analyzed (database celspac)
- 3,363 analyzes Total
Table Number of analyzes celspac.core.mv_subject_form 1322 celspac.core.mv_subject_event 887 celspac.public.scheduled_command 229 celspac.pg_catalog.pg_class 216 celspac.pg_catalog.pg_type 53 celspac.pg_catalog.pg_index 41 celspac.pg_catalog.pg_attribute 36 celspac.pg_catalog.pg_depend 35 template1.pg_catalog.pg_shdepend 20 celspac.core.cohort 19 celspac.dbt_stg.inte_unique_subject_extend_array 14 celspac.dbt_stg.inte_unique_subject_extend_columns 14 celspac.dbt_stg.stg_celspac_admin__inform_consent 14 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 14 celspac.dbt_stg.inte_unique_subject_extend 14 celspac.dbt_stg.inte_subject_extend 14 celspac.dbt_stg.stg_celspac_admin__subcohort_inform_consent 14 celspac.dbt_stg.stg_celspac_admin__subcohort 14 celspac.dbt_stg.stg_celspac_admin__subject 14 celspac.dbt_marts_dbt.export_proband_by_pilot__1 13 celspac.dbt_marts_dbt.export_proband_by_pilot__26 13 celspac.dbt_marts_dbt.export_proband_by_pilot__30 13 celspac.dbt_marts_dbt.export_proband_by_pilot__17 13 celspac.dbt_marts_dbt.export_proband_by_pilot__35 13 celspac.dbt_marts_dbt.export_proband_by_pilot__7 13 celspac.dbt_marts_dbt.export_proband_by_pilot__25 13 celspac.dbt_marts_dbt.export_proband_by_pilot__5 13 celspac.dbt_marts_dbt.export_proband_by_pilot__4 13 celspac.dbt_marts_dbt.export_proband_by_pilot__20 13 celspac.dbt_marts_dbt.export_proband_by_pilot__36 13 celspac.dbt_marts_dbt.export_proband_by_pilot__11 13 celspac.dbt_marts_dbt.export_proband_by_pilot__8 13 celspac.dbt_marts_dbt.export_proband_by_pilot__19 13 celspac.dbt_marts_dbt.export_proband_by_pilot__9 13 postgres.pg_catalog.pg_shdepend 13 celspac.dbt_marts_dbt.test_export 13 celspac.dbt_marts_dbt.export_proband_by_pilot__15 13 celspac.dbt_marts_dbt.export_proband_by_pilot__12 13 celspac.dbt_marts_dbt.export_proband_by_pilot__29 13 celspac.dbt_marts_dbt.export_proband_by_pilot__23 13 celspac.dbt_marts_dbt.export_proband_by_pilot__21 13 celspac.dbt_marts_dbt_all.export_proband_all 13 celspac.dbt_marts_dbt.export_proband_by_pilot__37 13 celspac.dbt_marts_dbt.export_proband_by_pilot__10 13 celspac.dbt_marts_dbt.export_proband_by_pilot__27 13 celspac.dbt_marts_dbt.export_proband_by_pilot__22 13 celspac.dbt_marts_dbt.export_proband_by_pilot__18 13 celspac.pg_catalog.pg_shdepend 7 celspac.pg_catalog.pg_constraint 2 celspac.pg_catalog.pg_rewrite 2 celspac.core.system_settings 1 celspac.core.sample 1 celspac.pg_catalog.pg_namespace 1 celspac.core.active_connection 1 Total 3,363 Vacuums per table
Key values
- core.mv_subject_form (1322) Main table vacuumed on database celspac
- 3,042 vacuums Total
Index Buffer usage Skipped WAL usage Frozen Table Vacuums scans hits misses dirtied pins frozen records full page bytes pages tuples celspac.core.mv_subject_form 1,322 0 6,207,708 0 312,754 0 0 2,901,764 1,467 182,886,970 0 0 celspac.core.mv_subject_event 887 0 182,437 0 3,627 0 0 29,271 1,008 9,660,356 0 0 celspac.pg_catalog.pg_class 297 5 51,517 0 2,326 0 0 6,813 2,426 6,529,365 1,121 2,964 celspac.pg_catalog.pg_attribute 139 14 240,988 0 9,707 0 0 20,654 8,057 22,751,950 310 8,017 celspac.pg_catalog.pg_type 85 48 20,615 0 4,242 0 0 9,680 2,847 4,382,403 588 1,174 celspac.pg_catalog.pg_depend 39 39 57,574 0 4,088 0 0 9,454 2,935 5,720,208 566 4,117 celspac.pg_catalog.pg_index 21 21 8,475 0 3,882 0 0 7,505 2,120 1,680,881 191 222 celspac.dbt_stg.inte_unique_subject_extend_array 14 0 70,288 0 34,442 0 0 50,977 14 3,124,207 0 0 celspac.pg_catalog.pg_statistic 14 4 23,418 0 9,880 0 0 15,195 6,239 6,061,952 598 2,113 celspac.dbt_stg.inte_subject_extend 14 0 45,467 0 34,613 0 0 36,841 14 2,290,183 0 0 celspac.dbt_stg.inte_unique_subject_extend 14 0 32,875 0 25,094 0 0 26,978 14 1,708,266 0 0 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 14 0 127,338 0 64,431 0 0 73,895 14 4,476,369 0 0 celspac.dbt_stg.stg_celspac_admin__subject 14 0 63,364 0 248 0 0 31,093 14 1,951,104 0 0 celspac.dbt_stg.inte_unique_subject_extend_columns 14 0 19,447 0 9,348 0 0 10,052 14 709,212 0 0 celspac.dbt_marts_dbt_all.export_proband_all 13 0 45,403 0 26,242 0 0 21,693 10 1,363,534 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__17 13 0 4,810 0 144 0 0 39 1 5,217 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__23 13 0 11,742 0 715 0 0 363 3 33,315 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__26 13 0 3,770 0 288 0 0 39 1 5,217 0 0 celspac.dbt_marts_dbt.test_export 13 0 522 0 178 0 0 137 8 67,538 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__19 13 0 43,018 0 14,843 0 0 23,907 14 1,520,412 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__20 13 0 4,940 0 125 0 0 39 1 5,217 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__22 13 0 1,781 0 103 0 0 13 1 4,073 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__27 13 0 4,004 0 270 0 0 39 0 3,588 0 0 template1.pg_catalog.pg_shdepend 11 11 3,587 0 1,641 0 0 3,328 1,046 801,055 389 655 postgres.pg_catalog.pg_shdepend 8 8 2,547 0 1,130 0 0 2,194 568 510,248 98 197 celspac.pg_toast.pg_toast_2619 7 7 1,411 0 537 0 0 1,166 259 697,186 28 67 celspac.pg_toast.pg_toast_2618 5 5 631 0 437 0 0 746 164 155,533 0 0 celspac.pg_catalog.pg_shdepend 4 4 1,559 0 366 0 0 1,021 223 226,616 89 156 celspac.core.proband_event 1 1 228 0 26 0 0 62 25 155,869 4 26 celspac.core.active_connection 1 1 126 0 44 0 0 64 41 265,055 1 68 Total 3,042 168 7,281,590 371,488 565,771 0 0 3,285,022 29,548 259,753,099 3,983 19,776 Vacuum throughput per table
Key values
- core.mv_subject_form (142.24) Max CPU elapsed for vacuum on database celspac
- unknown (0 ms) Max I/O read time for vacuum on database celspac
- unknown (0 ms) Max I/O write time for vacuum on database celspac
I/O timing (ms) CPU (s) Table read write elapsed celspac.core.mv_subject_form 0 0 142.24 celspac.core.mv_subject_event 0 0 0.09 celspac.pg_catalog.pg_class 0 0 1.54 celspac.pg_catalog.pg_attribute 0 0 11.24 celspac.pg_catalog.pg_type 0 0 1.5 celspac.pg_catalog.pg_depend 0 0 3.32 celspac.pg_catalog.pg_index 0 0 1.18 celspac.dbt_stg.inte_unique_subject_extend_array 0 0 9.08 celspac.pg_catalog.pg_statistic 0 0 5.34 celspac.dbt_stg.inte_subject_extend 0 0 8.61 celspac.dbt_stg.inte_unique_subject_extend 0 0 6.39 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 0 0 16 celspac.dbt_stg.stg_celspac_admin__subject 0 0 0.76 celspac.dbt_stg.inte_unique_subject_extend_columns 0 0 2.26 celspac.dbt_marts_dbt_all.export_proband_all 0 0 6.27 celspac.dbt_marts_dbt.export_proband_by_pilot__17 0 0 0.01 celspac.dbt_marts_dbt.export_proband_by_pilot__23 0 0 0.25 celspac.dbt_marts_dbt.export_proband_by_pilot__26 0 0 0.04 celspac.dbt_marts_dbt.test_export 0 0 0.02 celspac.dbt_marts_dbt.export_proband_by_pilot__19 0 0 3.73 celspac.dbt_marts_dbt.export_proband_by_pilot__20 0 0 0.01 celspac.dbt_marts_dbt.export_proband_by_pilot__22 0 0 0.01 celspac.dbt_marts_dbt.export_proband_by_pilot__27 0 0 0.04 template1.pg_catalog.pg_shdepend 0 0 0.43 postgres.pg_catalog.pg_shdepend 0 0 0.38 celspac.pg_toast.pg_toast_2619 0 0 0.2 celspac.pg_toast.pg_toast_2618 0 0 0.2 celspac.pg_catalog.pg_shdepend 0 0 0.09 celspac.core.proband_event 0 0 0.02 celspac.core.active_connection 0 0 0.16 Total 0 0 221.41 Tuples removed per table
Key values
- pg_catalog.pg_attribute (173487) Main table with removed tuples on database celspac
- 340571 tuples Total removed
Index Tuples Pages Table Vacuums scans removed remain not yet removable removed remain celspac.pg_catalog.pg_attribute 139 14 173,487 9,137,742 781,496 0 1,675,784 celspac.pg_catalog.pg_statistic 14 4 96,536 2,067,279 51,883 0 568,848 celspac.pg_catalog.pg_class 297 5 34,071 576,061 7,974 0 1,330,560 celspac.pg_catalog.pg_depend 39 39 20,878 466,429 642 0 27,885 celspac.pg_catalog.pg_type 85 48 7,562 142,738 8,016 0 61,030 celspac.pg_catalog.pg_index 21 21 2,786 20,236 116 0 5,754 template1.pg_catalog.pg_shdepend 11 11 1,555 11,118 52 0 1,122 celspac.pg_toast.pg_toast_2619 7 7 1,258 14,608 297 0 6,020 postgres.pg_catalog.pg_shdepend 8 8 1,125 8,110 110 0 816 celspac.pg_toast.pg_toast_2618 5 5 765 2,527 0 0 2,905 celspac.pg_catalog.pg_shdepend 4 4 500 4,408 116 0 408 celspac.core.proband_event 1 1 42 1,595 0 0 24 celspac.core.active_connection 1 1 6 1,423 0 0 17 celspac.dbt_marts_dbt_all.export_proband_all 13 0 0 651,334 0 0 28,288 celspac.dbt_stg.inte_unique_subject_extend_array 14 0 0 701,759 0 0 51,392 celspac.core.mv_subject_event 887 0 0 2,008,774 0 1,774 26,610 celspac.dbt_stg.inte_subject_extend 14 0 0 728,131 0 0 37,056 celspac.dbt_marts_dbt.export_proband_by_pilot__17 13 0 0 19,032 0 650 1,014 celspac.dbt_stg.inte_unique_subject_extend 14 0 0 701,759 0 0 27,776 celspac.core.mv_subject_form 1,322 0 0 218,029,005 0 0 2,961,280 celspac.dbt_marts_dbt.export_proband_by_pilot__23 13 0 0 99,784 0 788 4,204 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 14 0 0 4,447,744 0 0 74,368 celspac.dbt_marts_dbt.export_proband_by_pilot__26 13 0 0 28,418 0 130 1,534 celspac.dbt_marts_dbt.test_export 13 0 0 19,032 0 26 182 celspac.dbt_marts_dbt.export_proband_by_pilot__19 13 0 0 401,245 0 0 24,128 celspac.dbt_marts_dbt.export_proband_by_pilot__20 13 0 0 17,472 0 715 949 celspac.dbt_marts_dbt.export_proband_by_pilot__22 13 0 0 15,561 0 0 832 celspac.dbt_marts_dbt.export_proband_by_pilot__27 13 0 0 29,094 0 247 1,417 celspac.dbt_stg.stg_celspac_admin__subject 14 0 0 702,403 0 0 31,360 celspac.dbt_stg.inte_unique_subject_extend_columns 14 0 0 701,759 0 742 10,010 Total 3,042 168 340,571 241,756,580 850,702 5,072 6,963,573 Pages removed per table
Key values
- core.mv_subject_event (1774) Main table with removed pages on database celspac
- 5072 pages Total removed
Table Number of vacuums Index scans Tuples removed Pages removed celspac.core.mv_subject_event 887 0 0 1774 celspac.dbt_marts_dbt.export_proband_by_pilot__23 13 0 0 788 celspac.dbt_stg.inte_unique_subject_extend_columns 14 0 0 742 celspac.dbt_marts_dbt.export_proband_by_pilot__20 13 0 0 715 celspac.dbt_marts_dbt.export_proband_by_pilot__17 13 0 0 650 celspac.dbt_marts_dbt.export_proband_by_pilot__27 13 0 0 247 celspac.dbt_marts_dbt.export_proband_by_pilot__26 13 0 0 130 celspac.dbt_marts_dbt.test_export 13 0 0 26 celspac.core.proband_event 1 1 42 0 celspac.dbt_marts_dbt_all.export_proband_all 13 0 0 0 celspac.dbt_stg.inte_unique_subject_extend_array 14 0 0 0 celspac.pg_catalog.pg_statistic 14 4 96536 0 celspac.pg_catalog.pg_type 85 48 7562 0 celspac.pg_catalog.pg_shdepend 4 4 500 0 celspac.dbt_stg.inte_subject_extend 14 0 0 0 celspac.pg_catalog.pg_depend 39 39 20878 0 celspac.dbt_stg.inte_unique_subject_extend 14 0 0 0 celspac.core.mv_subject_form 1322 0 0 0 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 14 0 0 0 celspac.pg_toast.pg_toast_2618 5 5 765 0 postgres.pg_catalog.pg_shdepend 8 8 1125 0 celspac.pg_catalog.pg_attribute 139 14 173487 0 celspac.dbt_marts_dbt.export_proband_by_pilot__19 13 0 0 0 template1.pg_catalog.pg_shdepend 11 11 1555 0 celspac.dbt_marts_dbt.export_proband_by_pilot__22 13 0 0 0 celspac.pg_catalog.pg_class 297 5 34071 0 celspac.pg_catalog.pg_index 21 21 2786 0 celspac.dbt_stg.stg_celspac_admin__subject 14 0 0 0 celspac.pg_toast.pg_toast_2619 7 7 1258 0 celspac.core.active_connection 1 1 6 0 Total 3,042 168 340,571 5,072 Autovacuum Activity
↑ Back to the top of the Autovacuum Activity tableDay Hour VACUUMs ANALYZEs Nov 30 00 0 0 01 0 0 02 0 0 03 0 0 04 0 0 05 46 55 06 19 21 07 20 21 08 19 23 09 21 21 10 20 21 11 19 22 12 20 24 13 18 21 14 22 23 15 19 21 16 21 22 17 51 62 18 19 21 19 19 21 20 21 22 21 20 22 22 19 21 23 21 23 Dec 01 00 0 0 01 0 0 02 0 0 03 0 0 04 0 0 05 51 54 06 22 23 07 19 21 08 19 22 09 20 21 10 20 22 11 20 23 12 19 22 13 19 23 14 19 20 15 21 24 16 20 20 17 53 63 18 19 20 19 19 20 20 19 21 21 20 21 22 20 21 23 19 21 Dec 02 00 1 0 01 0 0 02 0 0 03 0 0 04 0 0 05 43 53 06 20 20 07 19 21 08 19 22 09 20 23 10 23 23 11 19 22 12 18 20 13 19 24 14 22 24 15 19 20 16 20 23 17 50 62 18 20 23 19 19 21 20 19 22 21 21 24 22 21 20 23 19 23 Dec 03 00 1 0 01 0 0 02 0 0 03 0 0 04 0 0 05 19 21 06 21 26 07 19 21 08 19 21 09 23 27 10 20 23 11 22 24 12 20 22 13 19 21 14 22 23 15 20 24 16 19 22 17 68 60 18 19 21 19 19 22 20 19 23 21 21 21 22 20 22 23 20 21 Dec 04 00 0 0 01 0 0 02 0 0 03 0 0 04 0 0 05 39 54 06 18 21 07 20 20 08 18 21 09 21 21 10 19 19 11 20 23 12 20 23 13 19 21 14 22 23 15 19 19 16 21 22 17 53 62 18 20 21 19 19 21 20 20 23 21 20 22 22 21 22 23 18 22 Dec 05 00 1 0 01 0 0 02 0 0 03 0 0 04 0 0 05 44 52 06 19 20 07 19 23 08 19 22 09 22 21 10 20 23 11 19 22 12 19 21 13 20 24 14 21 22 15 20 21 16 20 24 17 70 62 18 19 22 19 20 20 20 20 23 21 20 22 22 19 22 23 21 22 Dec 06 00 0 0 01 0 0 02 0 0 03 0 0 04 0 0 05 44 53 06 20 21 07 19 21 08 18 20 09 21 20 10 20 21 11 19 20 12 20 23 13 18 21 14 22 22 15 19 20 16 20 24 17 54 60 18 18 21 19 19 21 20 19 20 21 21 24 22 20 19 23 19 20 - 2.40 sec Highest CPU-cost vacuum
-
Locks
Locks by types
Key values
- AccessExclusiveLock Main Lock Type
- 3 locks Total
Most frequent waiting queries (N)
Rank Count Total time Min time Max time Avg duration Query 1 1 1s16ms 1s16ms 1s16ms 1s16ms drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent__dbt_backup" cascade;-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subcohort_inform_consent"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent__dbt_backup" cascade;
Date: 2025-12-03 05:02:05 Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subcohort_inform_consent"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent__dbt_backup" cascade;
Date: 2025-12-05 05:02:04 Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subcohort_inform_consent"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent__dbt_backup" cascade;
Date: 2025-12-03 17:02:04 Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
2 1 1s16ms 1s16ms 1s16ms 1s16ms drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__subcohort__dbt_backup" cascade;-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subcohort"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__subcohort__dbt_backup" cascade;
Date: 2025-12-03 05:02:05 Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subcohort"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__subcohort__dbt_backup" cascade;
Date: 2025-12-06 17:02:04 Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subcohort"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__subcohort__dbt_backup" cascade;
Date: 2025-12-05 05:02:04 Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
3 1 1s 1s 1s 1s drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__inform_consent__dbt_backup" cascade;-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__inform_consent"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__inform_consent__dbt_backup" cascade;
Date: 2025-12-03 05:02:05 Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__inform_consent"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__inform_consent__dbt_backup" cascade;
Date: 2025-12-05 05:02:04 Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__inform_consent"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__inform_consent__dbt_backup" cascade;
Date: 2025-12-06 17:02:04 Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
Queries that waited the most
Rank Wait time Query 1 1s16ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subcohort_inform_consent"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent__dbt_backup" cascade;[ Date: 2025-12-03 05:02:05 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
2 1s16ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subcohort"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__subcohort__dbt_backup" cascade;[ Date: 2025-12-03 05:02:05 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
3 1s /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__inform_consent"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__inform_consent__dbt_backup" cascade;[ Date: 2025-12-03 05:02:05 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
-
Queries
Queries by type
Key values
- 2,440,063 Total read queries
- 131,890 Total write queries
Queries by database
Key values
- celspac Main database
- 2,637,273 Requests
- 2h44m7s (celspac)
- Main time consuming database
Database Request type Count Duration celspac Total 2,637,273 2h44m7s copy to 184 1m40s cte 8,504 2m43s cursor 40,462 11s959ms ddl 2,443 2h1m56s insert 9,822 9s924ms others 85,640 30m18s select 2,419,743 5m58s tcl 54,034 38s668ms update 16,441 28s185ms postgres Total 10,244 7s506ms select 10,244 7s506ms template1 Total 10,079 6s175ms select 10,076 6s175ms Queries by user
Key values
- tng_migration_user Main user
- 5,938,145 Requests
User Request type Count Duration bilik Total 1,068 3m22s copy to 368 3m21s cte 2 4ms others 342 75ms select 354 1s297ms tcl 2 0ms postgres Total 67,698 48s307ms select 67,692 48s307ms tng__dwh_celspac_fdw Total 99,932 29s165ms cursor 98,266 29s101ms others 1,190 55ms tcl 476 8ms tng_migration_user Total 5,938,145 6h41m35s cte 20,930 6m43s ddl 5,990 5h5m7s insert 22,379 23s585ms others 190,953 1h13m28s select 5,530,952 13m13s tcl 127,604 1m31s update 39,337 1m7s Duration by user
Key values
- 6h41m35s (tng_migration_user) Main time consuming user
User Request type Count Duration bilik Total 1,068 3m22s copy to 368 3m21s cte 2 4ms others 342 75ms select 354 1s297ms tcl 2 0ms postgres Total 67,698 48s307ms select 67,692 48s307ms tng__dwh_celspac_fdw Total 99,932 29s165ms cursor 98,266 29s101ms others 1,190 55ms tcl 476 8ms tng_migration_user Total 5,938,145 6h41m35s cte 20,930 6m43s ddl 5,990 5h5m7s insert 22,379 23s585ms others 190,953 1h13m28s select 5,530,952 13m13s tcl 127,604 1m31s update 39,337 1m7s Queries by host
Key values
- 127.0.0.1 Main host
- 5,938,361 Requests
- 6h41m36s (127.0.0.1)
- Main time consuming host
Host Request type Count Duration 10.16.50.4 Total 99,932 29s165ms cursor 98,266 29s101ms others 1,190 55ms tcl 476 8ms 127.0.0.1 Total 5,938,361 6h41m36s cte 20,930 6m43s ddl 5,990 5h5m7s insert 22,379 23s585ms others 190,953 1h13m28s select 5,531,168 13m13s tcl 127,604 1m31s update 39,337 1m7s [local] Total 68,550 4m10s copy to 368 3m21s cte 2 4ms others 342 75ms select 67,830 49s245ms tcl 2 0ms Queries by application
Key values
- [unknown] Main application
- 2,602,129 Requests
- 2h4m58s (dbt)
- Main time consuming application
Application Request type Count Duration [unknown] Total 2,602,129 37m29s insert 9,822 9s924ms others 84,895 30m17s select 2,439,216 6m4s tcl 51,755 28s436ms update 16,441 28s185ms dbt Total 13,614 2h4m58s cte 8,503 2m43s ddl 2,443 2h1m56s others 84 1s289ms select 502 6s128ms tcl 2,082 10s228ms pg_dump Total 534 1m41s copy to 184 1m40s cte 1 2ms others 171 37ms select 177 648ms tcl 1 0ms pg_dumpall Total 168 311ms select 168 311ms postgres_fdw Total 41,148 11s986ms cursor 40,462 11s959ms others 490 22ms tcl 196 3ms psql Total 3 0ms Number of cancelled queries
Key values
- 0 per second Cancelled query Peak
- 2025-12-01 09:55:29 Date
Number of cancelled queries (5 minutes period)
NO DATASET
-
Top Queries
Histogram of query times
Key values
- 2,569,161 0-1ms duration
Slowest individual queries
Rank Duration Query 1 9m35s /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-12-01 05:11:55 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
2 9m24s /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-12-06 17:11:48 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
3 9m21s /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-12-05 17:11:46 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
4 9m20s /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-12-01 17:11:44 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
5 9m19s /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-12-02 05:11:43 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
6 9m19s /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-11-30 17:11:42 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
7 9m19s /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-12-05 05:11:44 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
8 9m12s /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-12-03 17:11:33 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
9 6m12s /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-12-06 05:08:33 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
10 6m9s /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-12-04 17:08:35 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
11 6m6s /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-12-02 17:08:29 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
12 6m6s /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-11-30 05:08:31 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
13 6m3s /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-12-04 05:08:27 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
14 1m12s COPY core.notif (id, subject_id, notif_template_id, notif_state_code, subject, content, other_side_id, created_at, is_archived, processed_time, owner_user_id, owner_group_id, notif_type_code, is_attachments, external_id, updated_at, addressee) TO stdout;[ Date: 2025-12-03 18:53:30 - Database: celspac - User: bilik - Remote: [local] - Application: pg_dump ]
15 39s78ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__23"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( -- suject (proband) patrici do kohorty ..., Pilot ID: 23 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 23 -- Pilot ID );[ Date: 2025-12-01 05:02:59 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
16 37s617ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__23"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( -- suject (proband) patrici do kohorty ..., Pilot ID: 23 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 23 -- Pilot ID );[ Date: 2025-12-03 17:02:58 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
17 37s33ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__23"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( -- suject (proband) patrici do kohorty ..., Pilot ID: 23 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 23 -- Pilot ID );[ Date: 2025-12-02 05:02:56 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
18 36s649ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__23"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( -- suject (proband) patrici do kohorty ..., Pilot ID: 23 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 23 -- Pilot ID );[ Date: 2025-12-05 17:02:57 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
19 35s305ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__23"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( -- suject (proband) patrici do kohorty ..., Pilot ID: 23 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 23 -- Pilot ID );[ Date: 2025-12-06 17:03:00 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
20 34s962ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__23"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( -- suject (proband) patrici do kohorty ..., Pilot ID: 23 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 23 -- Pilot ID );[ Date: 2025-12-05 05:03:01 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
Time consuming queries (N)
Rank Total duration Times executed Min duration Max duration Avg duration Query 1 1h45m31s 13 6m3s 9m35s 8m7s create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #1
Day Hour Count Duration Avg duration Nov 30 05 1 6m6s 6m6s 17 1 9m19s 9m19s Dec 01 05 1 9m35s 9m35s 17 1 9m20s 9m20s Dec 02 05 1 9m19s 9m19s 17 1 6m6s 6m6s Dec 03 17 1 9m12s 9m12s Dec 04 05 1 6m3s 6m3s 17 1 6m9s 6m9s Dec 05 05 1 9m19s 9m19s 17 1 9m21s 9m21s Dec 06 05 1 6m12s 6m12s 17 1 9m24s 9m24s [ User: tng_migration_user - Total duration: 1h45m31s - Times executed: 13 ]
[ Application: dbt - Total duration: 1h45m31s - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-12-01 05:11:55 Duration: 9m35s Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-12-06 17:11:48 Duration: 9m24s Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-12-05 17:11:46 Duration: 9m21s Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
2 28m5s 1,322 1s122ms 2s845ms 1s274ms refresh materialized view core.mv_subject_form with data;Times Reported Time consuming queries #2
Day Hour Count Duration Avg duration Nov 30 05 10 12s248ms 1s224ms 06 10 12s168ms 1s216ms 07 10 12s340ms 1s234ms 08 10 12s951ms 1s295ms 09 10 12s504ms 1s250ms 10 10 12s434ms 1s243ms 11 10 12s654ms 1s265ms 12 10 12s843ms 1s284ms 13 10 12s741ms 1s274ms 14 10 11s926ms 1s192ms 15 10 12s588ms 1s258ms 16 10 12s364ms 1s236ms 17 9 12s226ms 1s358ms 18 10 12s286ms 1s228ms 19 10 12s322ms 1s232ms 20 10 12s665ms 1s266ms 21 10 12s493ms 1s249ms 22 10 12s371ms 1s237ms 23 10 15s540ms 1s554ms Dec 01 05 9 11s748ms 1s305ms 06 10 12s444ms 1s244ms 07 10 12s714ms 1s271ms 08 10 12s737ms 1s273ms 09 10 12s267ms 1s226ms 10 10 12s781ms 1s278ms 11 10 12s444ms 1s244ms 12 10 12s310ms 1s231ms 13 10 12s192ms 1s219ms 14 10 12s577ms 1s257ms 15 10 12s773ms 1s277ms 16 10 13s482ms 1s348ms 17 9 11s583ms 1s287ms 18 10 12s672ms 1s267ms 19 10 12s474ms 1s247ms 20 10 12s717ms 1s271ms 21 10 12s594ms 1s259ms 22 10 12s228ms 1s222ms 23 10 12s737ms 1s273ms Dec 02 05 9 11s487ms 1s276ms 06 10 13s11ms 1s301ms 07 10 12s577ms 1s257ms 08 10 12s888ms 1s288ms 09 10 12s458ms 1s245ms 10 10 13s208ms 1s320ms 11 10 12s651ms 1s265ms 12 10 12s421ms 1s242ms 13 10 12s878ms 1s287ms 14 10 12s818ms 1s281ms 15 10 12s393ms 1s239ms 16 10 12s792ms 1s279ms 17 10 12s594ms 1s259ms 18 10 12s322ms 1s232ms 19 10 12s261ms 1s226ms 20 10 12s281ms 1s228ms 21 10 12s743ms 1s274ms 22 10 12s774ms 1s277ms 23 10 13s239ms 1s323ms Dec 03 05 10 12s992ms 1s299ms 06 10 12s908ms 1s290ms 07 10 12s655ms 1s265ms 08 10 14s61ms 1s406ms 09 10 12s557ms 1s255ms 10 10 12s890ms 1s289ms 11 10 12s953ms 1s295ms 12 10 12s966ms 1s296ms 13 10 13s64ms 1s306ms 14 10 12s528ms 1s252ms 15 10 12s485ms 1s248ms 16 10 12s582ms 1s258ms 17 9 11s918ms 1s324ms 18 10 13s793ms 1s379ms 19 10 12s631ms 1s263ms 20 10 12s627ms 1s262ms 21 10 12s471ms 1s247ms 22 10 12s635ms 1s263ms 23 10 12s710ms 1s271ms Dec 04 05 10 12s602ms 1s260ms 06 10 13s271ms 1s327ms 07 10 12s217ms 1s221ms 08 10 12s774ms 1s277ms 09 10 14s274ms 1s427ms 10 10 12s838ms 1s283ms 11 10 12s917ms 1s291ms 12 10 13s492ms 1s349ms 13 10 13s359ms 1s335ms 14 10 12s593ms 1s259ms 15 10 12s205ms 1s220ms 16 10 13s441ms 1s344ms 17 10 13s1ms 1s300ms 18 10 12s344ms 1s234ms 19 10 12s626ms 1s262ms 20 10 12s698ms 1s269ms 21 10 14s210ms 1s421ms 22 10 12s639ms 1s263ms 23 10 13s219ms 1s321ms Dec 05 05 9 11s788ms 1s309ms 06 10 12s346ms 1s234ms 07 10 13s22ms 1s302ms 08 10 13s382ms 1s338ms 09 10 13s509ms 1s350ms 10 10 13s263ms 1s326ms 11 10 13s221ms 1s322ms 12 10 13s566ms 1s356ms 13 10 12s711ms 1s271ms 14 10 12s738ms 1s273ms 15 10 12s80ms 1s208ms 16 10 12s752ms 1s275ms 17 9 10s898ms 1s210ms 18 10 12s376ms 1s237ms 19 10 12s367ms 1s236ms 20 10 12s389ms 1s238ms 21 10 12s388ms 1s238ms 22 10 13s423ms 1s342ms 23 10 12s480ms 1s248ms Dec 06 05 10 12s577ms 1s257ms 06 10 13s181ms 1s318ms 07 10 12s582ms 1s258ms 08 10 12s923ms 1s292ms 09 10 12s281ms 1s228ms 10 10 12s358ms 1s235ms 11 10 12s293ms 1s229ms 12 10 12s724ms 1s272ms 13 10 12s176ms 1s217ms 14 10 12s237ms 1s223ms 15 10 13s506ms 1s350ms 16 10 13s128ms 1s312ms 17 9 11s140ms 1s237ms 18 10 12s110ms 1s211ms 19 10 12s219ms 1s221ms 20 10 12s15ms 1s201ms 21 10 12s546ms 1s254ms 22 10 12s784ms 1s278ms 23 10 12s621ms 1s262ms [ User: tng_migration_user - Total duration: 28m5s - Times executed: 1322 ]
[ Application: [unknown] - Total duration: 28m5s - Times executed: 1322 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-30 23:48:04 Duration: 2s845ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-12-04 21:42:04 Duration: 2s331ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-12-05 11:30:04 Duration: 2s326ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
3 6m32s 13 1s598ms 39s78ms 30s161ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #3
Day Hour Count Duration Avg duration Nov 30 05 1 25s998ms 25s998ms 17 1 34s291ms 34s291ms Dec 01 05 1 39s78ms 39s78ms 17 1 34s774ms 34s774ms Dec 02 05 1 37s33ms 37s33ms 17 1 24s124ms 24s124ms Dec 03 17 1 37s617ms 37s617ms Dec 04 05 1 24s172ms 24s172ms 17 1 1s598ms 1s598ms Dec 05 05 1 34s962ms 34s962ms 17 1 36s649ms 36s649ms Dec 06 05 1 26s491ms 26s491ms 17 1 35s305ms 35s305ms [ User: tng_migration_user - Total duration: 6m32s - Times executed: 13 ]
[ Application: dbt - Total duration: 6m32s - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__23"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( -- suject (proband) patrici do kohorty ..., Pilot ID: 23 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 23 -- Pilot ID );
Date: 2025-12-01 05:02:59 Duration: 39s78ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__23"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( -- suject (proband) patrici do kohorty ..., Pilot ID: 23 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 23 -- Pilot ID );
Date: 2025-12-03 17:02:58 Duration: 37s617ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__23"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( -- suject (proband) patrici do kohorty ..., Pilot ID: 23 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 23 -- Pilot ID );
Date: 2025-12-02 05:02:56 Duration: 37s33ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
4 2m3s 891 113ms 694ms 138ms refresh materialized view core.mv_subject_event with data;Times Reported Time consuming queries #4
Day Hour Count Duration Avg duration Nov 30 06 7 1s113ms 159ms 07 7 1s317ms 188ms 08 7 917ms 131ms 09 7 979ms 139ms 10 7 881ms 125ms 11 7 1s162ms 166ms 12 7 966ms 138ms 13 7 959ms 137ms 14 7 944ms 134ms 15 7 979ms 139ms 16 7 962ms 137ms 17 7 1s 142ms 18 7 977ms 139ms 19 7 920ms 131ms 20 7 980ms 140ms 21 7 1s263ms 180ms 22 7 931ms 133ms 23 7 992ms 141ms Dec 01 06 7 945ms 135ms 07 7 911ms 130ms 08 7 913ms 130ms 09 7 943ms 134ms 10 7 929ms 132ms 11 7 906ms 129ms 12 7 970ms 138ms 13 7 1s232ms 176ms 14 7 997ms 142ms 15 7 983ms 140ms 16 7 1s285ms 183ms 17 7 985ms 140ms 18 7 926ms 132ms 19 7 937ms 133ms 20 7 909ms 129ms 21 7 930ms 132ms 22 7 949ms 135ms 23 7 928ms 132ms Dec 02 06 7 932ms 133ms 07 7 894ms 127ms 08 7 949ms 135ms 09 7 938ms 134ms 10 8 1s39ms 129ms 11 7 894ms 127ms 12 7 989ms 141ms 13 7 1s55ms 150ms 14 7 969ms 138ms 15 7 991ms 141ms 16 7 990ms 141ms 17 7 897ms 128ms 18 7 893ms 127ms 19 7 884ms 126ms 20 7 1s18ms 145ms 21 7 921ms 131ms 22 7 929ms 132ms 23 7 970ms 138ms Dec 03 06 7 875ms 125ms 07 7 951ms 135ms 08 7 982ms 140ms 09 9 1s257ms 139ms 10 7 939ms 134ms 11 8 1s 125ms 12 7 932ms 133ms 13 7 952ms 136ms 14 7 959ms 137ms 15 8 1s132ms 141ms 16 8 1s17ms 127ms 17 7 890ms 127ms 18 7 1s86ms 155ms 19 7 1s1ms 143ms 20 7 1s35ms 147ms 21 7 911ms 130ms 22 7 889ms 127ms 23 7 907ms 129ms Dec 04 06 7 1s26ms 146ms 07 7 914ms 130ms 08 7 987ms 141ms 09 7 947ms 135ms 10 7 940ms 134ms 11 7 1s67ms 152ms 12 7 943ms 134ms 13 8 1s23ms 127ms 14 7 989ms 141ms 15 7 904ms 129ms 16 7 1s112ms 158ms 17 7 939ms 134ms 18 7 954ms 136ms 19 7 1s520ms 217ms 20 7 895ms 127ms 21 7 866ms 123ms 22 7 959ms 137ms 23 7 946ms 135ms Dec 05 06 7 1s248ms 178ms 07 8 1s73ms 134ms 08 7 953ms 136ms 09 7 1s78ms 154ms 10 7 1s284ms 183ms 11 7 1s118ms 159ms 12 7 959ms 137ms 13 8 1s56ms 132ms 14 7 956ms 136ms 15 7 945ms 135ms 16 7 918ms 131ms 17 7 849ms 121ms 18 7 881ms 125ms 19 7 897ms 128ms 20 7 922ms 131ms 21 7 968ms 138ms 22 7 945ms 135ms 23 7 950ms 135ms Dec 06 06 7 887ms 126ms 07 7 889ms 127ms 08 7 942ms 134ms 09 7 939ms 134ms 10 7 880ms 125ms 11 7 902ms 128ms 12 7 960ms 137ms 13 7 878ms 125ms 14 7 918ms 131ms 15 7 942ms 134ms 16 7 1s174ms 167ms 17 7 922ms 131ms 18 7 874ms 124ms 19 7 874ms 124ms 20 7 911ms 130ms 21 7 890ms 127ms 22 7 886ms 126ms 23 7 993ms 141ms [ User: tng_migration_user - Total duration: 2m3s - Times executed: 891 ]
[ Application: [unknown] - Total duration: 2m3s - Times executed: 891 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-12-04 19:32:02 Duration: 694ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-30 07:14:02 Duration: 495ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-30 21:05:02 Duration: 477ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
5 1m26s 154,674 0ms 4ms 0ms select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.subject_subcohort_id as subject_subcohort_id_11, m0_.form_structure_variant_id as form_structure_variant_id_12, m0_.form_id as form_id_13, m0_.form_state_code as form_state_code_14 from core.mv_subject_form m0_ where m0_.form_structure_variant_id in (...) and m0_.form_id is null and m0_.result_date <= ? and m0_.use_alternative <> ?;Times Reported Time consuming queries #5
Day Hour Count Duration Avg duration Nov 30 05 1,170 636ms 0ms 06 1,170 642ms 0ms 07 1,170 658ms 0ms 08 1,170 668ms 0ms 09 1,170 654ms 0ms 10 1,170 646ms 0ms 11 1,170 670ms 0ms 12 1,170 680ms 0ms 13 1,170 651ms 0ms 14 1,170 627ms 0ms 15 1,170 644ms 0ms 16 1,170 655ms 0ms 17 1,053 587ms 0ms 18 1,170 648ms 0ms 19 1,170 634ms 0ms 20 1,170 644ms 0ms 21 1,170 627ms 0ms 22 1,170 651ms 0ms 23 1,170 623ms 0ms Dec 01 05 1,053 578ms 0ms 06 1,170 660ms 0ms 07 1,170 687ms 0ms 08 1,170 674ms 0ms 09 1,170 658ms 0ms 10 1,170 645ms 0ms 11 1,170 671ms 0ms 12 1,170 644ms 0ms 13 1,170 649ms 0ms 14 1,170 666ms 0ms 15 1,170 660ms 0ms 16 1,170 661ms 0ms 17 1,053 608ms 0ms 18 1,170 655ms 0ms 19 1,170 658ms 0ms 20 1,170 658ms 0ms 21 1,170 663ms 0ms 22 1,170 664ms 0ms 23 1,170 661ms 0ms Dec 02 05 1,053 573ms 0ms 06 1,170 635ms 0ms 07 1,170 641ms 0ms 08 1,170 679ms 0ms 09 1,170 665ms 0ms 10 1,170 696ms 0ms 11 1,170 668ms 0ms 12 1,170 651ms 0ms 13 1,170 654ms 0ms 14 1,170 640ms 0ms 15 1,170 643ms 0ms 16 1,170 704ms 0ms 17 1,170 647ms 0ms 18 1,170 651ms 0ms 19 1,170 640ms 0ms 20 1,170 625ms 0ms 21 1,170 635ms 0ms 22 1,170 664ms 0ms 23 1,170 685ms 0ms Dec 03 05 1,170 652ms 0ms 06 1,170 669ms 0ms 07 1,170 652ms 0ms 08 1,170 667ms 0ms 09 1,170 632ms 0ms 10 1,170 667ms 0ms 11 1,170 668ms 0ms 12 1,170 690ms 0ms 13 1,170 651ms 0ms 14 1,170 646ms 0ms 15 1,170 640ms 0ms 16 1,170 681ms 0ms 17 1,053 583ms 0ms 18 1,170 674ms 0ms 19 1,170 625ms 0ms 20 1,170 639ms 0ms 21 1,170 629ms 0ms 22 1,170 646ms 0ms 23 1,170 657ms 0ms Dec 04 05 1,170 632ms 0ms 06 1,170 698ms 0ms 07 1,170 665ms 0ms 08 1,170 650ms 0ms 09 1,170 668ms 0ms 10 1,170 657ms 0ms 11 1,170 673ms 0ms 12 1,170 679ms 0ms 13 1,170 658ms 0ms 14 1,170 674ms 0ms 15 1,170 680ms 0ms 16 1,170 689ms 0ms 17 1,170 636ms 0ms 18 1,170 649ms 0ms 19 1,170 638ms 0ms 20 1,170 667ms 0ms 21 1,170 652ms 0ms 22 1,170 666ms 0ms 23 1,170 689ms 0ms Dec 05 05 1,053 600ms 0ms 06 1,170 659ms 0ms 07 1,170 642ms 0ms 08 1,170 661ms 0ms 09 1,170 638ms 0ms 10 1,170 647ms 0ms 11 1,170 645ms 0ms 12 1,170 651ms 0ms 13 1,170 638ms 0ms 14 1,170 645ms 0ms 15 1,170 663ms 0ms 16 1,170 655ms 0ms 17 1,053 585ms 0ms 18 1,170 664ms 0ms 19 1,170 667ms 0ms 20 1,170 652ms 0ms 21 1,170 670ms 0ms 22 1,170 663ms 0ms 23 1,170 652ms 0ms Dec 06 05 1,170 642ms 0ms 06 1,170 643ms 0ms 07 1,170 642ms 0ms 08 1,170 646ms 0ms 09 1,170 647ms 0ms 10 1,170 680ms 0ms 11 1,170 655ms 0ms 12 1,170 650ms 0ms 13 1,170 641ms 0ms 14 1,170 653ms 0ms 15 1,170 647ms 0ms 16 1,170 637ms 0ms 17 1,053 584ms 0ms 18 1,170 659ms 0ms 19 1,170 661ms 0ms 20 1,170 647ms 0ms 21 1,170 679ms 0ms 22 1,170 658ms 0ms 23 1,170 655ms 0ms [ User: tng_migration_user - Total duration: 1m26s - Times executed: 154674 ]
[ Application: [unknown] - Total duration: 1m26s - Times executed: 154674 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('82') AND m0_.form_id IS NULL AND m0_.result_date <= '2021-12-17 09:00:01' AND m0_.use_alternative <> 't';
Date: 2025-12-01 09:00:03 Duration: 4ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('83') AND m0_.form_id IS NULL AND m0_.result_date <= '2020-12-20 14:54:01' AND m0_.use_alternative <> 't';
Date: 2025-12-04 14:54:03 Duration: 4ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('86') AND m0_.form_id IS NULL AND m0_.result_date <= '2021-12-20 16:06:01' AND m0_.use_alternative <> 't';
Date: 2025-12-04 16:06:03 Duration: 4ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
6 1m24s 1,040 30ms 275ms 81ms with values as ( select label as value from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? group by label order by ? ) select value from values;Times Reported Time consuming queries #6
Day Hour Count Duration Avg duration Nov 30 05 80 6s723ms 84ms 17 80 6s824ms 85ms Dec 01 05 80 6s608ms 82ms 17 80 6s445ms 80ms Dec 02 05 80 6s520ms 81ms 17 80 6s856ms 85ms Dec 03 17 80 6s376ms 79ms Dec 04 05 80 6s408ms 80ms 17 80 6s137ms 76ms Dec 05 05 80 6s672ms 83ms 17 80 6s595ms 82ms Dec 06 05 80 6s356ms 79ms 17 80 6s234ms 77ms [ User: tng_migration_user - Total duration: 1m24s - Times executed: 1040 ]
[ Application: dbt - Total duration: 1m24s - Times executed: 1040 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-12-02 05:02:23 Duration: 275ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-12-02 17:02:23 Duration: 263ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-12-05 17:02:24 Duration: 256ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
7 1m17s 1,014 30ms 272ms 76ms with values as ( select label as value from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? group by label order by ? ) select value from values;Times Reported Time consuming queries #7
Day Hour Count Duration Avg duration Nov 30 05 78 5s536ms 70ms 17 78 6s311ms 80ms Dec 01 05 78 5s968ms 76ms 17 78 6s172ms 79ms Dec 02 05 78 6s1ms 76ms 17 78 6s187ms 79ms Dec 03 17 78 6s73ms 77ms Dec 04 05 78 5s668ms 72ms 17 78 5s589ms 71ms Dec 05 05 78 6s29ms 77ms 17 78 5s860ms 75ms Dec 06 05 78 5s973ms 76ms 17 78 5s844ms 74ms [ User: tng_migration_user - Total duration: 1m17s - Times executed: 1014 ]
[ Application: dbt - Total duration: 1m17s - Times executed: 1014 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-30 17:02:23 Duration: 272ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-12-01 17:02:25 Duration: 217ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__15"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 15 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-12-04 05:02:21 Duration: 203ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
8 1m12s 1 1m12s 1m12s 1m12s copy core.notif (id, subject_id, notif_template_id, notif_state_code, subject, content, other_side_id, created_at, is_archived, processed_time, owner_user_id, owner_group_id, notif_type_code, is_attachments, external_id, updated_at, addressee) to stdout;Times Reported Time consuming queries #8
Day Hour Count Duration Avg duration Dec 03 18 1 1m12s 1m12s [ User: bilik - Total duration: 1m12s - Times executed: 1 ]
[ Application: pg_dump - Total duration: 1m12s - Times executed: 1 ]
-
COPY core.notif (id, subject_id, notif_template_id, notif_state_code, subject, content, other_side_id, created_at, is_archived, processed_time, owner_user_id, owner_group_id, notif_type_code, is_attachments, external_id, updated_at, addressee) TO stdout;
Date: 2025-12-03 18:53:30 Duration: 1m12s Database: celspac User: bilik Remote: [local] Application: pg_dump Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
9 1m5s 13 4s243ms 5s836ms 5s10ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #9
Day Hour Count Duration Avg duration Nov 30 05 1 4s774ms 4s774ms 17 1 5s369ms 5s369ms Dec 01 05 1 5s236ms 5s236ms 17 1 5s207ms 5s207ms Dec 02 05 1 5s292ms 5s292ms 17 1 4s642ms 4s642ms Dec 03 17 1 5s258ms 5s258ms Dec 04 05 1 4s243ms 4s243ms 17 1 4s439ms 4s439ms Dec 05 05 1 4s885ms 4s885ms 17 1 5s246ms 5s246ms Dec 06 05 1 4s703ms 4s703ms 17 1 5s836ms 5s836ms [ User: tng_migration_user - Total duration: 1m5s - Times executed: 13 ]
[ Application: dbt - Total duration: 1m5s - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__27"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... HAPIEE Pilot II, Pilot ID: 27 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_dl_hapiee'), ('hapiee_p02_ic_dl_statistics'), ('hapiee_p02_ic_examination'), ('hapiee_p02_ic_health_qs'), ('hapiee_p02_ic_samples_storage') $$ ) AS extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 27 -- Pilot ID );
Date: 2025-12-06 17:02:33 Duration: 5s836ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__27"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... HAPIEE Pilot II, Pilot ID: 27 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_dl_hapiee'), ('hapiee_p02_ic_dl_statistics'), ('hapiee_p02_ic_examination'), ('hapiee_p02_ic_health_qs'), ('hapiee_p02_ic_samples_storage') $$ ) AS extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 27 -- Pilot ID );
Date: 2025-11-30 17:02:33 Duration: 5s369ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__27"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... HAPIEE Pilot II, Pilot ID: 27 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_dl_hapiee'), ('hapiee_p02_ic_dl_statistics'), ('hapiee_p02_ic_examination'), ('hapiee_p02_ic_health_qs'), ('hapiee_p02_ic_samples_storage') $$ ) AS extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 27 -- Pilot ID );
Date: 2025-12-02 05:02:34 Duration: 5s292ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
10 1m1s 13 4s134ms 5s930ms 4s761ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__26__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "tng_p13__role" text, "tng_p13_monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "tng_p13__state" text, "tng_p13_monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as activity ("subject_id" int, "tng_p13__activity_state" text, "tng_p13_monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as created_at ("subject_id" int, "tng_p13__created_at" text, "tng_p13_monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as accepted_at ("subject_id" int, "tng_p13__accepted_at" text, "tng_p13_monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as cancelled_at ("subject_id" int, "tng_p13__cancelled_at" text, "tng_p13_monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as revoked_at ("subject_id" int, "tng_p13__revoked_at" text, "tng_p13_monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as paused_at ("subject_id" int, "tng_p13__paused_at" text, "tng_p13_monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "tng_p13_ic_buccal_swab_child" text, "tng_p13_ic_buccal_swab_mother" text, "tng_p13_ic_cord_blood_child" text, "tng_p13_ic_drop_blood_child" text, "tng_p13_ic_stool_child" text, "tng_p13_ic_urine_mother" text, "tng_p13_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as extra_state ("subject_id" int, "tng_p13_ic_celspac_newsletter" text, "tng_p13_ic_dl_celpac_studies" text, "tng_p13_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.tng_p13__role, psc_role.tng_p13_monitor__role, psc_state.tng_p13__state, psc_state.tng_p13_monitor__state, psc_activity_state.tng_p13__activity_state, psc_activity_state.tng_p13_monitor__activity_state, psc_created_at.tng_p13__created_at, psc_created_at.tng_p13_monitor__created_at, psc_accepted_at.tng_p13__accepted_at, psc_accepted_at.tng_p13_monitor__accepted_at, psc_cancelled_at.tng_p13__cancelled_at, psc_cancelled_at.tng_p13_monitor__cancelled_at, psc_revoked_at.tng_p13__revoked_at, psc_revoked_at.tng_p13_monitor__revoked_at, psc_paused_at.tng_p13__paused_at, psc_paused_at.tng_p13_monitor__paused_at, tng_p13_ic_buccal_swab_child, tng_p13_ic_buccal_swab_mother, tng_p13_ic_cord_blood_child, tng_p13_ic_drop_blood_child, tng_p13_ic_stool_child, tng_p13_ic_urine_mother, tng_p13_ic_venous_blood_mother, tng_p13_ic_celspac_newsletter, tng_p13_ic_dl_celpac_studies, tng_p13_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #10
Day Hour Count Duration Avg duration Nov 30 05 1 4s190ms 4s190ms 17 1 4s901ms 4s901ms Dec 01 05 1 4s777ms 4s777ms 17 1 5s194ms 5s194ms Dec 02 05 1 4s948ms 4s948ms 17 1 4s134ms 4s134ms Dec 03 17 1 4s821ms 4s821ms Dec 04 05 1 4s236ms 4s236ms 17 1 4s396ms 4s396ms Dec 05 05 1 4s779ms 4s779ms 17 1 5s437ms 5s437ms Dec 06 05 1 4s154ms 4s154ms 17 1 5s930ms 5s930ms [ User: tng_migration_user - Total duration: 1m1s - Times executed: 13 ]
[ Application: dbt - Total duration: 1m1s - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__26"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__26__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... TNG Pilot XIII, Pilot ID: 26 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__role" text, "tng_p13_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__state" text, "tng_p13_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS activity ("subject_id" int, "tng_p13__activity_state" text, "tng_p13_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS created_at ("subject_id" int, "tng_p13__created_at" text, "tng_p13_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p13__accepted_at" text, "tng_p13_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p13__cancelled_at" text, "tng_p13_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p13__revoked_at" text, "tng_p13_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p13__paused_at" text, "tng_p13_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_buccal_swab_child'), ('tng_p13_ic_buccal_swab_mother'), ('tng_p13_ic_cord_blood_child'), ('tng_p13_ic_drop_blood_child'), ('tng_p13_ic_stool_child'), ('tng_p13_ic_urine_mother'), ('tng_p13_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p13_ic_buccal_swab_child" text, "tng_p13_ic_buccal_swab_mother" text, "tng_p13_ic_cord_blood_child" text, "tng_p13_ic_drop_blood_child" text, "tng_p13_ic_stool_child" text, "tng_p13_ic_urine_mother" text, "tng_p13_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_celspac_newsletter'), ('tng_p13_ic_dl_celpac_studies'), ('tng_p13_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p13_ic_celspac_newsletter" text, "tng_p13_ic_dl_celpac_studies" text, "tng_p13_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p13__role, psc_role.tng_p13_monitor__role, psc_state.tng_p13__state, psc_state.tng_p13_monitor__state, psc_activity_state.tng_p13__activity_state, psc_activity_state.tng_p13_monitor__activity_state, psc_created_at.tng_p13__created_at, psc_created_at.tng_p13_monitor__created_at, psc_accepted_at.tng_p13__accepted_at, psc_accepted_at.tng_p13_monitor__accepted_at, psc_cancelled_at.tng_p13__cancelled_at, psc_cancelled_at.tng_p13_monitor__cancelled_at, psc_revoked_at.tng_p13__revoked_at, psc_revoked_at.tng_p13_monitor__revoked_at, psc_paused_at.tng_p13__paused_at, psc_paused_at.tng_p13_monitor__paused_at, tng_p13_ic_buccal_swab_child, tng_p13_ic_buccal_swab_mother, tng_p13_ic_cord_blood_child, tng_p13_ic_drop_blood_child, tng_p13_ic_stool_child, tng_p13_ic_urine_mother, tng_p13_ic_venous_blood_mother, tng_p13_ic_celspac_newsletter, tng_p13_ic_dl_celpac_studies, tng_p13_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 26 -- Pilot ID );
Date: 2025-12-06 17:02:33 Duration: 5s930ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__26"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__26__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... TNG Pilot XIII, Pilot ID: 26 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__role" text, "tng_p13_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__state" text, "tng_p13_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS activity ("subject_id" int, "tng_p13__activity_state" text, "tng_p13_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS created_at ("subject_id" int, "tng_p13__created_at" text, "tng_p13_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p13__accepted_at" text, "tng_p13_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p13__cancelled_at" text, "tng_p13_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p13__revoked_at" text, "tng_p13_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p13__paused_at" text, "tng_p13_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_buccal_swab_child'), ('tng_p13_ic_buccal_swab_mother'), ('tng_p13_ic_cord_blood_child'), ('tng_p13_ic_drop_blood_child'), ('tng_p13_ic_stool_child'), ('tng_p13_ic_urine_mother'), ('tng_p13_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p13_ic_buccal_swab_child" text, "tng_p13_ic_buccal_swab_mother" text, "tng_p13_ic_cord_blood_child" text, "tng_p13_ic_drop_blood_child" text, "tng_p13_ic_stool_child" text, "tng_p13_ic_urine_mother" text, "tng_p13_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_celspac_newsletter'), ('tng_p13_ic_dl_celpac_studies'), ('tng_p13_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p13_ic_celspac_newsletter" text, "tng_p13_ic_dl_celpac_studies" text, "tng_p13_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p13__role, psc_role.tng_p13_monitor__role, psc_state.tng_p13__state, psc_state.tng_p13_monitor__state, psc_activity_state.tng_p13__activity_state, psc_activity_state.tng_p13_monitor__activity_state, psc_created_at.tng_p13__created_at, psc_created_at.tng_p13_monitor__created_at, psc_accepted_at.tng_p13__accepted_at, psc_accepted_at.tng_p13_monitor__accepted_at, psc_cancelled_at.tng_p13__cancelled_at, psc_cancelled_at.tng_p13_monitor__cancelled_at, psc_revoked_at.tng_p13__revoked_at, psc_revoked_at.tng_p13_monitor__revoked_at, psc_paused_at.tng_p13__paused_at, psc_paused_at.tng_p13_monitor__paused_at, tng_p13_ic_buccal_swab_child, tng_p13_ic_buccal_swab_mother, tng_p13_ic_cord_blood_child, tng_p13_ic_drop_blood_child, tng_p13_ic_stool_child, tng_p13_ic_urine_mother, tng_p13_ic_venous_blood_mother, tng_p13_ic_celspac_newsletter, tng_p13_ic_dl_celpac_studies, tng_p13_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 26 -- Pilot ID );
Date: 2025-12-05 17:02:34 Duration: 5s437ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__26"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__26__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... TNG Pilot XIII, Pilot ID: 26 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__role" text, "tng_p13_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__state" text, "tng_p13_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS activity ("subject_id" int, "tng_p13__activity_state" text, "tng_p13_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS created_at ("subject_id" int, "tng_p13__created_at" text, "tng_p13_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p13__accepted_at" text, "tng_p13_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p13__cancelled_at" text, "tng_p13_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p13__revoked_at" text, "tng_p13_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p13__paused_at" text, "tng_p13_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_buccal_swab_child'), ('tng_p13_ic_buccal_swab_mother'), ('tng_p13_ic_cord_blood_child'), ('tng_p13_ic_drop_blood_child'), ('tng_p13_ic_stool_child'), ('tng_p13_ic_urine_mother'), ('tng_p13_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p13_ic_buccal_swab_child" text, "tng_p13_ic_buccal_swab_mother" text, "tng_p13_ic_cord_blood_child" text, "tng_p13_ic_drop_blood_child" text, "tng_p13_ic_stool_child" text, "tng_p13_ic_urine_mother" text, "tng_p13_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_celspac_newsletter'), ('tng_p13_ic_dl_celpac_studies'), ('tng_p13_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p13_ic_celspac_newsletter" text, "tng_p13_ic_dl_celpac_studies" text, "tng_p13_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p13__role, psc_role.tng_p13_monitor__role, psc_state.tng_p13__state, psc_state.tng_p13_monitor__state, psc_activity_state.tng_p13__activity_state, psc_activity_state.tng_p13_monitor__activity_state, psc_created_at.tng_p13__created_at, psc_created_at.tng_p13_monitor__created_at, psc_accepted_at.tng_p13__accepted_at, psc_accepted_at.tng_p13_monitor__accepted_at, psc_cancelled_at.tng_p13__cancelled_at, psc_cancelled_at.tng_p13_monitor__cancelled_at, psc_revoked_at.tng_p13__revoked_at, psc_revoked_at.tng_p13_monitor__revoked_at, psc_paused_at.tng_p13__paused_at, psc_paused_at.tng_p13_monitor__paused_at, tng_p13_ic_buccal_swab_child, tng_p13_ic_buccal_swab_mother, tng_p13_ic_cord_blood_child, tng_p13_ic_drop_blood_child, tng_p13_ic_stool_child, tng_p13_ic_urine_mother, tng_p13_ic_venous_blood_mother, tng_p13_ic_celspac_newsletter, tng_p13_ic_dl_celpac_studies, tng_p13_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 26 -- Pilot ID );
Date: 2025-12-01 17:02:34 Duration: 5s194ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
11 38s73ms 23,512 0ms 1s205ms 1ms commit;Times Reported Time consuming queries #11
Day Hour Count Duration Avg duration Nov 30 00 103 237ms 2ms 05 650 1s364ms 2ms 06 343 346ms 1ms 07 118 101ms 0ms 08 106 91ms 0ms 09 107 117ms 1ms 10 107 149ms 1ms 11 114 245ms 2ms 12 108 158ms 1ms 13 120 179ms 1ms 14 119 200ms 1ms 15 137 192ms 1ms 16 104 159ms 1ms 17 142 1s152ms 8ms 18 113 128ms 1ms 19 108 95ms 0ms 20 104 105ms 1ms 21 106 146ms 1ms 22 119 109ms 0ms 23 104 125ms 1ms Dec 01 00 100 200ms 2ms 05 470 991ms 2ms 06 381 343ms 0ms 07 122 125ms 1ms 08 137 143ms 1ms 09 284 315ms 1ms 10 167 178ms 1ms 11 115 136ms 1ms 12 126 122ms 0ms 13 141 139ms 0ms 14 164 229ms 1ms 15 117 117ms 1ms 16 147 175ms 1ms 17 142 781ms 5ms 18 333 306ms 0ms 19 136 172ms 1ms 20 138 198ms 1ms 21 122 123ms 1ms 22 111 126ms 1ms 23 128 145ms 1ms Dec 02 00 100 184ms 1ms 02 1 0ms 0ms 03 4 3ms 0ms 05 613 1s819ms 2ms 06 384 354ms 0ms 07 130 135ms 1ms 08 164 159ms 0ms 09 173 180ms 1ms 10 157 174ms 1ms 11 123 122ms 0ms 12 145 149ms 1ms 13 132 163ms 1ms 14 130 151ms 1ms 15 132 138ms 1ms 16 128 142ms 1ms 17 168 561ms 3ms 18 123 126ms 1ms 19 104 101ms 0ms 20 104 121ms 1ms 21 116 139ms 1ms 22 104 123ms 1ms 23 110 125ms 1ms Dec 03 00 100 152ms 1ms 02 7 11ms 1ms 05 548 980ms 1ms 06 362 315ms 0ms 07 203 199ms 0ms 08 168 191ms 1ms 09 323 339ms 1ms 10 227 218ms 0ms 11 176 190ms 1ms 12 174 186ms 1ms 13 168 167ms 0ms 14 163 194ms 1ms 15 143 135ms 0ms 16 131 154ms 1ms 17 153 1s933ms 12ms 18 114 133ms 1ms 19 115 128ms 1ms 20 119 139ms 1ms 21 104 128ms 1ms 22 124 125ms 1ms 23 132 132ms 1ms Dec 04 00 100 224ms 2ms 05 639 1s205ms 1ms 06 395 376ms 0ms 07 106 100ms 0ms 08 223 235ms 1ms 09 172 198ms 1ms 10 170 250ms 1ms 11 136 191ms 1ms 12 144 181ms 1ms 13 149 176ms 1ms 14 148 172ms 1ms 15 125 134ms 1ms 16 148 205ms 1ms 17 147 1s845ms 12ms 18 111 118ms 1ms 19 104 121ms 1ms 20 104 127ms 1ms 21 111 135ms 1ms 22 104 135ms 1ms 23 121 124ms 1ms Dec 05 00 103 197ms 1ms 05 619 1s158ms 1ms 06 388 351ms 0ms 07 134 157ms 1ms 08 118 125ms 1ms 09 125 179ms 1ms 10 185 545ms 2ms 11 154 168ms 1ms 12 140 171ms 1ms 13 125 117ms 0ms 14 111 119ms 1ms 15 111 112ms 1ms 16 104 120ms 1ms 17 149 825ms 5ms 18 120 127ms 1ms 19 122 125ms 1ms 20 110 118ms 1ms 21 104 144ms 1ms 22 104 126ms 1ms 23 112 117ms 1ms Dec 06 00 103 259ms 2ms 05 648 1s13ms 1ms 06 413 381ms 0ms 07 104 97ms 0ms 08 115 104ms 0ms 09 110 102ms 0ms 10 107 97ms 0ms 11 107 95ms 0ms 12 113 111ms 0ms 13 111 98ms 0ms 14 114 113ms 0ms 15 104 190ms 1ms 16 104 315ms 3ms 17 152 1s177ms 7ms 18 130 135ms 1ms 19 112 108ms 0ms 20 113 112ms 0ms 21 111 119ms 1ms 22 111 113ms 1ms 23 123 130ms 1ms [ User: tng_migration_user - Total duration: 38s73ms - Times executed: 23512 ]
[ Application: [unknown] - Total duration: 27s948ms - Times executed: 22888 ]
[ Application: dbt - Total duration: 10s125ms - Times executed: 624 ]
-
COMMIT;
Date: 2025-12-04 17:02:21 Duration: 1s205ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
COMMIT;
Date: 2025-12-06 17:02:28 Duration: 704ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
-
COMMIT;
Date: 2025-12-02 05:02:23 Duration: 630ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
12 35s859ms 13 1s794ms 3s360ms 2s758ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #12
Day Hour Count Duration Avg duration Nov 30 05 1 2s301ms 2s301ms 17 1 3s259ms 3s259ms Dec 01 05 1 3s116ms 3s116ms 17 1 3s155ms 3s155ms Dec 02 05 1 3s180ms 3s180ms 17 1 1s970ms 1s970ms Dec 03 17 1 3s360ms 3s360ms Dec 04 05 1 1s794ms 1s794ms 17 1 2s553ms 2s553ms Dec 05 05 1 2s946ms 2s946ms 17 1 2s979ms 2s979ms Dec 06 05 1 2s104ms 2s104ms 17 1 3s136ms 3s136ms [ User: tng_migration_user - Total duration: 35s859ms - Times executed: 13 ]
[ Application: dbt - Total duration: 35s859ms - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__17"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot X, Pilot ID: 17 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dust_mother'), ('tng_p10_ic_buccal_swab_child'), ('tng_p10_ic_buccal_swab_mother'), ('tng_p10_ic_cord_blood_mother'), ('tng_p10_ic_drop_blood_child'), ('tng_p10_ic_stool_child'), ('tng_p10_ic_urine_mother'), ('tng_p10_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dl_celpac_studies'), ('dust_p01_tng_p10_ic_survey'), ('tng_p10_ic_follow_up_studies'), ('tng_p10_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 17 -- Pilot ID );
Date: 2025-12-03 17:02:27 Duration: 3s360ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__17"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot X, Pilot ID: 17 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dust_mother'), ('tng_p10_ic_buccal_swab_child'), ('tng_p10_ic_buccal_swab_mother'), ('tng_p10_ic_cord_blood_mother'), ('tng_p10_ic_drop_blood_child'), ('tng_p10_ic_stool_child'), ('tng_p10_ic_urine_mother'), ('tng_p10_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dl_celpac_studies'), ('dust_p01_tng_p10_ic_survey'), ('tng_p10_ic_follow_up_studies'), ('tng_p10_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 17 -- Pilot ID );
Date: 2025-11-30 17:02:24 Duration: 3s259ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__17"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot X, Pilot ID: 17 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dust_mother'), ('tng_p10_ic_buccal_swab_child'), ('tng_p10_ic_buccal_swab_mother'), ('tng_p10_ic_cord_blood_mother'), ('tng_p10_ic_drop_blood_child'), ('tng_p10_ic_stool_child'), ('tng_p10_ic_urine_mother'), ('tng_p10_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dl_celpac_studies'), ('dust_p01_tng_p10_ic_survey'), ('tng_p10_ic_follow_up_studies'), ('tng_p10_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 17 -- Pilot ID );
Date: 2025-12-02 05:02:25 Duration: 3s180ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
13 31s410ms 13 893ms 12s17ms 2s416ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__21__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p03__role" text, "psycap_p02_new_ya_p03__role" text, "psycap_p02_old_ya_p03__role" text, "ya_p03__role" text, "ya_p03_digi_ya03v2__role" text, "ya_p03_digi_ya04v2__role" text, "ya_p03_digi_ya05v2__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p03__state" text, "psycap_p02_new_ya_p03__state" text, "psycap_p02_old_ya_p03__state" text, "ya_p03__state" text, "ya_p03_digi_ya03v2__state" text, "ya_p03_digi_ya04v2__state" text, "ya_p03_digi_ya05v2__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "psycap_p01_ya_p03__activity_state" text, "psycap_p02_new_ya_p03__activity_state" text, "psycap_p02_old_ya_p03__activity_state" text, "ya_p03__activity_state" text, "ya_p03_digi_ya03v2__activity_state" text, "ya_p03_digi_ya04v2__activity_state" text, "ya_p03_digi_ya05v2__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "psycap_p01_ya_p03__created_at" text, "psycap_p02_new_ya_p03__created_at" text, "psycap_p02_old_ya_p03__created_at" text, "ya_p03__created_at" text, "ya_p03_digi_ya03v2__created_at" text, "ya_p03_digi_ya04v2__created_at" text, "ya_p03_digi_ya05v2__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "psycap_p01_ya_p03__accepted_at" text, "psycap_p02_new_ya_p03__accepted_at" text, "psycap_p02_old_ya_p03__accepted_at" text, "ya_p03__accepted_at" text, "ya_p03_digi_ya03v2__accepted_at" text, "ya_p03_digi_ya04v2__accepted_at" text, "ya_p03_digi_ya05v2__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "psycap_p01_ya_p03__cancelled_at" text, "psycap_p02_new_ya_p03__cancelled_at" text, "psycap_p02_old_ya_p03__cancelled_at" text, "ya_p03__cancelled_at" text, "ya_p03_digi_ya03v2__cancelled_at" text, "ya_p03_digi_ya04v2__cancelled_at" text, "ya_p03_digi_ya05v2__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "psycap_p01_ya_p03__revoked_at" text, "psycap_p02_new_ya_p03__revoked_at" text, "psycap_p02_old_ya_p03__revoked_at" text, "ya_p03__revoked_at" text, "ya_p03_digi_ya03v2__revoked_at" text, "ya_p03_digi_ya04v2__revoked_at" text, "ya_p03_digi_ya05v2__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "psycap_p01_ya_p03__paused_at" text, "psycap_p02_new_ya_p03__paused_at" text, "psycap_p02_old_ya_p03__paused_at" text, "ya_p03__paused_at" text, "ya_p03_digi_ya03v2__paused_at" text, "ya_p03_digi_ya04v2__paused_at" text, "ya_p03_digi_ya05v2__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "ya_p03_ic_buccal_swab_proband" text, "ya_p03_ic_urine_proband" text, "ya_p03_ic_venous_blood_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "ya_p03_ic_anam_qs" text, "ya_p03_ic_aneurysm" text, "ya_p03_ic_anthropometry" text, "ya_p03_ic_arch_foot" text, "ya_p03_ic_basic_qs" text, "ya_p03_ic_blood_pressure" text, "ya_p03_ic_braces_piercing_iud" text, "ya_p03_ic_cognition_test" text, "ya_p03_ic_da_health_registry" text, "ya_p03_ic_dexa" text, "ya_p03_ic_enviro_qs" text, "ya_p03_ic_follow_up_studies" text, "ya_p03_ic_fracture_lower_body_last_3m" text, "ya_p03_ic_fracture_upper_body_last_3m" text, "ya_p03_ic_hand_grip" text, "ya_p03_ic_hearing_vision_impairment" text, "ya_p03_ic_heart_disease" text, "ya_p03_ic_hemoptysis_ns" text, "ya_p03_ic_hernia" text, "ya_p03_ic_hyperthyroidism" text, "ya_p03_ic_inability_hold_pencil" text, "ya_p03_ic_inability_stand_both_legs" text, "ya_p03_ic_inability_talk_cze" text, "ya_p03_ic_inability_walk" text, "ya_p03_ic_inbody" text, "ya_p03_ic_infectious_resp_diseases" text, "ya_p03_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p03_ic_knee_stability" text, "ya_p03_ic_nutri_qs" text, "ya_p03_ic_over_weight_200_height_195" text, "ya_p03_ic_pacemaker_defibrillator" text, "ya_p03_ic_pneumothorax" text, "ya_p03_ic_pregnancy" text, "ya_p03_ic_recent_eye_abdominal_chest_surgery" text, "ya_p03_ic_recent_myocardial_infarction" text, "ya_p03_ic_spirometry" text, "ya_p03_ic_surgical_metal_body" text, "ya_p03_ic_unstable_angina_pectoris" text, "ya_p03_ic_ya_dl_elspac" text, "ya_p03_ic_ya_med_find" text, "ya_p03_ic_ya_newsletter" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.psycap_p01_ya_p03__role, psc_role.psycap_p02_new_ya_p03__role, psc_role.psycap_p02_old_ya_p03__role, psc_role.ya_p03__role, psc_role.ya_p03_digi_ya03v2__role, psc_role.ya_p03_digi_ya04v2__role, psc_role.ya_p03_digi_ya05v2__role, psc_state.psycap_p01_ya_p03__state, psc_state.psycap_p02_new_ya_p03__state, psc_state.psycap_p02_old_ya_p03__state, psc_state.ya_p03__state, psc_state.ya_p03_digi_ya03v2__state, psc_state.ya_p03_digi_ya04v2__state, psc_state.ya_p03_digi_ya05v2__state, psc_activity_state.psycap_p01_ya_p03__activity_state, psc_activity_state.psycap_p02_new_ya_p03__activity_state, psc_activity_state.psycap_p02_old_ya_p03__activity_state, psc_activity_state.ya_p03__activity_state, psc_activity_state.ya_p03_digi_ya03v2__activity_state, psc_activity_state.ya_p03_digi_ya04v2__activity_state, psc_activity_state.ya_p03_digi_ya05v2__activity_state, psc_created_at.psycap_p01_ya_p03__created_at, psc_created_at.psycap_p02_new_ya_p03__created_at, psc_created_at.psycap_p02_old_ya_p03__created_at, psc_created_at.ya_p03__created_at, psc_created_at.ya_p03_digi_ya03v2__created_at, psc_created_at.ya_p03_digi_ya04v2__created_at, psc_created_at.ya_p03_digi_ya05v2__created_at, psc_accepted_at.psycap_p01_ya_p03__accepted_at, psc_accepted_at.psycap_p02_new_ya_p03__accepted_at, psc_accepted_at.psycap_p02_old_ya_p03__accepted_at, psc_accepted_at.ya_p03__accepted_at, psc_accepted_at.ya_p03_digi_ya03v2__accepted_at, psc_accepted_at.ya_p03_digi_ya04v2__accepted_at, psc_accepted_at.ya_p03_digi_ya05v2__accepted_at, psc_cancelled_at.psycap_p01_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_new_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p03__cancelled_at, psc_cancelled_at.ya_p03__cancelled_at, psc_cancelled_at.ya_p03_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya05v2__cancelled_at, psc_revoked_at.psycap_p01_ya_p03__revoked_at, psc_revoked_at.psycap_p02_new_ya_p03__revoked_at, psc_revoked_at.psycap_p02_old_ya_p03__revoked_at, psc_revoked_at.ya_p03__revoked_at, psc_revoked_at.ya_p03_digi_ya03v2__revoked_at, psc_revoked_at.ya_p03_digi_ya04v2__revoked_at, psc_revoked_at.ya_p03_digi_ya05v2__revoked_at, psc_paused_at.psycap_p01_ya_p03__paused_at, psc_paused_at.psycap_p02_new_ya_p03__paused_at, psc_paused_at.psycap_p02_old_ya_p03__paused_at, psc_paused_at.ya_p03__paused_at, psc_paused_at.ya_p03_digi_ya03v2__paused_at, psc_paused_at.ya_p03_digi_ya04v2__paused_at, psc_paused_at.ya_p03_digi_ya05v2__paused_at, ya_p03_ic_buccal_swab_proband, ya_p03_ic_urine_proband, ya_p03_ic_venous_blood_proband, ya_p03_ic_anam_qs, ya_p03_ic_aneurysm, ya_p03_ic_anthropometry, ya_p03_ic_arch_foot, ya_p03_ic_basic_qs, ya_p03_ic_blood_pressure, ya_p03_ic_braces_piercing_iud, ya_p03_ic_cognition_test, ya_p03_ic_da_health_registry, ya_p03_ic_dexa, ya_p03_ic_enviro_qs, ya_p03_ic_follow_up_studies, ya_p03_ic_fracture_lower_body_last_3m, ya_p03_ic_fracture_upper_body_last_3m, ya_p03_ic_hand_grip, ya_p03_ic_hearing_vision_impairment, ya_p03_ic_heart_disease, ya_p03_ic_hemoptysis_ns, ya_p03_ic_hernia, ya_p03_ic_hyperthyroidism, ya_p03_ic_inability_hold_pencil, ya_p03_ic_inability_stand_both_legs, ya_p03_ic_inability_talk_cze, ya_p03_ic_inability_walk, ya_p03_ic_inbody, ya_p03_ic_infectious_resp_diseases, ya_p03_ic_iodine_barium_radioisotopes_last_7d, ya_p03_ic_knee_stability, ya_p03_ic_nutri_qs, ya_p03_ic_over_weight_200_height_195, ya_p03_ic_pacemaker_defibrillator, ya_p03_ic_pneumothorax, ya_p03_ic_pregnancy, ya_p03_ic_recent_eye_abdominal_chest_surgery, ya_p03_ic_recent_myocardial_infarction, ya_p03_ic_spirometry, ya_p03_ic_surgical_metal_body, ya_p03_ic_unstable_angina_pectoris, ya_p03_ic_ya_dl_elspac, ya_p03_ic_ya_med_find, ya_p03_ic_ya_newsletter from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #13
Day Hour Count Duration Avg duration Nov 30 05 1 893ms 893ms 17 1 1s756ms 1s756ms Dec 01 05 1 12s17ms 12s17ms 17 1 1s931ms 1s931ms Dec 02 05 1 1s841ms 1s841ms 17 1 1s477ms 1s477ms Dec 03 17 1 2s157ms 2s157ms Dec 04 05 1 1s389ms 1s389ms 17 1 1s361ms 1s361ms Dec 05 05 1 2s30ms 2s30ms 17 1 1s913ms 1s913ms Dec 06 05 1 925ms 925ms 17 1 1s713ms 1s713ms [ User: tng_migration_user - Total duration: 31s410ms - Times executed: 13 ]
[ Application: dbt - Total duration: 31s410ms - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__21__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: Young Adults, Pilot ID: 21 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__role" text, "psycap_p02_new_ya_p03__role" text, "psycap_p02_old_ya_p03__role" text, "ya_p03__role" text, "ya_p03_digi_ya03v2__role" text, "ya_p03_digi_ya04v2__role" text, "ya_p03_digi_ya05v2__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__state" text, "psycap_p02_new_ya_p03__state" text, "psycap_p02_old_ya_p03__state" text, "ya_p03__state" text, "ya_p03_digi_ya03v2__state" text, "ya_p03_digi_ya04v2__state" text, "ya_p03_digi_ya05v2__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p03__activity_state" text, "psycap_p02_new_ya_p03__activity_state" text, "psycap_p02_old_ya_p03__activity_state" text, "ya_p03__activity_state" text, "ya_p03_digi_ya03v2__activity_state" text, "ya_p03_digi_ya04v2__activity_state" text, "ya_p03_digi_ya05v2__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p03__created_at" text, "psycap_p02_new_ya_p03__created_at" text, "psycap_p02_old_ya_p03__created_at" text, "ya_p03__created_at" text, "ya_p03_digi_ya03v2__created_at" text, "ya_p03_digi_ya04v2__created_at" text, "ya_p03_digi_ya05v2__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p03__accepted_at" text, "psycap_p02_new_ya_p03__accepted_at" text, "psycap_p02_old_ya_p03__accepted_at" text, "ya_p03__accepted_at" text, "ya_p03_digi_ya03v2__accepted_at" text, "ya_p03_digi_ya04v2__accepted_at" text, "ya_p03_digi_ya05v2__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p03__cancelled_at" text, "psycap_p02_new_ya_p03__cancelled_at" text, "psycap_p02_old_ya_p03__cancelled_at" text, "ya_p03__cancelled_at" text, "ya_p03_digi_ya03v2__cancelled_at" text, "ya_p03_digi_ya04v2__cancelled_at" text, "ya_p03_digi_ya05v2__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p03__revoked_at" text, "psycap_p02_new_ya_p03__revoked_at" text, "psycap_p02_old_ya_p03__revoked_at" text, "ya_p03__revoked_at" text, "ya_p03_digi_ya03v2__revoked_at" text, "ya_p03_digi_ya04v2__revoked_at" text, "ya_p03_digi_ya05v2__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p03__paused_at" text, "psycap_p02_new_ya_p03__paused_at" text, "psycap_p02_old_ya_p03__paused_at" text, "ya_p03__paused_at" text, "ya_p03_digi_ya03v2__paused_at" text, "ya_p03_digi_ya04v2__paused_at" text, "ya_p03_digi_ya05v2__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_buccal_swab_proband'), ('ya_p03_ic_urine_proband'), ('ya_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p03_ic_buccal_swab_proband" text, "ya_p03_ic_urine_proband" text, "ya_p03_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_anam_qs'), ('ya_p03_ic_aneurysm'), ('ya_p03_ic_anthropometry'), ('ya_p03_ic_arch_foot'), ('ya_p03_ic_basic_qs'), ('ya_p03_ic_blood_pressure'), ('ya_p03_ic_braces_piercing_iud'), ('ya_p03_ic_cognition_test'), ('ya_p03_ic_da_health_registry'), ('ya_p03_ic_dexa'), ('ya_p03_ic_enviro_qs'), ('ya_p03_ic_follow_up_studies'), ('ya_p03_ic_fracture_lower_body_last_3m'), ('ya_p03_ic_fracture_upper_body_last_3m'), ('ya_p03_ic_hand_grip'), ('ya_p03_ic_hearing_vision_impairment'), ('ya_p03_ic_heart_disease'), ('ya_p03_ic_hemoptysis_ns'), ('ya_p03_ic_hernia'), ('ya_p03_ic_hyperthyroidism'), ('ya_p03_ic_inability_hold_pencil'), ('ya_p03_ic_inability_stand_both_legs'), ('ya_p03_ic_inability_talk_cze'), ('ya_p03_ic_inability_walk'), ('ya_p03_ic_inbody'), ('ya_p03_ic_infectious_resp_diseases'), ('ya_p03_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p03_ic_knee_stability'), ('ya_p03_ic_nutri_qs'), ('ya_p03_ic_over_weight_200_height_195'), ('ya_p03_ic_pacemaker_defibrillator'), ('ya_p03_ic_pneumothorax'), ('ya_p03_ic_pregnancy'), ('ya_p03_ic_recent_eye_abdominal_chest_surgery'), ('ya_p03_ic_recent_myocardial_infarction'), ('ya_p03_ic_spirometry'), ('ya_p03_ic_surgical_metal_body'), ('ya_p03_ic_unstable_angina_pectoris'), ('ya_p03_ic_ya_dl_elspac'), ('ya_p03_ic_ya_med_find'), ('ya_p03_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p03_ic_anam_qs" text, "ya_p03_ic_aneurysm" text, "ya_p03_ic_anthropometry" text, "ya_p03_ic_arch_foot" text, "ya_p03_ic_basic_qs" text, "ya_p03_ic_blood_pressure" text, "ya_p03_ic_braces_piercing_iud" text, "ya_p03_ic_cognition_test" text, "ya_p03_ic_da_health_registry" text, "ya_p03_ic_dexa" text, "ya_p03_ic_enviro_qs" text, "ya_p03_ic_follow_up_studies" text, "ya_p03_ic_fracture_lower_body_last_3m" text, "ya_p03_ic_fracture_upper_body_last_3m" text, "ya_p03_ic_hand_grip" text, "ya_p03_ic_hearing_vision_impairment" text, "ya_p03_ic_heart_disease" text, "ya_p03_ic_hemoptysis_ns" text, "ya_p03_ic_hernia" text, "ya_p03_ic_hyperthyroidism" text, "ya_p03_ic_inability_hold_pencil" text, "ya_p03_ic_inability_stand_both_legs" text, "ya_p03_ic_inability_talk_cze" text, "ya_p03_ic_inability_walk" text, "ya_p03_ic_inbody" text, "ya_p03_ic_infectious_resp_diseases" text, "ya_p03_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p03_ic_knee_stability" text, "ya_p03_ic_nutri_qs" text, "ya_p03_ic_over_weight_200_height_195" text, "ya_p03_ic_pacemaker_defibrillator" text, "ya_p03_ic_pneumothorax" text, "ya_p03_ic_pregnancy" text, "ya_p03_ic_recent_eye_abdominal_chest_surgery" text, "ya_p03_ic_recent_myocardial_infarction" text, "ya_p03_ic_spirometry" text, "ya_p03_ic_surgical_metal_body" text, "ya_p03_ic_unstable_angina_pectoris" text, "ya_p03_ic_ya_dl_elspac" text, "ya_p03_ic_ya_med_find" text, "ya_p03_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p03__role, psc_role.psycap_p02_new_ya_p03__role, psc_role.psycap_p02_old_ya_p03__role, psc_role.ya_p03__role, psc_role.ya_p03_digi_ya03v2__role, psc_role.ya_p03_digi_ya04v2__role, psc_role.ya_p03_digi_ya05v2__role, psc_state.psycap_p01_ya_p03__state, psc_state.psycap_p02_new_ya_p03__state, psc_state.psycap_p02_old_ya_p03__state, psc_state.ya_p03__state, psc_state.ya_p03_digi_ya03v2__state, psc_state.ya_p03_digi_ya04v2__state, psc_state.ya_p03_digi_ya05v2__state, psc_activity_state.psycap_p01_ya_p03__activity_state, psc_activity_state.psycap_p02_new_ya_p03__activity_state, psc_activity_state.psycap_p02_old_ya_p03__activity_state, psc_activity_state.ya_p03__activity_state, psc_activity_state.ya_p03_digi_ya03v2__activity_state, psc_activity_state.ya_p03_digi_ya04v2__activity_state, psc_activity_state.ya_p03_digi_ya05v2__activity_state, psc_created_at.psycap_p01_ya_p03__created_at, psc_created_at.psycap_p02_new_ya_p03__created_at, psc_created_at.psycap_p02_old_ya_p03__created_at, psc_created_at.ya_p03__created_at, psc_created_at.ya_p03_digi_ya03v2__created_at, psc_created_at.ya_p03_digi_ya04v2__created_at, psc_created_at.ya_p03_digi_ya05v2__created_at, psc_accepted_at.psycap_p01_ya_p03__accepted_at, psc_accepted_at.psycap_p02_new_ya_p03__accepted_at, psc_accepted_at.psycap_p02_old_ya_p03__accepted_at, psc_accepted_at.ya_p03__accepted_at, psc_accepted_at.ya_p03_digi_ya03v2__accepted_at, psc_accepted_at.ya_p03_digi_ya04v2__accepted_at, psc_accepted_at.ya_p03_digi_ya05v2__accepted_at, psc_cancelled_at.psycap_p01_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_new_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p03__cancelled_at, psc_cancelled_at.ya_p03__cancelled_at, psc_cancelled_at.ya_p03_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya05v2__cancelled_at, psc_revoked_at.psycap_p01_ya_p03__revoked_at, psc_revoked_at.psycap_p02_new_ya_p03__revoked_at, psc_revoked_at.psycap_p02_old_ya_p03__revoked_at, psc_revoked_at.ya_p03__revoked_at, psc_revoked_at.ya_p03_digi_ya03v2__revoked_at, psc_revoked_at.ya_p03_digi_ya04v2__revoked_at, psc_revoked_at.ya_p03_digi_ya05v2__revoked_at, psc_paused_at.psycap_p01_ya_p03__paused_at, psc_paused_at.psycap_p02_new_ya_p03__paused_at, psc_paused_at.psycap_p02_old_ya_p03__paused_at, psc_paused_at.ya_p03__paused_at, psc_paused_at.ya_p03_digi_ya03v2__paused_at, psc_paused_at.ya_p03_digi_ya04v2__paused_at, psc_paused_at.ya_p03_digi_ya05v2__paused_at, ya_p03_ic_buccal_swab_proband, ya_p03_ic_urine_proband, ya_p03_ic_venous_blood_proband, ya_p03_ic_anam_qs, ya_p03_ic_aneurysm, ya_p03_ic_anthropometry, ya_p03_ic_arch_foot, ya_p03_ic_basic_qs, ya_p03_ic_blood_pressure, ya_p03_ic_braces_piercing_iud, ya_p03_ic_cognition_test, ya_p03_ic_da_health_registry, ya_p03_ic_dexa, ya_p03_ic_enviro_qs, ya_p03_ic_follow_up_studies, ya_p03_ic_fracture_lower_body_last_3m, ya_p03_ic_fracture_upper_body_last_3m, ya_p03_ic_hand_grip, ya_p03_ic_hearing_vision_impairment, ya_p03_ic_heart_disease, ya_p03_ic_hemoptysis_ns, ya_p03_ic_hernia, ya_p03_ic_hyperthyroidism, ya_p03_ic_inability_hold_pencil, ya_p03_ic_inability_stand_both_legs, ya_p03_ic_inability_talk_cze, ya_p03_ic_inability_walk, ya_p03_ic_inbody, ya_p03_ic_infectious_resp_diseases, ya_p03_ic_iodine_barium_radioisotopes_last_7d, ya_p03_ic_knee_stability, ya_p03_ic_nutri_qs, ya_p03_ic_over_weight_200_height_195, ya_p03_ic_pacemaker_defibrillator, ya_p03_ic_pneumothorax, ya_p03_ic_pregnancy, ya_p03_ic_recent_eye_abdominal_chest_surgery, ya_p03_ic_recent_myocardial_infarction, ya_p03_ic_spirometry, ya_p03_ic_surgical_metal_body, ya_p03_ic_unstable_angina_pectoris, ya_p03_ic_ya_dl_elspac, ya_p03_ic_ya_med_find, ya_p03_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 21 -- Pilot ID );
Date: 2025-12-01 05:02:38 Duration: 12s17ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__21__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: Young Adults, Pilot ID: 21 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__role" text, "psycap_p02_new_ya_p03__role" text, "psycap_p02_old_ya_p03__role" text, "ya_p03__role" text, "ya_p03_digi_ya03v2__role" text, "ya_p03_digi_ya04v2__role" text, "ya_p03_digi_ya05v2__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__state" text, "psycap_p02_new_ya_p03__state" text, "psycap_p02_old_ya_p03__state" text, "ya_p03__state" text, "ya_p03_digi_ya03v2__state" text, "ya_p03_digi_ya04v2__state" text, "ya_p03_digi_ya05v2__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p03__activity_state" text, "psycap_p02_new_ya_p03__activity_state" text, "psycap_p02_old_ya_p03__activity_state" text, "ya_p03__activity_state" text, "ya_p03_digi_ya03v2__activity_state" text, "ya_p03_digi_ya04v2__activity_state" text, "ya_p03_digi_ya05v2__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p03__created_at" text, "psycap_p02_new_ya_p03__created_at" text, "psycap_p02_old_ya_p03__created_at" text, "ya_p03__created_at" text, "ya_p03_digi_ya03v2__created_at" text, "ya_p03_digi_ya04v2__created_at" text, "ya_p03_digi_ya05v2__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p03__accepted_at" text, "psycap_p02_new_ya_p03__accepted_at" text, "psycap_p02_old_ya_p03__accepted_at" text, "ya_p03__accepted_at" text, "ya_p03_digi_ya03v2__accepted_at" text, "ya_p03_digi_ya04v2__accepted_at" text, "ya_p03_digi_ya05v2__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p03__cancelled_at" text, "psycap_p02_new_ya_p03__cancelled_at" text, "psycap_p02_old_ya_p03__cancelled_at" text, "ya_p03__cancelled_at" text, "ya_p03_digi_ya03v2__cancelled_at" text, "ya_p03_digi_ya04v2__cancelled_at" text, "ya_p03_digi_ya05v2__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p03__revoked_at" text, "psycap_p02_new_ya_p03__revoked_at" text, "psycap_p02_old_ya_p03__revoked_at" text, "ya_p03__revoked_at" text, "ya_p03_digi_ya03v2__revoked_at" text, "ya_p03_digi_ya04v2__revoked_at" text, "ya_p03_digi_ya05v2__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p03__paused_at" text, "psycap_p02_new_ya_p03__paused_at" text, "psycap_p02_old_ya_p03__paused_at" text, "ya_p03__paused_at" text, "ya_p03_digi_ya03v2__paused_at" text, "ya_p03_digi_ya04v2__paused_at" text, "ya_p03_digi_ya05v2__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_buccal_swab_proband'), ('ya_p03_ic_urine_proband'), ('ya_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p03_ic_buccal_swab_proband" text, "ya_p03_ic_urine_proband" text, "ya_p03_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_anam_qs'), ('ya_p03_ic_aneurysm'), ('ya_p03_ic_anthropometry'), ('ya_p03_ic_arch_foot'), ('ya_p03_ic_basic_qs'), ('ya_p03_ic_blood_pressure'), ('ya_p03_ic_braces_piercing_iud'), ('ya_p03_ic_cognition_test'), ('ya_p03_ic_da_health_registry'), ('ya_p03_ic_dexa'), ('ya_p03_ic_enviro_qs'), ('ya_p03_ic_follow_up_studies'), ('ya_p03_ic_fracture_lower_body_last_3m'), ('ya_p03_ic_fracture_upper_body_last_3m'), ('ya_p03_ic_hand_grip'), ('ya_p03_ic_hearing_vision_impairment'), ('ya_p03_ic_heart_disease'), ('ya_p03_ic_hemoptysis_ns'), ('ya_p03_ic_hernia'), ('ya_p03_ic_hyperthyroidism'), ('ya_p03_ic_inability_hold_pencil'), ('ya_p03_ic_inability_stand_both_legs'), ('ya_p03_ic_inability_talk_cze'), ('ya_p03_ic_inability_walk'), ('ya_p03_ic_inbody'), ('ya_p03_ic_infectious_resp_diseases'), ('ya_p03_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p03_ic_knee_stability'), ('ya_p03_ic_nutri_qs'), ('ya_p03_ic_over_weight_200_height_195'), ('ya_p03_ic_pacemaker_defibrillator'), ('ya_p03_ic_pneumothorax'), ('ya_p03_ic_pregnancy'), ('ya_p03_ic_recent_eye_abdominal_chest_surgery'), ('ya_p03_ic_recent_myocardial_infarction'), ('ya_p03_ic_spirometry'), ('ya_p03_ic_surgical_metal_body'), ('ya_p03_ic_unstable_angina_pectoris'), ('ya_p03_ic_ya_dl_elspac'), ('ya_p03_ic_ya_med_find'), ('ya_p03_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p03_ic_anam_qs" text, "ya_p03_ic_aneurysm" text, "ya_p03_ic_anthropometry" text, "ya_p03_ic_arch_foot" text, "ya_p03_ic_basic_qs" text, "ya_p03_ic_blood_pressure" text, "ya_p03_ic_braces_piercing_iud" text, "ya_p03_ic_cognition_test" text, "ya_p03_ic_da_health_registry" text, "ya_p03_ic_dexa" text, "ya_p03_ic_enviro_qs" text, "ya_p03_ic_follow_up_studies" text, "ya_p03_ic_fracture_lower_body_last_3m" text, "ya_p03_ic_fracture_upper_body_last_3m" text, "ya_p03_ic_hand_grip" text, "ya_p03_ic_hearing_vision_impairment" text, "ya_p03_ic_heart_disease" text, "ya_p03_ic_hemoptysis_ns" text, "ya_p03_ic_hernia" text, "ya_p03_ic_hyperthyroidism" text, "ya_p03_ic_inability_hold_pencil" text, "ya_p03_ic_inability_stand_both_legs" text, "ya_p03_ic_inability_talk_cze" text, "ya_p03_ic_inability_walk" text, "ya_p03_ic_inbody" text, "ya_p03_ic_infectious_resp_diseases" text, "ya_p03_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p03_ic_knee_stability" text, "ya_p03_ic_nutri_qs" text, "ya_p03_ic_over_weight_200_height_195" text, "ya_p03_ic_pacemaker_defibrillator" text, "ya_p03_ic_pneumothorax" text, "ya_p03_ic_pregnancy" text, "ya_p03_ic_recent_eye_abdominal_chest_surgery" text, "ya_p03_ic_recent_myocardial_infarction" text, "ya_p03_ic_spirometry" text, "ya_p03_ic_surgical_metal_body" text, "ya_p03_ic_unstable_angina_pectoris" text, "ya_p03_ic_ya_dl_elspac" text, "ya_p03_ic_ya_med_find" text, "ya_p03_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p03__role, psc_role.psycap_p02_new_ya_p03__role, psc_role.psycap_p02_old_ya_p03__role, psc_role.ya_p03__role, psc_role.ya_p03_digi_ya03v2__role, psc_role.ya_p03_digi_ya04v2__role, psc_role.ya_p03_digi_ya05v2__role, psc_state.psycap_p01_ya_p03__state, psc_state.psycap_p02_new_ya_p03__state, psc_state.psycap_p02_old_ya_p03__state, psc_state.ya_p03__state, psc_state.ya_p03_digi_ya03v2__state, psc_state.ya_p03_digi_ya04v2__state, psc_state.ya_p03_digi_ya05v2__state, psc_activity_state.psycap_p01_ya_p03__activity_state, psc_activity_state.psycap_p02_new_ya_p03__activity_state, psc_activity_state.psycap_p02_old_ya_p03__activity_state, psc_activity_state.ya_p03__activity_state, psc_activity_state.ya_p03_digi_ya03v2__activity_state, psc_activity_state.ya_p03_digi_ya04v2__activity_state, psc_activity_state.ya_p03_digi_ya05v2__activity_state, psc_created_at.psycap_p01_ya_p03__created_at, psc_created_at.psycap_p02_new_ya_p03__created_at, psc_created_at.psycap_p02_old_ya_p03__created_at, psc_created_at.ya_p03__created_at, psc_created_at.ya_p03_digi_ya03v2__created_at, psc_created_at.ya_p03_digi_ya04v2__created_at, psc_created_at.ya_p03_digi_ya05v2__created_at, psc_accepted_at.psycap_p01_ya_p03__accepted_at, psc_accepted_at.psycap_p02_new_ya_p03__accepted_at, psc_accepted_at.psycap_p02_old_ya_p03__accepted_at, psc_accepted_at.ya_p03__accepted_at, psc_accepted_at.ya_p03_digi_ya03v2__accepted_at, psc_accepted_at.ya_p03_digi_ya04v2__accepted_at, psc_accepted_at.ya_p03_digi_ya05v2__accepted_at, psc_cancelled_at.psycap_p01_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_new_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p03__cancelled_at, psc_cancelled_at.ya_p03__cancelled_at, psc_cancelled_at.ya_p03_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya05v2__cancelled_at, psc_revoked_at.psycap_p01_ya_p03__revoked_at, psc_revoked_at.psycap_p02_new_ya_p03__revoked_at, psc_revoked_at.psycap_p02_old_ya_p03__revoked_at, psc_revoked_at.ya_p03__revoked_at, psc_revoked_at.ya_p03_digi_ya03v2__revoked_at, psc_revoked_at.ya_p03_digi_ya04v2__revoked_at, psc_revoked_at.ya_p03_digi_ya05v2__revoked_at, psc_paused_at.psycap_p01_ya_p03__paused_at, psc_paused_at.psycap_p02_new_ya_p03__paused_at, psc_paused_at.psycap_p02_old_ya_p03__paused_at, psc_paused_at.ya_p03__paused_at, psc_paused_at.ya_p03_digi_ya03v2__paused_at, psc_paused_at.ya_p03_digi_ya04v2__paused_at, psc_paused_at.ya_p03_digi_ya05v2__paused_at, ya_p03_ic_buccal_swab_proband, ya_p03_ic_urine_proband, ya_p03_ic_venous_blood_proband, ya_p03_ic_anam_qs, ya_p03_ic_aneurysm, ya_p03_ic_anthropometry, ya_p03_ic_arch_foot, ya_p03_ic_basic_qs, ya_p03_ic_blood_pressure, ya_p03_ic_braces_piercing_iud, ya_p03_ic_cognition_test, ya_p03_ic_da_health_registry, ya_p03_ic_dexa, ya_p03_ic_enviro_qs, ya_p03_ic_follow_up_studies, ya_p03_ic_fracture_lower_body_last_3m, ya_p03_ic_fracture_upper_body_last_3m, ya_p03_ic_hand_grip, ya_p03_ic_hearing_vision_impairment, ya_p03_ic_heart_disease, ya_p03_ic_hemoptysis_ns, ya_p03_ic_hernia, ya_p03_ic_hyperthyroidism, ya_p03_ic_inability_hold_pencil, ya_p03_ic_inability_stand_both_legs, ya_p03_ic_inability_talk_cze, ya_p03_ic_inability_walk, ya_p03_ic_inbody, ya_p03_ic_infectious_resp_diseases, ya_p03_ic_iodine_barium_radioisotopes_last_7d, ya_p03_ic_knee_stability, ya_p03_ic_nutri_qs, ya_p03_ic_over_weight_200_height_195, ya_p03_ic_pacemaker_defibrillator, ya_p03_ic_pneumothorax, ya_p03_ic_pregnancy, ya_p03_ic_recent_eye_abdominal_chest_surgery, ya_p03_ic_recent_myocardial_infarction, ya_p03_ic_spirometry, ya_p03_ic_surgical_metal_body, ya_p03_ic_unstable_angina_pectoris, ya_p03_ic_ya_dl_elspac, ya_p03_ic_ya_med_find, ya_p03_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 21 -- Pilot ID );
Date: 2025-12-03 17:02:29 Duration: 2s157ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__21__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: Young Adults, Pilot ID: 21 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__role" text, "psycap_p02_new_ya_p03__role" text, "psycap_p02_old_ya_p03__role" text, "ya_p03__role" text, "ya_p03_digi_ya03v2__role" text, "ya_p03_digi_ya04v2__role" text, "ya_p03_digi_ya05v2__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__state" text, "psycap_p02_new_ya_p03__state" text, "psycap_p02_old_ya_p03__state" text, "ya_p03__state" text, "ya_p03_digi_ya03v2__state" text, "ya_p03_digi_ya04v2__state" text, "ya_p03_digi_ya05v2__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p03__activity_state" text, "psycap_p02_new_ya_p03__activity_state" text, "psycap_p02_old_ya_p03__activity_state" text, "ya_p03__activity_state" text, "ya_p03_digi_ya03v2__activity_state" text, "ya_p03_digi_ya04v2__activity_state" text, "ya_p03_digi_ya05v2__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p03__created_at" text, "psycap_p02_new_ya_p03__created_at" text, "psycap_p02_old_ya_p03__created_at" text, "ya_p03__created_at" text, "ya_p03_digi_ya03v2__created_at" text, "ya_p03_digi_ya04v2__created_at" text, "ya_p03_digi_ya05v2__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p03__accepted_at" text, "psycap_p02_new_ya_p03__accepted_at" text, "psycap_p02_old_ya_p03__accepted_at" text, "ya_p03__accepted_at" text, "ya_p03_digi_ya03v2__accepted_at" text, "ya_p03_digi_ya04v2__accepted_at" text, "ya_p03_digi_ya05v2__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p03__cancelled_at" text, "psycap_p02_new_ya_p03__cancelled_at" text, "psycap_p02_old_ya_p03__cancelled_at" text, "ya_p03__cancelled_at" text, "ya_p03_digi_ya03v2__cancelled_at" text, "ya_p03_digi_ya04v2__cancelled_at" text, "ya_p03_digi_ya05v2__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p03__revoked_at" text, "psycap_p02_new_ya_p03__revoked_at" text, "psycap_p02_old_ya_p03__revoked_at" text, "ya_p03__revoked_at" text, "ya_p03_digi_ya03v2__revoked_at" text, "ya_p03_digi_ya04v2__revoked_at" text, "ya_p03_digi_ya05v2__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p03__paused_at" text, "psycap_p02_new_ya_p03__paused_at" text, "psycap_p02_old_ya_p03__paused_at" text, "ya_p03__paused_at" text, "ya_p03_digi_ya03v2__paused_at" text, "ya_p03_digi_ya04v2__paused_at" text, "ya_p03_digi_ya05v2__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_buccal_swab_proband'), ('ya_p03_ic_urine_proband'), ('ya_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p03_ic_buccal_swab_proband" text, "ya_p03_ic_urine_proband" text, "ya_p03_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_anam_qs'), ('ya_p03_ic_aneurysm'), ('ya_p03_ic_anthropometry'), ('ya_p03_ic_arch_foot'), ('ya_p03_ic_basic_qs'), ('ya_p03_ic_blood_pressure'), ('ya_p03_ic_braces_piercing_iud'), ('ya_p03_ic_cognition_test'), ('ya_p03_ic_da_health_registry'), ('ya_p03_ic_dexa'), ('ya_p03_ic_enviro_qs'), ('ya_p03_ic_follow_up_studies'), ('ya_p03_ic_fracture_lower_body_last_3m'), ('ya_p03_ic_fracture_upper_body_last_3m'), ('ya_p03_ic_hand_grip'), ('ya_p03_ic_hearing_vision_impairment'), ('ya_p03_ic_heart_disease'), ('ya_p03_ic_hemoptysis_ns'), ('ya_p03_ic_hernia'), ('ya_p03_ic_hyperthyroidism'), ('ya_p03_ic_inability_hold_pencil'), ('ya_p03_ic_inability_stand_both_legs'), ('ya_p03_ic_inability_talk_cze'), ('ya_p03_ic_inability_walk'), ('ya_p03_ic_inbody'), ('ya_p03_ic_infectious_resp_diseases'), ('ya_p03_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p03_ic_knee_stability'), ('ya_p03_ic_nutri_qs'), ('ya_p03_ic_over_weight_200_height_195'), ('ya_p03_ic_pacemaker_defibrillator'), ('ya_p03_ic_pneumothorax'), ('ya_p03_ic_pregnancy'), ('ya_p03_ic_recent_eye_abdominal_chest_surgery'), ('ya_p03_ic_recent_myocardial_infarction'), ('ya_p03_ic_spirometry'), ('ya_p03_ic_surgical_metal_body'), ('ya_p03_ic_unstable_angina_pectoris'), ('ya_p03_ic_ya_dl_elspac'), ('ya_p03_ic_ya_med_find'), ('ya_p03_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p03_ic_anam_qs" text, "ya_p03_ic_aneurysm" text, "ya_p03_ic_anthropometry" text, "ya_p03_ic_arch_foot" text, "ya_p03_ic_basic_qs" text, "ya_p03_ic_blood_pressure" text, "ya_p03_ic_braces_piercing_iud" text, "ya_p03_ic_cognition_test" text, "ya_p03_ic_da_health_registry" text, "ya_p03_ic_dexa" text, "ya_p03_ic_enviro_qs" text, "ya_p03_ic_follow_up_studies" text, "ya_p03_ic_fracture_lower_body_last_3m" text, "ya_p03_ic_fracture_upper_body_last_3m" text, "ya_p03_ic_hand_grip" text, "ya_p03_ic_hearing_vision_impairment" text, "ya_p03_ic_heart_disease" text, "ya_p03_ic_hemoptysis_ns" text, "ya_p03_ic_hernia" text, "ya_p03_ic_hyperthyroidism" text, "ya_p03_ic_inability_hold_pencil" text, "ya_p03_ic_inability_stand_both_legs" text, "ya_p03_ic_inability_talk_cze" text, "ya_p03_ic_inability_walk" text, "ya_p03_ic_inbody" text, "ya_p03_ic_infectious_resp_diseases" text, "ya_p03_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p03_ic_knee_stability" text, "ya_p03_ic_nutri_qs" text, "ya_p03_ic_over_weight_200_height_195" text, "ya_p03_ic_pacemaker_defibrillator" text, "ya_p03_ic_pneumothorax" text, "ya_p03_ic_pregnancy" text, "ya_p03_ic_recent_eye_abdominal_chest_surgery" text, "ya_p03_ic_recent_myocardial_infarction" text, "ya_p03_ic_spirometry" text, "ya_p03_ic_surgical_metal_body" text, "ya_p03_ic_unstable_angina_pectoris" text, "ya_p03_ic_ya_dl_elspac" text, "ya_p03_ic_ya_med_find" text, "ya_p03_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p03__role, psc_role.psycap_p02_new_ya_p03__role, psc_role.psycap_p02_old_ya_p03__role, psc_role.ya_p03__role, psc_role.ya_p03_digi_ya03v2__role, psc_role.ya_p03_digi_ya04v2__role, psc_role.ya_p03_digi_ya05v2__role, psc_state.psycap_p01_ya_p03__state, psc_state.psycap_p02_new_ya_p03__state, psc_state.psycap_p02_old_ya_p03__state, psc_state.ya_p03__state, psc_state.ya_p03_digi_ya03v2__state, psc_state.ya_p03_digi_ya04v2__state, psc_state.ya_p03_digi_ya05v2__state, psc_activity_state.psycap_p01_ya_p03__activity_state, psc_activity_state.psycap_p02_new_ya_p03__activity_state, psc_activity_state.psycap_p02_old_ya_p03__activity_state, psc_activity_state.ya_p03__activity_state, psc_activity_state.ya_p03_digi_ya03v2__activity_state, psc_activity_state.ya_p03_digi_ya04v2__activity_state, psc_activity_state.ya_p03_digi_ya05v2__activity_state, psc_created_at.psycap_p01_ya_p03__created_at, psc_created_at.psycap_p02_new_ya_p03__created_at, psc_created_at.psycap_p02_old_ya_p03__created_at, psc_created_at.ya_p03__created_at, psc_created_at.ya_p03_digi_ya03v2__created_at, psc_created_at.ya_p03_digi_ya04v2__created_at, psc_created_at.ya_p03_digi_ya05v2__created_at, psc_accepted_at.psycap_p01_ya_p03__accepted_at, psc_accepted_at.psycap_p02_new_ya_p03__accepted_at, psc_accepted_at.psycap_p02_old_ya_p03__accepted_at, psc_accepted_at.ya_p03__accepted_at, psc_accepted_at.ya_p03_digi_ya03v2__accepted_at, psc_accepted_at.ya_p03_digi_ya04v2__accepted_at, psc_accepted_at.ya_p03_digi_ya05v2__accepted_at, psc_cancelled_at.psycap_p01_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_new_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p03__cancelled_at, psc_cancelled_at.ya_p03__cancelled_at, psc_cancelled_at.ya_p03_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya05v2__cancelled_at, psc_revoked_at.psycap_p01_ya_p03__revoked_at, psc_revoked_at.psycap_p02_new_ya_p03__revoked_at, psc_revoked_at.psycap_p02_old_ya_p03__revoked_at, psc_revoked_at.ya_p03__revoked_at, psc_revoked_at.ya_p03_digi_ya03v2__revoked_at, psc_revoked_at.ya_p03_digi_ya04v2__revoked_at, psc_revoked_at.ya_p03_digi_ya05v2__revoked_at, psc_paused_at.psycap_p01_ya_p03__paused_at, psc_paused_at.psycap_p02_new_ya_p03__paused_at, psc_paused_at.psycap_p02_old_ya_p03__paused_at, psc_paused_at.ya_p03__paused_at, psc_paused_at.ya_p03_digi_ya03v2__paused_at, psc_paused_at.ya_p03_digi_ya04v2__paused_at, psc_paused_at.ya_p03_digi_ya05v2__paused_at, ya_p03_ic_buccal_swab_proband, ya_p03_ic_urine_proband, ya_p03_ic_venous_blood_proband, ya_p03_ic_anam_qs, ya_p03_ic_aneurysm, ya_p03_ic_anthropometry, ya_p03_ic_arch_foot, ya_p03_ic_basic_qs, ya_p03_ic_blood_pressure, ya_p03_ic_braces_piercing_iud, ya_p03_ic_cognition_test, ya_p03_ic_da_health_registry, ya_p03_ic_dexa, ya_p03_ic_enviro_qs, ya_p03_ic_follow_up_studies, ya_p03_ic_fracture_lower_body_last_3m, ya_p03_ic_fracture_upper_body_last_3m, ya_p03_ic_hand_grip, ya_p03_ic_hearing_vision_impairment, ya_p03_ic_heart_disease, ya_p03_ic_hemoptysis_ns, ya_p03_ic_hernia, ya_p03_ic_hyperthyroidism, ya_p03_ic_inability_hold_pencil, ya_p03_ic_inability_stand_both_legs, ya_p03_ic_inability_talk_cze, ya_p03_ic_inability_walk, ya_p03_ic_inbody, ya_p03_ic_infectious_resp_diseases, ya_p03_ic_iodine_barium_radioisotopes_last_7d, ya_p03_ic_knee_stability, ya_p03_ic_nutri_qs, ya_p03_ic_over_weight_200_height_195, ya_p03_ic_pacemaker_defibrillator, ya_p03_ic_pneumothorax, ya_p03_ic_pregnancy, ya_p03_ic_recent_eye_abdominal_chest_surgery, ya_p03_ic_recent_myocardial_infarction, ya_p03_ic_spirometry, ya_p03_ic_surgical_metal_body, ya_p03_ic_unstable_angina_pectoris, ya_p03_ic_ya_dl_elspac, ya_p03_ic_ya_med_find, ya_p03_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 21 -- Pilot ID );
Date: 2025-12-05 05:02:27 Duration: 2s30ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
14 31s235ms 13 1s589ms 2s857ms 2s402ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__20__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p11__role" text, "tng_p11__role" text, "tng_p11_monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p11__state" text, "tng_p11__state" text, "tng_p11_monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as activity ("subject_id" int, "dust_p01_tng_p11__activity_state" text, "tng_p11__activity_state" text, "tng_p11_monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as created_at ("subject_id" int, "dust_p01_tng_p11__created_at" text, "tng_p11__created_at" text, "tng_p11_monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "dust_p01_tng_p11__accepted_at" text, "tng_p11__accepted_at" text, "tng_p11_monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "dust_p01_tng_p11__cancelled_at" text, "tng_p11__cancelled_at" text, "tng_p11_monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "dust_p01_tng_p11__revoked_at" text, "tng_p11__revoked_at" text, "tng_p11_monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as paused_at ("subject_id" int, "dust_p01_tng_p11__paused_at" text, "tng_p11__paused_at" text, "tng_p11_monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "dust_p01_tng_p11_ic_dust_mother" text, "tng_p11_ic_buccal_swab_child" text, "tng_p11_ic_buccal_swab_mother" text, "tng_p11_ic_cord_blood_mother" text, "tng_p11_ic_drop_blood_child" text, "tng_p11_ic_stool_child" text, "tng_p11_ic_urine_mother" text, "tng_p11_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "dust_p01_tng_p11_ic_dl_celpac_studies" text, "dust_p01_tng_p11_ic_survey" text, "tng_p11_ic_celspac_newsletter" text, "tng_p11_ic_dl_celpac_studies" text, "tng_p11_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.dust_p01_tng_p11__role, psc_role.tng_p11__role, psc_role.tng_p11_monitor__role, psc_state.dust_p01_tng_p11__state, psc_state.tng_p11__state, psc_state.tng_p11_monitor__state, psc_activity_state.dust_p01_tng_p11__activity_state, psc_activity_state.tng_p11__activity_state, psc_activity_state.tng_p11_monitor__activity_state, psc_created_at.dust_p01_tng_p11__created_at, psc_created_at.tng_p11__created_at, psc_created_at.tng_p11_monitor__created_at, psc_accepted_at.dust_p01_tng_p11__accepted_at, psc_accepted_at.tng_p11__accepted_at, psc_accepted_at.tng_p11_monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p11__cancelled_at, psc_cancelled_at.tng_p11__cancelled_at, psc_cancelled_at.tng_p11_monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p11__revoked_at, psc_revoked_at.tng_p11__revoked_at, psc_revoked_at.tng_p11_monitor__revoked_at, psc_paused_at.dust_p01_tng_p11__paused_at, psc_paused_at.tng_p11__paused_at, psc_paused_at.tng_p11_monitor__paused_at, dust_p01_tng_p11_ic_dust_mother, tng_p11_ic_buccal_swab_child, tng_p11_ic_buccal_swab_mother, tng_p11_ic_cord_blood_mother, tng_p11_ic_drop_blood_child, tng_p11_ic_stool_child, tng_p11_ic_urine_mother, tng_p11_ic_venous_blood_mother, dust_p01_tng_p11_ic_dl_celpac_studies, dust_p01_tng_p11_ic_survey, tng_p11_ic_celspac_newsletter, tng_p11_ic_dl_celpac_studies, tng_p11_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #14
Day Hour Count Duration Avg duration Nov 30 05 1 1s589ms 1s589ms 17 1 2s642ms 2s642ms Dec 01 05 1 2s660ms 2s660ms 17 1 2s610ms 2s610ms Dec 02 05 1 2s790ms 2s790ms 17 1 2s160ms 2s160ms Dec 03 17 1 2s842ms 2s842ms Dec 04 05 1 2s170ms 2s170ms 17 1 2s270ms 2s270ms Dec 05 05 1 2s615ms 2s615ms 17 1 2s857ms 2s857ms Dec 06 05 1 1s598ms 1s598ms 17 1 2s426ms 2s426ms [ User: tng_migration_user - Total duration: 31s235ms - Times executed: 13 ]
[ Application: dbt - Total duration: 31s235ms - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__20"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__20__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG, Pilot ID: 20 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__role" text, "tng_p11__role" text, "tng_p11_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__state" text, "tng_p11__state" text, "tng_p11_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p11__activity_state" text, "tng_p11__activity_state" text, "tng_p11_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p11__created_at" text, "tng_p11__created_at" text, "tng_p11_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p11__accepted_at" text, "tng_p11__accepted_at" text, "tng_p11_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p11__cancelled_at" text, "tng_p11__cancelled_at" text, "tng_p11_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p11__revoked_at" text, "tng_p11__revoked_at" text, "tng_p11_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p11__paused_at" text, "tng_p11__paused_at" text, "tng_p11_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dust_mother'), ('tng_p11_ic_buccal_swab_child'), ('tng_p11_ic_buccal_swab_mother'), ('tng_p11_ic_cord_blood_mother'), ('tng_p11_ic_drop_blood_child'), ('tng_p11_ic_stool_child'), ('tng_p11_ic_urine_mother'), ('tng_p11_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p11_ic_dust_mother" text, "tng_p11_ic_buccal_swab_child" text, "tng_p11_ic_buccal_swab_mother" text, "tng_p11_ic_cord_blood_mother" text, "tng_p11_ic_drop_blood_child" text, "tng_p11_ic_stool_child" text, "tng_p11_ic_urine_mother" text, "tng_p11_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dl_celpac_studies'), ('dust_p01_tng_p11_ic_survey'), ('tng_p11_ic_celspac_newsletter'), ('tng_p11_ic_dl_celpac_studies'), ('tng_p11_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p11_ic_dl_celpac_studies" text, "dust_p01_tng_p11_ic_survey" text, "tng_p11_ic_celspac_newsletter" text, "tng_p11_ic_dl_celpac_studies" text, "tng_p11_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p11__role, psc_role.tng_p11__role, psc_role.tng_p11_monitor__role, psc_state.dust_p01_tng_p11__state, psc_state.tng_p11__state, psc_state.tng_p11_monitor__state, psc_activity_state.dust_p01_tng_p11__activity_state, psc_activity_state.tng_p11__activity_state, psc_activity_state.tng_p11_monitor__activity_state, psc_created_at.dust_p01_tng_p11__created_at, psc_created_at.tng_p11__created_at, psc_created_at.tng_p11_monitor__created_at, psc_accepted_at.dust_p01_tng_p11__accepted_at, psc_accepted_at.tng_p11__accepted_at, psc_accepted_at.tng_p11_monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p11__cancelled_at, psc_cancelled_at.tng_p11__cancelled_at, psc_cancelled_at.tng_p11_monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p11__revoked_at, psc_revoked_at.tng_p11__revoked_at, psc_revoked_at.tng_p11_monitor__revoked_at, psc_paused_at.dust_p01_tng_p11__paused_at, psc_paused_at.tng_p11__paused_at, psc_paused_at.tng_p11_monitor__paused_at, dust_p01_tng_p11_ic_dust_mother, tng_p11_ic_buccal_swab_child, tng_p11_ic_buccal_swab_mother, tng_p11_ic_cord_blood_mother, tng_p11_ic_drop_blood_child, tng_p11_ic_stool_child, tng_p11_ic_urine_mother, tng_p11_ic_venous_blood_mother, dust_p01_tng_p11_ic_dl_celpac_studies, dust_p01_tng_p11_ic_survey, tng_p11_ic_celspac_newsletter, tng_p11_ic_dl_celpac_studies, tng_p11_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 20 -- Pilot ID );
Date: 2025-12-05 17:02:28 Duration: 2s857ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__20"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__20__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG, Pilot ID: 20 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__role" text, "tng_p11__role" text, "tng_p11_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__state" text, "tng_p11__state" text, "tng_p11_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p11__activity_state" text, "tng_p11__activity_state" text, "tng_p11_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p11__created_at" text, "tng_p11__created_at" text, "tng_p11_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p11__accepted_at" text, "tng_p11__accepted_at" text, "tng_p11_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p11__cancelled_at" text, "tng_p11__cancelled_at" text, "tng_p11_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p11__revoked_at" text, "tng_p11__revoked_at" text, "tng_p11_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p11__paused_at" text, "tng_p11__paused_at" text, "tng_p11_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dust_mother'), ('tng_p11_ic_buccal_swab_child'), ('tng_p11_ic_buccal_swab_mother'), ('tng_p11_ic_cord_blood_mother'), ('tng_p11_ic_drop_blood_child'), ('tng_p11_ic_stool_child'), ('tng_p11_ic_urine_mother'), ('tng_p11_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p11_ic_dust_mother" text, "tng_p11_ic_buccal_swab_child" text, "tng_p11_ic_buccal_swab_mother" text, "tng_p11_ic_cord_blood_mother" text, "tng_p11_ic_drop_blood_child" text, "tng_p11_ic_stool_child" text, "tng_p11_ic_urine_mother" text, "tng_p11_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dl_celpac_studies'), ('dust_p01_tng_p11_ic_survey'), ('tng_p11_ic_celspac_newsletter'), ('tng_p11_ic_dl_celpac_studies'), ('tng_p11_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p11_ic_dl_celpac_studies" text, "dust_p01_tng_p11_ic_survey" text, "tng_p11_ic_celspac_newsletter" text, "tng_p11_ic_dl_celpac_studies" text, "tng_p11_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p11__role, psc_role.tng_p11__role, psc_role.tng_p11_monitor__role, psc_state.dust_p01_tng_p11__state, psc_state.tng_p11__state, psc_state.tng_p11_monitor__state, psc_activity_state.dust_p01_tng_p11__activity_state, psc_activity_state.tng_p11__activity_state, psc_activity_state.tng_p11_monitor__activity_state, psc_created_at.dust_p01_tng_p11__created_at, psc_created_at.tng_p11__created_at, psc_created_at.tng_p11_monitor__created_at, psc_accepted_at.dust_p01_tng_p11__accepted_at, psc_accepted_at.tng_p11__accepted_at, psc_accepted_at.tng_p11_monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p11__cancelled_at, psc_cancelled_at.tng_p11__cancelled_at, psc_cancelled_at.tng_p11_monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p11__revoked_at, psc_revoked_at.tng_p11__revoked_at, psc_revoked_at.tng_p11_monitor__revoked_at, psc_paused_at.dust_p01_tng_p11__paused_at, psc_paused_at.tng_p11__paused_at, psc_paused_at.tng_p11_monitor__paused_at, dust_p01_tng_p11_ic_dust_mother, tng_p11_ic_buccal_swab_child, tng_p11_ic_buccal_swab_mother, tng_p11_ic_cord_blood_mother, tng_p11_ic_drop_blood_child, tng_p11_ic_stool_child, tng_p11_ic_urine_mother, tng_p11_ic_venous_blood_mother, dust_p01_tng_p11_ic_dl_celpac_studies, dust_p01_tng_p11_ic_survey, tng_p11_ic_celspac_newsletter, tng_p11_ic_dl_celpac_studies, tng_p11_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 20 -- Pilot ID );
Date: 2025-12-03 17:02:28 Duration: 2s842ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__20"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__20__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG, Pilot ID: 20 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__role" text, "tng_p11__role" text, "tng_p11_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__state" text, "tng_p11__state" text, "tng_p11_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p11__activity_state" text, "tng_p11__activity_state" text, "tng_p11_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p11__created_at" text, "tng_p11__created_at" text, "tng_p11_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p11__accepted_at" text, "tng_p11__accepted_at" text, "tng_p11_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p11__cancelled_at" text, "tng_p11__cancelled_at" text, "tng_p11_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p11__revoked_at" text, "tng_p11__revoked_at" text, "tng_p11_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p11__paused_at" text, "tng_p11__paused_at" text, "tng_p11_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dust_mother'), ('tng_p11_ic_buccal_swab_child'), ('tng_p11_ic_buccal_swab_mother'), ('tng_p11_ic_cord_blood_mother'), ('tng_p11_ic_drop_blood_child'), ('tng_p11_ic_stool_child'), ('tng_p11_ic_urine_mother'), ('tng_p11_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p11_ic_dust_mother" text, "tng_p11_ic_buccal_swab_child" text, "tng_p11_ic_buccal_swab_mother" text, "tng_p11_ic_cord_blood_mother" text, "tng_p11_ic_drop_blood_child" text, "tng_p11_ic_stool_child" text, "tng_p11_ic_urine_mother" text, "tng_p11_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dl_celpac_studies'), ('dust_p01_tng_p11_ic_survey'), ('tng_p11_ic_celspac_newsletter'), ('tng_p11_ic_dl_celpac_studies'), ('tng_p11_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p11_ic_dl_celpac_studies" text, "dust_p01_tng_p11_ic_survey" text, "tng_p11_ic_celspac_newsletter" text, "tng_p11_ic_dl_celpac_studies" text, "tng_p11_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p11__role, psc_role.tng_p11__role, psc_role.tng_p11_monitor__role, psc_state.dust_p01_tng_p11__state, psc_state.tng_p11__state, psc_state.tng_p11_monitor__state, psc_activity_state.dust_p01_tng_p11__activity_state, psc_activity_state.tng_p11__activity_state, psc_activity_state.tng_p11_monitor__activity_state, psc_created_at.dust_p01_tng_p11__created_at, psc_created_at.tng_p11__created_at, psc_created_at.tng_p11_monitor__created_at, psc_accepted_at.dust_p01_tng_p11__accepted_at, psc_accepted_at.tng_p11__accepted_at, psc_accepted_at.tng_p11_monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p11__cancelled_at, psc_cancelled_at.tng_p11__cancelled_at, psc_cancelled_at.tng_p11_monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p11__revoked_at, psc_revoked_at.tng_p11__revoked_at, psc_revoked_at.tng_p11_monitor__revoked_at, psc_paused_at.dust_p01_tng_p11__paused_at, psc_paused_at.tng_p11__paused_at, psc_paused_at.tng_p11_monitor__paused_at, dust_p01_tng_p11_ic_dust_mother, tng_p11_ic_buccal_swab_child, tng_p11_ic_buccal_swab_mother, tng_p11_ic_cord_blood_mother, tng_p11_ic_drop_blood_child, tng_p11_ic_stool_child, tng_p11_ic_urine_mother, tng_p11_ic_venous_blood_mother, dust_p01_tng_p11_ic_dl_celpac_studies, dust_p01_tng_p11_ic_survey, tng_p11_ic_celspac_newsletter, tng_p11_ic_dl_celpac_studies, tng_p11_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 20 -- Pilot ID );
Date: 2025-12-02 05:02:26 Duration: 2s790ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
15 25s857ms 13 1s573ms 2s260ms 1s989ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__22__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "tng_p12__role" text, "tng_p12_monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "tng_p12__state" text, "tng_p12_monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as activity ("subject_id" int, "tng_p12__activity_state" text, "tng_p12_monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as created_at ("subject_id" int, "tng_p12__created_at" text, "tng_p12_monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as accepted_at ("subject_id" int, "tng_p12__accepted_at" text, "tng_p12_monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as cancelled_at ("subject_id" int, "tng_p12__cancelled_at" text, "tng_p12_monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as revoked_at ("subject_id" int, "tng_p12__revoked_at" text, "tng_p12_monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as paused_at ("subject_id" int, "tng_p12__paused_at" text, "tng_p12_monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "tng_p12_ic_buccal_swab_child" text, "tng_p12_ic_buccal_swab_mother" text, "tng_p12_ic_cord_blood_mother" text, "tng_p12_ic_drop_blood_child" text, "tng_p12_ic_stool_child" text, "tng_p12_ic_urine_mother" text, "tng_p12_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as extra_state ("subject_id" int, "tng_p12_ic_celspac_newsletter" text, "tng_p12_ic_dl_celpac_studies" text, "tng_p12_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.tng_p12__role, psc_role.tng_p12_monitor__role, psc_state.tng_p12__state, psc_state.tng_p12_monitor__state, psc_activity_state.tng_p12__activity_state, psc_activity_state.tng_p12_monitor__activity_state, psc_created_at.tng_p12__created_at, psc_created_at.tng_p12_monitor__created_at, psc_accepted_at.tng_p12__accepted_at, psc_accepted_at.tng_p12_monitor__accepted_at, psc_cancelled_at.tng_p12__cancelled_at, psc_cancelled_at.tng_p12_monitor__cancelled_at, psc_revoked_at.tng_p12__revoked_at, psc_revoked_at.tng_p12_monitor__revoked_at, psc_paused_at.tng_p12__paused_at, psc_paused_at.tng_p12_monitor__paused_at, tng_p12_ic_buccal_swab_child, tng_p12_ic_buccal_swab_mother, tng_p12_ic_cord_blood_mother, tng_p12_ic_drop_blood_child, tng_p12_ic_stool_child, tng_p12_ic_urine_mother, tng_p12_ic_venous_blood_mother, tng_p12_ic_celspac_newsletter, tng_p12_ic_dl_celpac_studies, tng_p12_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #15
Day Hour Count Duration Avg duration Nov 30 05 1 2s65ms 2s65ms 17 1 2s83ms 2s83ms Dec 01 05 1 1s573ms 1s573ms 17 1 1s997ms 1s997ms Dec 02 05 1 2s31ms 2s31ms 17 1 1s855ms 1s855ms Dec 03 17 1 2s195ms 2s195ms Dec 04 05 1 1s857ms 1s857ms 17 1 1s768ms 1s768ms Dec 05 05 1 2s205ms 2s205ms 17 1 2s260ms 2s260ms Dec 06 05 1 1s823ms 1s823ms 17 1 2s141ms 2s141ms [ User: tng_migration_user - Total duration: 25s857ms - Times executed: 13 ]
[ Application: dbt - Total duration: 25s857ms - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__22"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__22__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG (nabor od 29.4.2022), Pilot ID: 22 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__role" text, "tng_p12_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__state" text, "tng_p12_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS activity ("subject_id" int, "tng_p12__activity_state" text, "tng_p12_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS created_at ("subject_id" int, "tng_p12__created_at" text, "tng_p12_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p12__accepted_at" text, "tng_p12_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p12__cancelled_at" text, "tng_p12_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p12__revoked_at" text, "tng_p12_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p12__paused_at" text, "tng_p12_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_buccal_swab_child'), ('tng_p12_ic_buccal_swab_mother'), ('tng_p12_ic_cord_blood_mother'), ('tng_p12_ic_drop_blood_child'), ('tng_p12_ic_stool_child'), ('tng_p12_ic_urine_mother'), ('tng_p12_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p12_ic_buccal_swab_child" text, "tng_p12_ic_buccal_swab_mother" text, "tng_p12_ic_cord_blood_mother" text, "tng_p12_ic_drop_blood_child" text, "tng_p12_ic_stool_child" text, "tng_p12_ic_urine_mother" text, "tng_p12_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_celspac_newsletter'), ('tng_p12_ic_dl_celpac_studies'), ('tng_p12_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p12_ic_celspac_newsletter" text, "tng_p12_ic_dl_celpac_studies" text, "tng_p12_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p12__role, psc_role.tng_p12_monitor__role, psc_state.tng_p12__state, psc_state.tng_p12_monitor__state, psc_activity_state.tng_p12__activity_state, psc_activity_state.tng_p12_monitor__activity_state, psc_created_at.tng_p12__created_at, psc_created_at.tng_p12_monitor__created_at, psc_accepted_at.tng_p12__accepted_at, psc_accepted_at.tng_p12_monitor__accepted_at, psc_cancelled_at.tng_p12__cancelled_at, psc_cancelled_at.tng_p12_monitor__cancelled_at, psc_revoked_at.tng_p12__revoked_at, psc_revoked_at.tng_p12_monitor__revoked_at, psc_paused_at.tng_p12__paused_at, psc_paused_at.tng_p12_monitor__paused_at, tng_p12_ic_buccal_swab_child, tng_p12_ic_buccal_swab_mother, tng_p12_ic_cord_blood_mother, tng_p12_ic_drop_blood_child, tng_p12_ic_stool_child, tng_p12_ic_urine_mother, tng_p12_ic_venous_blood_mother, tng_p12_ic_celspac_newsletter, tng_p12_ic_dl_celpac_studies, tng_p12_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 22 -- Pilot ID );
Date: 2025-12-05 17:02:29 Duration: 2s260ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__22"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__22__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG (nabor od 29.4.2022), Pilot ID: 22 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__role" text, "tng_p12_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__state" text, "tng_p12_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS activity ("subject_id" int, "tng_p12__activity_state" text, "tng_p12_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS created_at ("subject_id" int, "tng_p12__created_at" text, "tng_p12_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p12__accepted_at" text, "tng_p12_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p12__cancelled_at" text, "tng_p12_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p12__revoked_at" text, "tng_p12_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p12__paused_at" text, "tng_p12_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_buccal_swab_child'), ('tng_p12_ic_buccal_swab_mother'), ('tng_p12_ic_cord_blood_mother'), ('tng_p12_ic_drop_blood_child'), ('tng_p12_ic_stool_child'), ('tng_p12_ic_urine_mother'), ('tng_p12_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p12_ic_buccal_swab_child" text, "tng_p12_ic_buccal_swab_mother" text, "tng_p12_ic_cord_blood_mother" text, "tng_p12_ic_drop_blood_child" text, "tng_p12_ic_stool_child" text, "tng_p12_ic_urine_mother" text, "tng_p12_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_celspac_newsletter'), ('tng_p12_ic_dl_celpac_studies'), ('tng_p12_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p12_ic_celspac_newsletter" text, "tng_p12_ic_dl_celpac_studies" text, "tng_p12_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p12__role, psc_role.tng_p12_monitor__role, psc_state.tng_p12__state, psc_state.tng_p12_monitor__state, psc_activity_state.tng_p12__activity_state, psc_activity_state.tng_p12_monitor__activity_state, psc_created_at.tng_p12__created_at, psc_created_at.tng_p12_monitor__created_at, psc_accepted_at.tng_p12__accepted_at, psc_accepted_at.tng_p12_monitor__accepted_at, psc_cancelled_at.tng_p12__cancelled_at, psc_cancelled_at.tng_p12_monitor__cancelled_at, psc_revoked_at.tng_p12__revoked_at, psc_revoked_at.tng_p12_monitor__revoked_at, psc_paused_at.tng_p12__paused_at, psc_paused_at.tng_p12_monitor__paused_at, tng_p12_ic_buccal_swab_child, tng_p12_ic_buccal_swab_mother, tng_p12_ic_cord_blood_mother, tng_p12_ic_drop_blood_child, tng_p12_ic_stool_child, tng_p12_ic_urine_mother, tng_p12_ic_venous_blood_mother, tng_p12_ic_celspac_newsletter, tng_p12_ic_dl_celpac_studies, tng_p12_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 22 -- Pilot ID );
Date: 2025-12-05 05:02:28 Duration: 2s205ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__22"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__22__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG (nabor od 29.4.2022), Pilot ID: 22 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__role" text, "tng_p12_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__state" text, "tng_p12_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS activity ("subject_id" int, "tng_p12__activity_state" text, "tng_p12_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS created_at ("subject_id" int, "tng_p12__created_at" text, "tng_p12_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p12__accepted_at" text, "tng_p12_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p12__cancelled_at" text, "tng_p12_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p12__revoked_at" text, "tng_p12_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p12__paused_at" text, "tng_p12_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_buccal_swab_child'), ('tng_p12_ic_buccal_swab_mother'), ('tng_p12_ic_cord_blood_mother'), ('tng_p12_ic_drop_blood_child'), ('tng_p12_ic_stool_child'), ('tng_p12_ic_urine_mother'), ('tng_p12_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p12_ic_buccal_swab_child" text, "tng_p12_ic_buccal_swab_mother" text, "tng_p12_ic_cord_blood_mother" text, "tng_p12_ic_drop_blood_child" text, "tng_p12_ic_stool_child" text, "tng_p12_ic_urine_mother" text, "tng_p12_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_celspac_newsletter'), ('tng_p12_ic_dl_celpac_studies'), ('tng_p12_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p12_ic_celspac_newsletter" text, "tng_p12_ic_dl_celpac_studies" text, "tng_p12_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p12__role, psc_role.tng_p12_monitor__role, psc_state.tng_p12__state, psc_state.tng_p12_monitor__state, psc_activity_state.tng_p12__activity_state, psc_activity_state.tng_p12_monitor__activity_state, psc_created_at.tng_p12__created_at, psc_created_at.tng_p12_monitor__created_at, psc_accepted_at.tng_p12__accepted_at, psc_accepted_at.tng_p12_monitor__accepted_at, psc_cancelled_at.tng_p12__cancelled_at, psc_cancelled_at.tng_p12_monitor__cancelled_at, psc_revoked_at.tng_p12__revoked_at, psc_revoked_at.tng_p12_monitor__revoked_at, psc_paused_at.tng_p12__paused_at, psc_paused_at.tng_p12_monitor__paused_at, tng_p12_ic_buccal_swab_child, tng_p12_ic_buccal_swab_mother, tng_p12_ic_cord_blood_mother, tng_p12_ic_drop_blood_child, tng_p12_ic_stool_child, tng_p12_ic_urine_mother, tng_p12_ic_venous_blood_mother, tng_p12_ic_celspac_newsletter, tng_p12_ic_dl_celpac_studies, tng_p12_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 22 -- Pilot ID );
Date: 2025-12-03 17:02:30 Duration: 2s195ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
16 25s568ms 18,421 0ms 54ms 1ms select string_agg(s0_.name::text, ?) as sclr_0 from core.subject_inform_consent s1_ left join core.subcohort_inform_consent s2_ on s1_.subcohort_inform_consent_id = s2_.id left join core.subcohort s0_ on s2_.subcohort_id = s0_.id left join core.pilot p3_ on s0_.pilot_id = p3_.id left join core.cohort c4_ on p3_.cohort_id = c4_.id where s1_.subject_about_id = ? and p3_.default_subcohort_id = s2_.subcohort_id and s0_.inform_consent_id = s2_.info_consent_id group by s1_.subject_about_id;Times Reported Time consuming queries #16
Day Hour Count Duration Avg duration Nov 30 15 100 128ms 1ms Dec 01 06 100 125ms 1ms 07 298 600ms 2ms 08 412 564ms 1ms 09 634 866ms 1ms 10 733 1s31ms 1ms 11 1,247 1s666ms 1ms 12 857 1s240ms 1ms 13 103 130ms 1ms 14 124 173ms 1ms 15 101 141ms 1ms 23 305 383ms 1ms Dec 02 06 205 280ms 1ms 07 839 1s132ms 1ms 08 977 1s341ms 1ms 09 228 313ms 1ms 10 259 342ms 1ms 11 317 435ms 1ms 12 550 786ms 1ms 13 342 468ms 1ms 14 103 146ms 1ms 15 101 126ms 1ms Dec 03 06 102 133ms 1ms 07 113 148ms 1ms 08 1,061 1s440ms 1ms 09 1,041 1s400ms 1ms 10 200 254ms 1ms 11 1,565 2s83ms 1ms 12 369 516ms 1ms 13 102 128ms 1ms 14 212 285ms 1ms 15 4 6ms 1ms Dec 04 07 121 186ms 1ms 08 335 453ms 1ms 09 573 797ms 1ms 10 342 453ms 1ms 11 11 20ms 1ms 12 202 267ms 1ms 13 303 398ms 1ms 14 100 127ms 1ms 15 208 282ms 1ms 16 117 177ms 1ms Dec 05 07 365 668ms 1ms 08 220 357ms 1ms 09 223 323ms 1ms 10 333 488ms 1ms 11 302 403ms 1ms 12 100 132ms 1ms 13 680 956ms 1ms 14 182 249ms 1ms [ User: tng_migration_user - Total duration: 25s568ms - Times executed: 18421 ]
[ Application: [unknown] - Total duration: 25s568ms - Times executed: 18421 ]
-
SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = '48865' AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;
Date: 2025-12-05 07:20:35 Duration: 54ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = '43359' AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;
Date: 2025-12-05 08:08:23 Duration: 48ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = '2603' AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;
Date: 2025-12-04 15:39:14 Duration: 8ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
17 25s171ms 13 932ms 10s479ms 1s936ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__1__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "tng_p08__role" text, "tng_p08_test__role" text, "tng_pilot_8__monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "tng_p08__state" text, "tng_p08_test__state" text, "tng_pilot_8__monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as activity ("subject_id" int, "tng_p08__activity_state" text, "tng_p08_test__activity_state" text, "tng_pilot_8__monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as created_at ("subject_id" int, "tng_p08__created_at" text, "tng_p08_test__created_at" text, "tng_pilot_8__monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "tng_p08__accepted_at" text, "tng_p08_test__accepted_at" text, "tng_pilot_8__monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "tng_p08__cancelled_at" text, "tng_p08_test__cancelled_at" text, "tng_pilot_8__monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "tng_p08__revoked_at" text, "tng_p08_test__revoked_at" text, "tng_pilot_8__monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as paused_at ("subject_id" int, "tng_p08__paused_at" text, "tng_p08_test__paused_at" text, "tng_pilot_8__monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "tng_p08_ic_buccal_swab_child" text, "tng_p08_ic_buccal_swab_mother" text, "tng_p08_ic_cord_blood_mother" text, "tng_p08_ic_drop_blood_child" text, "tng_p08_ic_stool_child" text, "tng_p08_ic_urine_mother" text, "tng_p08_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "tng_p08_ic_follow_up_studies" text, "tng_p08_ic_med_find" text, "tng_p08_test_ic_follow_up_studies" text, "tng_p08_test_ic_med_find" text, "tng_pilot_8__monitor_ic_follow_up_studies" text, "tng_pilot_8__monitor_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.tng_p08__role, psc_role.tng_p08_test__role, psc_role.tng_pilot_8__monitor__role, psc_state.tng_p08__state, psc_state.tng_p08_test__state, psc_state.tng_pilot_8__monitor__state, psc_activity_state.tng_p08__activity_state, psc_activity_state.tng_p08_test__activity_state, psc_activity_state.tng_pilot_8__monitor__activity_state, psc_created_at.tng_p08__created_at, psc_created_at.tng_p08_test__created_at, psc_created_at.tng_pilot_8__monitor__created_at, psc_accepted_at.tng_p08__accepted_at, psc_accepted_at.tng_p08_test__accepted_at, psc_accepted_at.tng_pilot_8__monitor__accepted_at, psc_cancelled_at.tng_p08__cancelled_at, psc_cancelled_at.tng_p08_test__cancelled_at, psc_cancelled_at.tng_pilot_8__monitor__cancelled_at, psc_revoked_at.tng_p08__revoked_at, psc_revoked_at.tng_p08_test__revoked_at, psc_revoked_at.tng_pilot_8__monitor__revoked_at, psc_paused_at.tng_p08__paused_at, psc_paused_at.tng_p08_test__paused_at, psc_paused_at.tng_pilot_8__monitor__paused_at, tng_p08_ic_buccal_swab_child, tng_p08_ic_buccal_swab_mother, tng_p08_ic_cord_blood_mother, tng_p08_ic_drop_blood_child, tng_p08_ic_stool_child, tng_p08_ic_urine_mother, tng_p08_ic_venous_blood_mother, tng_p08_ic_follow_up_studies, tng_p08_ic_med_find, tng_p08_test_ic_follow_up_studies, tng_p08_test_ic_med_find, tng_pilot_8__monitor_ic_follow_up_studies, tng_pilot_8__monitor_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #17
Day Hour Count Duration Avg duration Nov 30 05 1 958ms 958ms 17 1 1s264ms 1s264ms Dec 01 05 1 1s476ms 1s476ms 17 1 1s337ms 1s337ms Dec 02 05 1 1s217ms 1s217ms 17 1 1s145ms 1s145ms Dec 03 17 1 1s319ms 1s319ms Dec 04 05 1 1s134ms 1s134ms 17 1 10s479ms 10s479ms Dec 05 05 1 1s402ms 1s402ms 17 1 1s269ms 1s269ms Dec 06 05 1 932ms 932ms 17 1 1s233ms 1s233ms [ User: tng_migration_user - Total duration: 25s171ms - Times executed: 13 ]
[ Application: dbt - Total duration: 25s171ms - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__1"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__1__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot VIII, Pilot ID: 1 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__role" text, "tng_p08_test__role" text, "tng_pilot_8__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__state" text, "tng_p08_test__state" text, "tng_pilot_8__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS activity ("subject_id" int, "tng_p08__activity_state" text, "tng_p08_test__activity_state" text, "tng_pilot_8__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS created_at ("subject_id" int, "tng_p08__created_at" text, "tng_p08_test__created_at" text, "tng_pilot_8__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p08__accepted_at" text, "tng_p08_test__accepted_at" text, "tng_pilot_8__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p08__cancelled_at" text, "tng_p08_test__cancelled_at" text, "tng_pilot_8__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p08__revoked_at" text, "tng_p08_test__revoked_at" text, "tng_pilot_8__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS paused_at ("subject_id" int, "tng_p08__paused_at" text, "tng_p08_test__paused_at" text, "tng_pilot_8__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_buccal_swab_child'), ('tng_p08_ic_buccal_swab_mother'), ('tng_p08_ic_cord_blood_mother'), ('tng_p08_ic_drop_blood_child'), ('tng_p08_ic_stool_child'), ('tng_p08_ic_urine_mother'), ('tng_p08_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p08_ic_buccal_swab_child" text, "tng_p08_ic_buccal_swab_mother" text, "tng_p08_ic_cord_blood_mother" text, "tng_p08_ic_drop_blood_child" text, "tng_p08_ic_stool_child" text, "tng_p08_ic_urine_mother" text, "tng_p08_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_follow_up_studies'), ('tng_p08_ic_med_find'), ('tng_p08_test_ic_follow_up_studies'), ('tng_p08_test_ic_med_find'), ('tng_pilot_8__monitor_ic_follow_up_studies'), ('tng_pilot_8__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p08_ic_follow_up_studies" text, "tng_p08_ic_med_find" text, "tng_p08_test_ic_follow_up_studies" text, "tng_p08_test_ic_med_find" text, "tng_pilot_8__monitor_ic_follow_up_studies" text, "tng_pilot_8__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p08__role, psc_role.tng_p08_test__role, psc_role.tng_pilot_8__monitor__role, psc_state.tng_p08__state, psc_state.tng_p08_test__state, psc_state.tng_pilot_8__monitor__state, psc_activity_state.tng_p08__activity_state, psc_activity_state.tng_p08_test__activity_state, psc_activity_state.tng_pilot_8__monitor__activity_state, psc_created_at.tng_p08__created_at, psc_created_at.tng_p08_test__created_at, psc_created_at.tng_pilot_8__monitor__created_at, psc_accepted_at.tng_p08__accepted_at, psc_accepted_at.tng_p08_test__accepted_at, psc_accepted_at.tng_pilot_8__monitor__accepted_at, psc_cancelled_at.tng_p08__cancelled_at, psc_cancelled_at.tng_p08_test__cancelled_at, psc_cancelled_at.tng_pilot_8__monitor__cancelled_at, psc_revoked_at.tng_p08__revoked_at, psc_revoked_at.tng_p08_test__revoked_at, psc_revoked_at.tng_pilot_8__monitor__revoked_at, psc_paused_at.tng_p08__paused_at, psc_paused_at.tng_p08_test__paused_at, psc_paused_at.tng_pilot_8__monitor__paused_at, tng_p08_ic_buccal_swab_child, tng_p08_ic_buccal_swab_mother, tng_p08_ic_cord_blood_mother, tng_p08_ic_drop_blood_child, tng_p08_ic_stool_child, tng_p08_ic_urine_mother, tng_p08_ic_venous_blood_mother, tng_p08_ic_follow_up_studies, tng_p08_ic_med_find, tng_p08_test_ic_follow_up_studies, tng_p08_test_ic_med_find, tng_pilot_8__monitor_ic_follow_up_studies, tng_pilot_8__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 1 -- Pilot ID );
Date: 2025-12-04 17:02:31 Duration: 10s479ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__1"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__1__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot VIII, Pilot ID: 1 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__role" text, "tng_p08_test__role" text, "tng_pilot_8__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__state" text, "tng_p08_test__state" text, "tng_pilot_8__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS activity ("subject_id" int, "tng_p08__activity_state" text, "tng_p08_test__activity_state" text, "tng_pilot_8__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS created_at ("subject_id" int, "tng_p08__created_at" text, "tng_p08_test__created_at" text, "tng_pilot_8__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p08__accepted_at" text, "tng_p08_test__accepted_at" text, "tng_pilot_8__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p08__cancelled_at" text, "tng_p08_test__cancelled_at" text, "tng_pilot_8__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p08__revoked_at" text, "tng_p08_test__revoked_at" text, "tng_pilot_8__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS paused_at ("subject_id" int, "tng_p08__paused_at" text, "tng_p08_test__paused_at" text, "tng_pilot_8__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_buccal_swab_child'), ('tng_p08_ic_buccal_swab_mother'), ('tng_p08_ic_cord_blood_mother'), ('tng_p08_ic_drop_blood_child'), ('tng_p08_ic_stool_child'), ('tng_p08_ic_urine_mother'), ('tng_p08_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p08_ic_buccal_swab_child" text, "tng_p08_ic_buccal_swab_mother" text, "tng_p08_ic_cord_blood_mother" text, "tng_p08_ic_drop_blood_child" text, "tng_p08_ic_stool_child" text, "tng_p08_ic_urine_mother" text, "tng_p08_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_follow_up_studies'), ('tng_p08_ic_med_find'), ('tng_p08_test_ic_follow_up_studies'), ('tng_p08_test_ic_med_find'), ('tng_pilot_8__monitor_ic_follow_up_studies'), ('tng_pilot_8__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p08_ic_follow_up_studies" text, "tng_p08_ic_med_find" text, "tng_p08_test_ic_follow_up_studies" text, "tng_p08_test_ic_med_find" text, "tng_pilot_8__monitor_ic_follow_up_studies" text, "tng_pilot_8__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p08__role, psc_role.tng_p08_test__role, psc_role.tng_pilot_8__monitor__role, psc_state.tng_p08__state, psc_state.tng_p08_test__state, psc_state.tng_pilot_8__monitor__state, psc_activity_state.tng_p08__activity_state, psc_activity_state.tng_p08_test__activity_state, psc_activity_state.tng_pilot_8__monitor__activity_state, psc_created_at.tng_p08__created_at, psc_created_at.tng_p08_test__created_at, psc_created_at.tng_pilot_8__monitor__created_at, psc_accepted_at.tng_p08__accepted_at, psc_accepted_at.tng_p08_test__accepted_at, psc_accepted_at.tng_pilot_8__monitor__accepted_at, psc_cancelled_at.tng_p08__cancelled_at, psc_cancelled_at.tng_p08_test__cancelled_at, psc_cancelled_at.tng_pilot_8__monitor__cancelled_at, psc_revoked_at.tng_p08__revoked_at, psc_revoked_at.tng_p08_test__revoked_at, psc_revoked_at.tng_pilot_8__monitor__revoked_at, psc_paused_at.tng_p08__paused_at, psc_paused_at.tng_p08_test__paused_at, psc_paused_at.tng_pilot_8__monitor__paused_at, tng_p08_ic_buccal_swab_child, tng_p08_ic_buccal_swab_mother, tng_p08_ic_cord_blood_mother, tng_p08_ic_drop_blood_child, tng_p08_ic_stool_child, tng_p08_ic_urine_mother, tng_p08_ic_venous_blood_mother, tng_p08_ic_follow_up_studies, tng_p08_ic_med_find, tng_p08_test_ic_follow_up_studies, tng_p08_test_ic_med_find, tng_pilot_8__monitor_ic_follow_up_studies, tng_pilot_8__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 1 -- Pilot ID );
Date: 2025-12-01 05:02:22 Duration: 1s476ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__1"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__1__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot VIII, Pilot ID: 1 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__role" text, "tng_p08_test__role" text, "tng_pilot_8__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__state" text, "tng_p08_test__state" text, "tng_pilot_8__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS activity ("subject_id" int, "tng_p08__activity_state" text, "tng_p08_test__activity_state" text, "tng_pilot_8__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS created_at ("subject_id" int, "tng_p08__created_at" text, "tng_p08_test__created_at" text, "tng_pilot_8__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p08__accepted_at" text, "tng_p08_test__accepted_at" text, "tng_pilot_8__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p08__cancelled_at" text, "tng_p08_test__cancelled_at" text, "tng_pilot_8__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p08__revoked_at" text, "tng_p08_test__revoked_at" text, "tng_pilot_8__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS paused_at ("subject_id" int, "tng_p08__paused_at" text, "tng_p08_test__paused_at" text, "tng_pilot_8__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_buccal_swab_child'), ('tng_p08_ic_buccal_swab_mother'), ('tng_p08_ic_cord_blood_mother'), ('tng_p08_ic_drop_blood_child'), ('tng_p08_ic_stool_child'), ('tng_p08_ic_urine_mother'), ('tng_p08_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p08_ic_buccal_swab_child" text, "tng_p08_ic_buccal_swab_mother" text, "tng_p08_ic_cord_blood_mother" text, "tng_p08_ic_drop_blood_child" text, "tng_p08_ic_stool_child" text, "tng_p08_ic_urine_mother" text, "tng_p08_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_follow_up_studies'), ('tng_p08_ic_med_find'), ('tng_p08_test_ic_follow_up_studies'), ('tng_p08_test_ic_med_find'), ('tng_pilot_8__monitor_ic_follow_up_studies'), ('tng_pilot_8__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p08_ic_follow_up_studies" text, "tng_p08_ic_med_find" text, "tng_p08_test_ic_follow_up_studies" text, "tng_p08_test_ic_med_find" text, "tng_pilot_8__monitor_ic_follow_up_studies" text, "tng_pilot_8__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p08__role, psc_role.tng_p08_test__role, psc_role.tng_pilot_8__monitor__role, psc_state.tng_p08__state, psc_state.tng_p08_test__state, psc_state.tng_pilot_8__monitor__state, psc_activity_state.tng_p08__activity_state, psc_activity_state.tng_p08_test__activity_state, psc_activity_state.tng_pilot_8__monitor__activity_state, psc_created_at.tng_p08__created_at, psc_created_at.tng_p08_test__created_at, psc_created_at.tng_pilot_8__monitor__created_at, psc_accepted_at.tng_p08__accepted_at, psc_accepted_at.tng_p08_test__accepted_at, psc_accepted_at.tng_pilot_8__monitor__accepted_at, psc_cancelled_at.tng_p08__cancelled_at, psc_cancelled_at.tng_p08_test__cancelled_at, psc_cancelled_at.tng_pilot_8__monitor__cancelled_at, psc_revoked_at.tng_p08__revoked_at, psc_revoked_at.tng_p08_test__revoked_at, psc_revoked_at.tng_pilot_8__monitor__revoked_at, psc_paused_at.tng_p08__paused_at, psc_paused_at.tng_p08_test__paused_at, psc_paused_at.tng_pilot_8__monitor__paused_at, tng_p08_ic_buccal_swab_child, tng_p08_ic_buccal_swab_mother, tng_p08_ic_cord_blood_mother, tng_p08_ic_drop_blood_child, tng_p08_ic_stool_child, tng_p08_ic_urine_mother, tng_p08_ic_venous_blood_mother, tng_p08_ic_follow_up_studies, tng_p08_ic_med_find, tng_p08_test_ic_follow_up_studies, tng_p08_test_ic_med_find, tng_pilot_8__monitor_ic_follow_up_studies, tng_pilot_8__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 1 -- Pilot ID );
Date: 2025-12-05 05:02:23 Duration: 1s402ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
18 19s497ms 13 1s31ms 2s107ms 1s499ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__11__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p09__role" text, "tng_p09__role" text, "tng_pilot_9__form_fix_2019_06__role" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__role" text, "tng_pilot_9__monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p09__state" text, "tng_p09__state" text, "tng_pilot_9__form_fix_2019_06__state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__state" text, "tng_pilot_9__monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "dust_p01_tng_p09__activity_state" text, "tng_p09__activity_state" text, "tng_pilot_9__form_fix_2019_06__activity_state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state" text, "tng_pilot_9__monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "dust_p01_tng_p09__created_at" text, "tng_p09__created_at" text, "tng_pilot_9__form_fix_2019_06__created_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__created_at" text, "tng_pilot_9__monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "dust_p01_tng_p09__accepted_at" text, "tng_p09__accepted_at" text, "tng_pilot_9__form_fix_2019_06__accepted_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at" text, "tng_pilot_9__monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "dust_p01_tng_p09__cancelled_at" text, "tng_p09__cancelled_at" text, "tng_pilot_9__form_fix_2019_06__cancelled_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at" text, "tng_pilot_9__monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "dust_p01_tng_p09__revoked_at" text, "tng_p09__revoked_at" text, "tng_pilot_9__form_fix_2019_06__revoked_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at" text, "tng_pilot_9__monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "dust_p01_tng_p09__paused_at" text, "tng_p09__paused_at" text, "tng_pilot_9__form_fix_2019_06__paused_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at" text, "tng_pilot_9__monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "dust_p01_tng_p09_ic_dust_mother" text, "tng_p09_ic_buccal_swab_child" text, "tng_p09_ic_buccal_swab_mother" text, "tng_p09_ic_cord_blood_mother" text, "tng_p09_ic_drop_blood_child" text, "tng_p09_ic_stool_child" text, "tng_p09_ic_urine_mother" text, "tng_p09_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "dust_p01_tng_p09_ic_dl_celpac_studies" text, "dust_p01_tng_p09_ic_survey" text, "tng_p09_ic_follow_up_studies" text, "tng_p09_ic_med_find" text, "tng_pilot_9__monitor_ic_follow_up_studies" text, "tng_pilot_9__monitor_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.dust_p01_tng_p09__role, psc_role.tng_p09__role, psc_role.tng_pilot_9__form_fix_2019_06__role, psc_role.tng_pilot_9__form_fix_mm38p01_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p02_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p03_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p04_v2_v2__role, psc_role.tng_pilot_9__monitor__role, psc_state.dust_p01_tng_p09__state, psc_state.tng_p09__state, psc_state.tng_pilot_9__form_fix_2019_06__state, psc_state.tng_pilot_9__form_fix_mm38p01_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p02_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p03_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p04_v2_v2__state, psc_state.tng_pilot_9__monitor__state, psc_activity_state.dust_p01_tng_p09__activity_state, psc_activity_state.tng_p09__activity_state, psc_activity_state.tng_pilot_9__form_fix_2019_06__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state, psc_activity_state.tng_pilot_9__monitor__activity_state, psc_created_at.dust_p01_tng_p09__created_at, psc_created_at.tng_p09__created_at, psc_created_at.tng_pilot_9__form_fix_2019_06__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p01_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p02_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p03_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p04_v2_v2__created_at, psc_created_at.tng_pilot_9__monitor__created_at, psc_accepted_at.dust_p01_tng_p09__accepted_at, psc_accepted_at.tng_p09__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_2019_06__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p09__cancelled_at, psc_cancelled_at.tng_p09__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_2019_06__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p09__revoked_at, psc_revoked_at.tng_p09__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_2019_06__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__monitor__revoked_at, psc_paused_at.dust_p01_tng_p09__paused_at, psc_paused_at.tng_p09__paused_at, psc_paused_at.tng_pilot_9__form_fix_2019_06__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at, psc_paused_at.tng_pilot_9__monitor__paused_at, dust_p01_tng_p09_ic_dust_mother, tng_p09_ic_buccal_swab_child, tng_p09_ic_buccal_swab_mother, tng_p09_ic_cord_blood_mother, tng_p09_ic_drop_blood_child, tng_p09_ic_stool_child, tng_p09_ic_urine_mother, tng_p09_ic_venous_blood_mother, dust_p01_tng_p09_ic_dl_celpac_studies, dust_p01_tng_p09_ic_survey, tng_p09_ic_follow_up_studies, tng_p09_ic_med_find, tng_pilot_9__monitor_ic_follow_up_studies, tng_pilot_9__monitor_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #18
Day Hour Count Duration Avg duration Nov 30 05 1 1s31ms 1s31ms 17 1 1s687ms 1s687ms Dec 01 05 1 1s536ms 1s536ms 17 1 1s818ms 1s818ms Dec 02 05 1 1s635ms 1s635ms 17 1 1s132ms 1s132ms Dec 03 17 1 2s107ms 2s107ms Dec 04 05 1 1s37ms 1s37ms 17 1 1s103ms 1s103ms Dec 05 05 1 1s804ms 1s804ms 17 1 1s641ms 1s641ms Dec 06 05 1 1s202ms 1s202ms 17 1 1s757ms 1s757ms [ User: tng_migration_user - Total duration: 19s497ms - Times executed: 13 ]
[ Application: dbt - Total duration: 19s497ms - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__11"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__11__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot IX, Pilot ID: 11 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__role" text, "tng_p09__role" text, "tng_pilot_9__form_fix_2019_06__role" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__role" text, "tng_pilot_9__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__state" text, "tng_p09__state" text, "tng_pilot_9__form_fix_2019_06__state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__state" text, "tng_pilot_9__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p09__activity_state" text, "tng_p09__activity_state" text, "tng_pilot_9__form_fix_2019_06__activity_state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state" text, "tng_pilot_9__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p09__created_at" text, "tng_p09__created_at" text, "tng_pilot_9__form_fix_2019_06__created_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__created_at" text, "tng_pilot_9__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p09__accepted_at" text, "tng_p09__accepted_at" text, "tng_pilot_9__form_fix_2019_06__accepted_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at" text, "tng_pilot_9__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p09__cancelled_at" text, "tng_p09__cancelled_at" text, "tng_pilot_9__form_fix_2019_06__cancelled_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at" text, "tng_pilot_9__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p09__revoked_at" text, "tng_p09__revoked_at" text, "tng_pilot_9__form_fix_2019_06__revoked_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at" text, "tng_pilot_9__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p09__paused_at" text, "tng_p09__paused_at" text, "tng_pilot_9__form_fix_2019_06__paused_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at" text, "tng_pilot_9__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dust_mother'), ('tng_p09_ic_buccal_swab_child'), ('tng_p09_ic_buccal_swab_mother'), ('tng_p09_ic_cord_blood_mother'), ('tng_p09_ic_drop_blood_child'), ('tng_p09_ic_stool_child'), ('tng_p09_ic_urine_mother'), ('tng_p09_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p09_ic_dust_mother" text, "tng_p09_ic_buccal_swab_child" text, "tng_p09_ic_buccal_swab_mother" text, "tng_p09_ic_cord_blood_mother" text, "tng_p09_ic_drop_blood_child" text, "tng_p09_ic_stool_child" text, "tng_p09_ic_urine_mother" text, "tng_p09_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dl_celpac_studies'), ('dust_p01_tng_p09_ic_survey'), ('tng_p09_ic_follow_up_studies'), ('tng_p09_ic_med_find'), ('tng_pilot_9__monitor_ic_follow_up_studies'), ('tng_pilot_9__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p09_ic_dl_celpac_studies" text, "dust_p01_tng_p09_ic_survey" text, "tng_p09_ic_follow_up_studies" text, "tng_p09_ic_med_find" text, "tng_pilot_9__monitor_ic_follow_up_studies" text, "tng_pilot_9__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p09__role, psc_role.tng_p09__role, psc_role.tng_pilot_9__form_fix_2019_06__role, psc_role.tng_pilot_9__form_fix_mm38p01_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p02_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p03_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p04_v2_v2__role, psc_role.tng_pilot_9__monitor__role, psc_state.dust_p01_tng_p09__state, psc_state.tng_p09__state, psc_state.tng_pilot_9__form_fix_2019_06__state, psc_state.tng_pilot_9__form_fix_mm38p01_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p02_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p03_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p04_v2_v2__state, psc_state.tng_pilot_9__monitor__state, psc_activity_state.dust_p01_tng_p09__activity_state, psc_activity_state.tng_p09__activity_state, psc_activity_state.tng_pilot_9__form_fix_2019_06__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state, psc_activity_state.tng_pilot_9__monitor__activity_state, psc_created_at.dust_p01_tng_p09__created_at, psc_created_at.tng_p09__created_at, psc_created_at.tng_pilot_9__form_fix_2019_06__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p01_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p02_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p03_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p04_v2_v2__created_at, psc_created_at.tng_pilot_9__monitor__created_at, psc_accepted_at.dust_p01_tng_p09__accepted_at, psc_accepted_at.tng_p09__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_2019_06__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p09__cancelled_at, psc_cancelled_at.tng_p09__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_2019_06__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p09__revoked_at, psc_revoked_at.tng_p09__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_2019_06__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__monitor__revoked_at, psc_paused_at.dust_p01_tng_p09__paused_at, psc_paused_at.tng_p09__paused_at, psc_paused_at.tng_pilot_9__form_fix_2019_06__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at, psc_paused_at.tng_pilot_9__monitor__paused_at, dust_p01_tng_p09_ic_dust_mother, tng_p09_ic_buccal_swab_child, tng_p09_ic_buccal_swab_mother, tng_p09_ic_cord_blood_mother, tng_p09_ic_drop_blood_child, tng_p09_ic_stool_child, tng_p09_ic_urine_mother, tng_p09_ic_venous_blood_mother, dust_p01_tng_p09_ic_dl_celpac_studies, dust_p01_tng_p09_ic_survey, tng_p09_ic_follow_up_studies, tng_p09_ic_med_find, tng_pilot_9__monitor_ic_follow_up_studies, tng_pilot_9__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 11 -- Pilot ID );
Date: 2025-12-03 17:02:24 Duration: 2s107ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__11"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__11__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot IX, Pilot ID: 11 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__role" text, "tng_p09__role" text, "tng_pilot_9__form_fix_2019_06__role" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__role" text, "tng_pilot_9__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__state" text, "tng_p09__state" text, "tng_pilot_9__form_fix_2019_06__state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__state" text, "tng_pilot_9__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p09__activity_state" text, "tng_p09__activity_state" text, "tng_pilot_9__form_fix_2019_06__activity_state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state" text, "tng_pilot_9__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p09__created_at" text, "tng_p09__created_at" text, "tng_pilot_9__form_fix_2019_06__created_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__created_at" text, "tng_pilot_9__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p09__accepted_at" text, "tng_p09__accepted_at" text, "tng_pilot_9__form_fix_2019_06__accepted_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at" text, "tng_pilot_9__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p09__cancelled_at" text, "tng_p09__cancelled_at" text, "tng_pilot_9__form_fix_2019_06__cancelled_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at" text, "tng_pilot_9__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p09__revoked_at" text, "tng_p09__revoked_at" text, "tng_pilot_9__form_fix_2019_06__revoked_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at" text, "tng_pilot_9__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p09__paused_at" text, "tng_p09__paused_at" text, "tng_pilot_9__form_fix_2019_06__paused_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at" text, "tng_pilot_9__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dust_mother'), ('tng_p09_ic_buccal_swab_child'), ('tng_p09_ic_buccal_swab_mother'), ('tng_p09_ic_cord_blood_mother'), ('tng_p09_ic_drop_blood_child'), ('tng_p09_ic_stool_child'), ('tng_p09_ic_urine_mother'), ('tng_p09_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p09_ic_dust_mother" text, "tng_p09_ic_buccal_swab_child" text, "tng_p09_ic_buccal_swab_mother" text, "tng_p09_ic_cord_blood_mother" text, "tng_p09_ic_drop_blood_child" text, "tng_p09_ic_stool_child" text, "tng_p09_ic_urine_mother" text, "tng_p09_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dl_celpac_studies'), ('dust_p01_tng_p09_ic_survey'), ('tng_p09_ic_follow_up_studies'), ('tng_p09_ic_med_find'), ('tng_pilot_9__monitor_ic_follow_up_studies'), ('tng_pilot_9__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p09_ic_dl_celpac_studies" text, "dust_p01_tng_p09_ic_survey" text, "tng_p09_ic_follow_up_studies" text, "tng_p09_ic_med_find" text, "tng_pilot_9__monitor_ic_follow_up_studies" text, "tng_pilot_9__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p09__role, psc_role.tng_p09__role, psc_role.tng_pilot_9__form_fix_2019_06__role, psc_role.tng_pilot_9__form_fix_mm38p01_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p02_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p03_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p04_v2_v2__role, psc_role.tng_pilot_9__monitor__role, psc_state.dust_p01_tng_p09__state, psc_state.tng_p09__state, psc_state.tng_pilot_9__form_fix_2019_06__state, psc_state.tng_pilot_9__form_fix_mm38p01_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p02_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p03_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p04_v2_v2__state, psc_state.tng_pilot_9__monitor__state, psc_activity_state.dust_p01_tng_p09__activity_state, psc_activity_state.tng_p09__activity_state, psc_activity_state.tng_pilot_9__form_fix_2019_06__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state, psc_activity_state.tng_pilot_9__monitor__activity_state, psc_created_at.dust_p01_tng_p09__created_at, psc_created_at.tng_p09__created_at, psc_created_at.tng_pilot_9__form_fix_2019_06__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p01_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p02_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p03_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p04_v2_v2__created_at, psc_created_at.tng_pilot_9__monitor__created_at, psc_accepted_at.dust_p01_tng_p09__accepted_at, psc_accepted_at.tng_p09__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_2019_06__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p09__cancelled_at, psc_cancelled_at.tng_p09__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_2019_06__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p09__revoked_at, psc_revoked_at.tng_p09__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_2019_06__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__monitor__revoked_at, psc_paused_at.dust_p01_tng_p09__paused_at, psc_paused_at.tng_p09__paused_at, psc_paused_at.tng_pilot_9__form_fix_2019_06__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at, psc_paused_at.tng_pilot_9__monitor__paused_at, dust_p01_tng_p09_ic_dust_mother, tng_p09_ic_buccal_swab_child, tng_p09_ic_buccal_swab_mother, tng_p09_ic_cord_blood_mother, tng_p09_ic_drop_blood_child, tng_p09_ic_stool_child, tng_p09_ic_urine_mother, tng_p09_ic_venous_blood_mother, dust_p01_tng_p09_ic_dl_celpac_studies, dust_p01_tng_p09_ic_survey, tng_p09_ic_follow_up_studies, tng_p09_ic_med_find, tng_pilot_9__monitor_ic_follow_up_studies, tng_pilot_9__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 11 -- Pilot ID );
Date: 2025-12-01 17:02:23 Duration: 1s818ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__11"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__11__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot IX, Pilot ID: 11 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__role" text, "tng_p09__role" text, "tng_pilot_9__form_fix_2019_06__role" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__role" text, "tng_pilot_9__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__state" text, "tng_p09__state" text, "tng_pilot_9__form_fix_2019_06__state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__state" text, "tng_pilot_9__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p09__activity_state" text, "tng_p09__activity_state" text, "tng_pilot_9__form_fix_2019_06__activity_state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state" text, "tng_pilot_9__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p09__created_at" text, "tng_p09__created_at" text, "tng_pilot_9__form_fix_2019_06__created_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__created_at" text, "tng_pilot_9__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p09__accepted_at" text, "tng_p09__accepted_at" text, "tng_pilot_9__form_fix_2019_06__accepted_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at" text, "tng_pilot_9__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p09__cancelled_at" text, "tng_p09__cancelled_at" text, "tng_pilot_9__form_fix_2019_06__cancelled_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at" text, "tng_pilot_9__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p09__revoked_at" text, "tng_p09__revoked_at" text, "tng_pilot_9__form_fix_2019_06__revoked_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at" text, "tng_pilot_9__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p09__paused_at" text, "tng_p09__paused_at" text, "tng_pilot_9__form_fix_2019_06__paused_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at" text, "tng_pilot_9__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dust_mother'), ('tng_p09_ic_buccal_swab_child'), ('tng_p09_ic_buccal_swab_mother'), ('tng_p09_ic_cord_blood_mother'), ('tng_p09_ic_drop_blood_child'), ('tng_p09_ic_stool_child'), ('tng_p09_ic_urine_mother'), ('tng_p09_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p09_ic_dust_mother" text, "tng_p09_ic_buccal_swab_child" text, "tng_p09_ic_buccal_swab_mother" text, "tng_p09_ic_cord_blood_mother" text, "tng_p09_ic_drop_blood_child" text, "tng_p09_ic_stool_child" text, "tng_p09_ic_urine_mother" text, "tng_p09_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dl_celpac_studies'), ('dust_p01_tng_p09_ic_survey'), ('tng_p09_ic_follow_up_studies'), ('tng_p09_ic_med_find'), ('tng_pilot_9__monitor_ic_follow_up_studies'), ('tng_pilot_9__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p09_ic_dl_celpac_studies" text, "dust_p01_tng_p09_ic_survey" text, "tng_p09_ic_follow_up_studies" text, "tng_p09_ic_med_find" text, "tng_pilot_9__monitor_ic_follow_up_studies" text, "tng_pilot_9__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p09__role, psc_role.tng_p09__role, psc_role.tng_pilot_9__form_fix_2019_06__role, psc_role.tng_pilot_9__form_fix_mm38p01_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p02_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p03_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p04_v2_v2__role, psc_role.tng_pilot_9__monitor__role, psc_state.dust_p01_tng_p09__state, psc_state.tng_p09__state, psc_state.tng_pilot_9__form_fix_2019_06__state, psc_state.tng_pilot_9__form_fix_mm38p01_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p02_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p03_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p04_v2_v2__state, psc_state.tng_pilot_9__monitor__state, psc_activity_state.dust_p01_tng_p09__activity_state, psc_activity_state.tng_p09__activity_state, psc_activity_state.tng_pilot_9__form_fix_2019_06__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state, psc_activity_state.tng_pilot_9__monitor__activity_state, psc_created_at.dust_p01_tng_p09__created_at, psc_created_at.tng_p09__created_at, psc_created_at.tng_pilot_9__form_fix_2019_06__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p01_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p02_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p03_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p04_v2_v2__created_at, psc_created_at.tng_pilot_9__monitor__created_at, psc_accepted_at.dust_p01_tng_p09__accepted_at, psc_accepted_at.tng_p09__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_2019_06__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p09__cancelled_at, psc_cancelled_at.tng_p09__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_2019_06__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p09__revoked_at, psc_revoked_at.tng_p09__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_2019_06__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__monitor__revoked_at, psc_paused_at.dust_p01_tng_p09__paused_at, psc_paused_at.tng_p09__paused_at, psc_paused_at.tng_pilot_9__form_fix_2019_06__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at, psc_paused_at.tng_pilot_9__monitor__paused_at, dust_p01_tng_p09_ic_dust_mother, tng_p09_ic_buccal_swab_child, tng_p09_ic_buccal_swab_mother, tng_p09_ic_cord_blood_mother, tng_p09_ic_drop_blood_child, tng_p09_ic_stool_child, tng_p09_ic_urine_mother, tng_p09_ic_venous_blood_mother, dust_p01_tng_p09_ic_dl_celpac_studies, dust_p01_tng_p09_ic_survey, tng_p09_ic_follow_up_studies, tng_p09_ic_med_find, tng_pilot_9__monitor_ic_follow_up_studies, tng_pilot_9__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 11 -- Pilot ID );
Date: 2025-12-05 05:02:24 Duration: 1s804ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
19 19s96ms 13 662ms 1s911ms 1s468ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__15__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p02__role" text, "psycap_p02_old_ya_p02__role" text, "ya_p02__role" text, "ya_p02_digi_ya03v2__role" text, "ya_p02_digi_ya04v2__role" text, "ya_p02_digi_ya05v2__role" text, "ya_p02_test__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p02__state" text, "psycap_p02_old_ya_p02__state" text, "ya_p02__state" text, "ya_p02_digi_ya03v2__state" text, "ya_p02_digi_ya04v2__state" text, "ya_p02_digi_ya05v2__state" text, "ya_p02_test__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "psycap_p01_ya_p02__activity_state" text, "psycap_p02_old_ya_p02__activity_state" text, "ya_p02__activity_state" text, "ya_p02_digi_ya03v2__activity_state" text, "ya_p02_digi_ya04v2__activity_state" text, "ya_p02_digi_ya05v2__activity_state" text, "ya_p02_test__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "psycap_p01_ya_p02__created_at" text, "psycap_p02_old_ya_p02__created_at" text, "ya_p02__created_at" text, "ya_p02_digi_ya03v2__created_at" text, "ya_p02_digi_ya04v2__created_at" text, "ya_p02_digi_ya05v2__created_at" text, "ya_p02_test__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "psycap_p01_ya_p02__accepted_at" text, "psycap_p02_old_ya_p02__accepted_at" text, "ya_p02__accepted_at" text, "ya_p02_digi_ya03v2__accepted_at" text, "ya_p02_digi_ya04v2__accepted_at" text, "ya_p02_digi_ya05v2__accepted_at" text, "ya_p02_test__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "psycap_p01_ya_p02__cancelled_at" text, "psycap_p02_old_ya_p02__cancelled_at" text, "ya_p02__cancelled_at" text, "ya_p02_digi_ya03v2__cancelled_at" text, "ya_p02_digi_ya04v2__cancelled_at" text, "ya_p02_digi_ya05v2__cancelled_at" text, "ya_p02_test__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "psycap_p01_ya_p02__revoked_at" text, "psycap_p02_old_ya_p02__revoked_at" text, "ya_p02__revoked_at" text, "ya_p02_digi_ya03v2__revoked_at" text, "ya_p02_digi_ya04v2__revoked_at" text, "ya_p02_digi_ya05v2__revoked_at" text, "ya_p02_test__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "psycap_p01_ya_p02__paused_at" text, "psycap_p02_old_ya_p02__paused_at" text, "ya_p02__paused_at" text, "ya_p02_digi_ya03v2__paused_at" text, "ya_p02_digi_ya04v2__paused_at" text, "ya_p02_digi_ya05v2__paused_at" text, "ya_p02_test__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "ya_p02_ic_buccal_swab_proband" text, "ya_p02_ic_urine_proband" text, "ya_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "ya_p02_ic_anam_qs" text, "ya_p02_ic_aneurysm" text, "ya_p02_ic_anthropometry" text, "ya_p02_ic_arch_foot" text, "ya_p02_ic_basic_qs" text, "ya_p02_ic_blood_pressure" text, "ya_p02_ic_braces_piercing_iud" text, "ya_p02_ic_cognition_test" text, "ya_p02_ic_da_health_registry" text, "ya_p02_ic_dexa" text, "ya_p02_ic_enviro_qs" text, "ya_p02_ic_follow_up_studies" text, "ya_p02_ic_fracture_lower_body_last_3m" text, "ya_p02_ic_fracture_upper_body_last_3m" text, "ya_p02_ic_hand_grip" text, "ya_p02_ic_hearing_vision_impairment" text, "ya_p02_ic_heart_disease" text, "ya_p02_ic_hemoptysis_ns" text, "ya_p02_ic_hernia" text, "ya_p02_ic_hyperthyroidism" text, "ya_p02_ic_inability_hold_pencil" text, "ya_p02_ic_inability_stand_both_legs" text, "ya_p02_ic_inability_talk_cze" text, "ya_p02_ic_inability_walk" text, "ya_p02_ic_inbody" text, "ya_p02_ic_infectious_resp_diseases" text, "ya_p02_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p02_ic_knee_stability" text, "ya_p02_ic_nutri_qs" text, "ya_p02_ic_over_weight_200_height_195" text, "ya_p02_ic_pacemaker_defibrillator" text, "ya_p02_ic_pneumothorax" text, "ya_p02_ic_pregnancy" text, "ya_p02_ic_recent_eye_abdominal_chest_surgery" text, "ya_p02_ic_recent_myocardial_infarction" text, "ya_p02_ic_spirometry" text, "ya_p02_ic_surgical_metal_body" text, "ya_p02_ic_unstable_angina_pectoris" text, "ya_p02_ic_ya_dl_elspac" text, "ya_p02_ic_ya_med_find" text, "ya_p02_ic_ya_newsletter" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.psycap_p01_ya_p02__role, psc_role.psycap_p02_old_ya_p02__role, psc_role.ya_p02__role, psc_role.ya_p02_digi_ya03v2__role, psc_role.ya_p02_digi_ya04v2__role, psc_role.ya_p02_digi_ya05v2__role, psc_role.ya_p02_test__role, psc_state.psycap_p01_ya_p02__state, psc_state.psycap_p02_old_ya_p02__state, psc_state.ya_p02__state, psc_state.ya_p02_digi_ya03v2__state, psc_state.ya_p02_digi_ya04v2__state, psc_state.ya_p02_digi_ya05v2__state, psc_state.ya_p02_test__state, psc_activity_state.psycap_p01_ya_p02__activity_state, psc_activity_state.psycap_p02_old_ya_p02__activity_state, psc_activity_state.ya_p02__activity_state, psc_activity_state.ya_p02_digi_ya03v2__activity_state, psc_activity_state.ya_p02_digi_ya04v2__activity_state, psc_activity_state.ya_p02_digi_ya05v2__activity_state, psc_activity_state.ya_p02_test__activity_state, psc_created_at.psycap_p01_ya_p02__created_at, psc_created_at.psycap_p02_old_ya_p02__created_at, psc_created_at.ya_p02__created_at, psc_created_at.ya_p02_digi_ya03v2__created_at, psc_created_at.ya_p02_digi_ya04v2__created_at, psc_created_at.ya_p02_digi_ya05v2__created_at, psc_created_at.ya_p02_test__created_at, psc_accepted_at.psycap_p01_ya_p02__accepted_at, psc_accepted_at.psycap_p02_old_ya_p02__accepted_at, psc_accepted_at.ya_p02__accepted_at, psc_accepted_at.ya_p02_digi_ya03v2__accepted_at, psc_accepted_at.ya_p02_digi_ya04v2__accepted_at, psc_accepted_at.ya_p02_digi_ya05v2__accepted_at, psc_accepted_at.ya_p02_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p02__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p02__cancelled_at, psc_cancelled_at.ya_p02__cancelled_at, psc_cancelled_at.ya_p02_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p02_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p02__revoked_at, psc_revoked_at.psycap_p02_old_ya_p02__revoked_at, psc_revoked_at.ya_p02__revoked_at, psc_revoked_at.ya_p02_digi_ya03v2__revoked_at, psc_revoked_at.ya_p02_digi_ya04v2__revoked_at, psc_revoked_at.ya_p02_digi_ya05v2__revoked_at, psc_revoked_at.ya_p02_test__revoked_at, psc_paused_at.psycap_p01_ya_p02__paused_at, psc_paused_at.psycap_p02_old_ya_p02__paused_at, psc_paused_at.ya_p02__paused_at, psc_paused_at.ya_p02_digi_ya03v2__paused_at, psc_paused_at.ya_p02_digi_ya04v2__paused_at, psc_paused_at.ya_p02_digi_ya05v2__paused_at, psc_paused_at.ya_p02_test__paused_at, ya_p02_ic_buccal_swab_proband, ya_p02_ic_urine_proband, ya_p02_ic_venous_blood_proband, ya_p02_ic_anam_qs, ya_p02_ic_aneurysm, ya_p02_ic_anthropometry, ya_p02_ic_arch_foot, ya_p02_ic_basic_qs, ya_p02_ic_blood_pressure, ya_p02_ic_braces_piercing_iud, ya_p02_ic_cognition_test, ya_p02_ic_da_health_registry, ya_p02_ic_dexa, ya_p02_ic_enviro_qs, ya_p02_ic_follow_up_studies, ya_p02_ic_fracture_lower_body_last_3m, ya_p02_ic_fracture_upper_body_last_3m, ya_p02_ic_hand_grip, ya_p02_ic_hearing_vision_impairment, ya_p02_ic_heart_disease, ya_p02_ic_hemoptysis_ns, ya_p02_ic_hernia, ya_p02_ic_hyperthyroidism, ya_p02_ic_inability_hold_pencil, ya_p02_ic_inability_stand_both_legs, ya_p02_ic_inability_talk_cze, ya_p02_ic_inability_walk, ya_p02_ic_inbody, ya_p02_ic_infectious_resp_diseases, ya_p02_ic_iodine_barium_radioisotopes_last_7d, ya_p02_ic_knee_stability, ya_p02_ic_nutri_qs, ya_p02_ic_over_weight_200_height_195, ya_p02_ic_pacemaker_defibrillator, ya_p02_ic_pneumothorax, ya_p02_ic_pregnancy, ya_p02_ic_recent_eye_abdominal_chest_surgery, ya_p02_ic_recent_myocardial_infarction, ya_p02_ic_spirometry, ya_p02_ic_surgical_metal_body, ya_p02_ic_unstable_angina_pectoris, ya_p02_ic_ya_dl_elspac, ya_p02_ic_ya_med_find, ya_p02_ic_ya_newsletter from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #19
Day Hour Count Duration Avg duration Nov 30 05 1 1s50ms 1s50ms 17 1 1s768ms 1s768ms Dec 01 05 1 1s892ms 1s892ms 17 1 1s774ms 1s774ms Dec 02 05 1 1s615ms 1s615ms 17 1 1s82ms 1s82ms Dec 03 17 1 1s911ms 1s911ms Dec 04 05 1 662ms 662ms 17 1 1s196ms 1s196ms Dec 05 05 1 1s779ms 1s779ms 17 1 1s729ms 1s729ms Dec 06 05 1 981ms 981ms 17 1 1s650ms 1s650ms [ User: tng_migration_user - Total duration: 19s96ms - Times executed: 13 ]
[ Application: dbt - Total duration: 19s96ms - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__15"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__15__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA, Pilot ID: 15 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__role" text, "psycap_p02_old_ya_p02__role" text, "ya_p02__role" text, "ya_p02_digi_ya03v2__role" text, "ya_p02_digi_ya04v2__role" text, "ya_p02_digi_ya05v2__role" text, "ya_p02_test__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__state" text, "psycap_p02_old_ya_p02__state" text, "ya_p02__state" text, "ya_p02_digi_ya03v2__state" text, "ya_p02_digi_ya04v2__state" text, "ya_p02_digi_ya05v2__state" text, "ya_p02_test__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p02__activity_state" text, "psycap_p02_old_ya_p02__activity_state" text, "ya_p02__activity_state" text, "ya_p02_digi_ya03v2__activity_state" text, "ya_p02_digi_ya04v2__activity_state" text, "ya_p02_digi_ya05v2__activity_state" text, "ya_p02_test__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p02__created_at" text, "psycap_p02_old_ya_p02__created_at" text, "ya_p02__created_at" text, "ya_p02_digi_ya03v2__created_at" text, "ya_p02_digi_ya04v2__created_at" text, "ya_p02_digi_ya05v2__created_at" text, "ya_p02_test__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p02__accepted_at" text, "psycap_p02_old_ya_p02__accepted_at" text, "ya_p02__accepted_at" text, "ya_p02_digi_ya03v2__accepted_at" text, "ya_p02_digi_ya04v2__accepted_at" text, "ya_p02_digi_ya05v2__accepted_at" text, "ya_p02_test__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p02__cancelled_at" text, "psycap_p02_old_ya_p02__cancelled_at" text, "ya_p02__cancelled_at" text, "ya_p02_digi_ya03v2__cancelled_at" text, "ya_p02_digi_ya04v2__cancelled_at" text, "ya_p02_digi_ya05v2__cancelled_at" text, "ya_p02_test__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p02__revoked_at" text, "psycap_p02_old_ya_p02__revoked_at" text, "ya_p02__revoked_at" text, "ya_p02_digi_ya03v2__revoked_at" text, "ya_p02_digi_ya04v2__revoked_at" text, "ya_p02_digi_ya05v2__revoked_at" text, "ya_p02_test__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p02__paused_at" text, "psycap_p02_old_ya_p02__paused_at" text, "ya_p02__paused_at" text, "ya_p02_digi_ya03v2__paused_at" text, "ya_p02_digi_ya04v2__paused_at" text, "ya_p02_digi_ya05v2__paused_at" text, "ya_p02_test__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_buccal_swab_proband'), ('ya_p02_ic_urine_proband'), ('ya_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p02_ic_buccal_swab_proband" text, "ya_p02_ic_urine_proband" text, "ya_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_anam_qs'), ('ya_p02_ic_aneurysm'), ('ya_p02_ic_anthropometry'), ('ya_p02_ic_arch_foot'), ('ya_p02_ic_basic_qs'), ('ya_p02_ic_blood_pressure'), ('ya_p02_ic_braces_piercing_iud'), ('ya_p02_ic_cognition_test'), ('ya_p02_ic_da_health_registry'), ('ya_p02_ic_dexa'), ('ya_p02_ic_enviro_qs'), ('ya_p02_ic_follow_up_studies'), ('ya_p02_ic_fracture_lower_body_last_3m'), ('ya_p02_ic_fracture_upper_body_last_3m'), ('ya_p02_ic_hand_grip'), ('ya_p02_ic_hearing_vision_impairment'), ('ya_p02_ic_heart_disease'), ('ya_p02_ic_hemoptysis_ns'), ('ya_p02_ic_hernia'), ('ya_p02_ic_hyperthyroidism'), ('ya_p02_ic_inability_hold_pencil'), ('ya_p02_ic_inability_stand_both_legs'), ('ya_p02_ic_inability_talk_cze'), ('ya_p02_ic_inability_walk'), ('ya_p02_ic_inbody'), ('ya_p02_ic_infectious_resp_diseases'), ('ya_p02_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p02_ic_knee_stability'), ('ya_p02_ic_nutri_qs'), ('ya_p02_ic_over_weight_200_height_195'), ('ya_p02_ic_pacemaker_defibrillator'), ('ya_p02_ic_pneumothorax'), ('ya_p02_ic_pregnancy'), ('ya_p02_ic_recent_eye_abdominal_chest_surgery'), ('ya_p02_ic_recent_myocardial_infarction'), ('ya_p02_ic_spirometry'), ('ya_p02_ic_surgical_metal_body'), ('ya_p02_ic_unstable_angina_pectoris'), ('ya_p02_ic_ya_dl_elspac'), ('ya_p02_ic_ya_med_find'), ('ya_p02_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p02_ic_anam_qs" text, "ya_p02_ic_aneurysm" text, "ya_p02_ic_anthropometry" text, "ya_p02_ic_arch_foot" text, "ya_p02_ic_basic_qs" text, "ya_p02_ic_blood_pressure" text, "ya_p02_ic_braces_piercing_iud" text, "ya_p02_ic_cognition_test" text, "ya_p02_ic_da_health_registry" text, "ya_p02_ic_dexa" text, "ya_p02_ic_enviro_qs" text, "ya_p02_ic_follow_up_studies" text, "ya_p02_ic_fracture_lower_body_last_3m" text, "ya_p02_ic_fracture_upper_body_last_3m" text, "ya_p02_ic_hand_grip" text, "ya_p02_ic_hearing_vision_impairment" text, "ya_p02_ic_heart_disease" text, "ya_p02_ic_hemoptysis_ns" text, "ya_p02_ic_hernia" text, "ya_p02_ic_hyperthyroidism" text, "ya_p02_ic_inability_hold_pencil" text, "ya_p02_ic_inability_stand_both_legs" text, "ya_p02_ic_inability_talk_cze" text, "ya_p02_ic_inability_walk" text, "ya_p02_ic_inbody" text, "ya_p02_ic_infectious_resp_diseases" text, "ya_p02_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p02_ic_knee_stability" text, "ya_p02_ic_nutri_qs" text, "ya_p02_ic_over_weight_200_height_195" text, "ya_p02_ic_pacemaker_defibrillator" text, "ya_p02_ic_pneumothorax" text, "ya_p02_ic_pregnancy" text, "ya_p02_ic_recent_eye_abdominal_chest_surgery" text, "ya_p02_ic_recent_myocardial_infarction" text, "ya_p02_ic_spirometry" text, "ya_p02_ic_surgical_metal_body" text, "ya_p02_ic_unstable_angina_pectoris" text, "ya_p02_ic_ya_dl_elspac" text, "ya_p02_ic_ya_med_find" text, "ya_p02_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p02__role, psc_role.psycap_p02_old_ya_p02__role, psc_role.ya_p02__role, psc_role.ya_p02_digi_ya03v2__role, psc_role.ya_p02_digi_ya04v2__role, psc_role.ya_p02_digi_ya05v2__role, psc_role.ya_p02_test__role, psc_state.psycap_p01_ya_p02__state, psc_state.psycap_p02_old_ya_p02__state, psc_state.ya_p02__state, psc_state.ya_p02_digi_ya03v2__state, psc_state.ya_p02_digi_ya04v2__state, psc_state.ya_p02_digi_ya05v2__state, psc_state.ya_p02_test__state, psc_activity_state.psycap_p01_ya_p02__activity_state, psc_activity_state.psycap_p02_old_ya_p02__activity_state, psc_activity_state.ya_p02__activity_state, psc_activity_state.ya_p02_digi_ya03v2__activity_state, psc_activity_state.ya_p02_digi_ya04v2__activity_state, psc_activity_state.ya_p02_digi_ya05v2__activity_state, psc_activity_state.ya_p02_test__activity_state, psc_created_at.psycap_p01_ya_p02__created_at, psc_created_at.psycap_p02_old_ya_p02__created_at, psc_created_at.ya_p02__created_at, psc_created_at.ya_p02_digi_ya03v2__created_at, psc_created_at.ya_p02_digi_ya04v2__created_at, psc_created_at.ya_p02_digi_ya05v2__created_at, psc_created_at.ya_p02_test__created_at, psc_accepted_at.psycap_p01_ya_p02__accepted_at, psc_accepted_at.psycap_p02_old_ya_p02__accepted_at, psc_accepted_at.ya_p02__accepted_at, psc_accepted_at.ya_p02_digi_ya03v2__accepted_at, psc_accepted_at.ya_p02_digi_ya04v2__accepted_at, psc_accepted_at.ya_p02_digi_ya05v2__accepted_at, psc_accepted_at.ya_p02_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p02__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p02__cancelled_at, psc_cancelled_at.ya_p02__cancelled_at, psc_cancelled_at.ya_p02_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p02_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p02__revoked_at, psc_revoked_at.psycap_p02_old_ya_p02__revoked_at, psc_revoked_at.ya_p02__revoked_at, psc_revoked_at.ya_p02_digi_ya03v2__revoked_at, psc_revoked_at.ya_p02_digi_ya04v2__revoked_at, psc_revoked_at.ya_p02_digi_ya05v2__revoked_at, psc_revoked_at.ya_p02_test__revoked_at, psc_paused_at.psycap_p01_ya_p02__paused_at, psc_paused_at.psycap_p02_old_ya_p02__paused_at, psc_paused_at.ya_p02__paused_at, psc_paused_at.ya_p02_digi_ya03v2__paused_at, psc_paused_at.ya_p02_digi_ya04v2__paused_at, psc_paused_at.ya_p02_digi_ya05v2__paused_at, psc_paused_at.ya_p02_test__paused_at, ya_p02_ic_buccal_swab_proband, ya_p02_ic_urine_proband, ya_p02_ic_venous_blood_proband, ya_p02_ic_anam_qs, ya_p02_ic_aneurysm, ya_p02_ic_anthropometry, ya_p02_ic_arch_foot, ya_p02_ic_basic_qs, ya_p02_ic_blood_pressure, ya_p02_ic_braces_piercing_iud, ya_p02_ic_cognition_test, ya_p02_ic_da_health_registry, ya_p02_ic_dexa, ya_p02_ic_enviro_qs, ya_p02_ic_follow_up_studies, ya_p02_ic_fracture_lower_body_last_3m, ya_p02_ic_fracture_upper_body_last_3m, ya_p02_ic_hand_grip, ya_p02_ic_hearing_vision_impairment, ya_p02_ic_heart_disease, ya_p02_ic_hemoptysis_ns, ya_p02_ic_hernia, ya_p02_ic_hyperthyroidism, ya_p02_ic_inability_hold_pencil, ya_p02_ic_inability_stand_both_legs, ya_p02_ic_inability_talk_cze, ya_p02_ic_inability_walk, ya_p02_ic_inbody, ya_p02_ic_infectious_resp_diseases, ya_p02_ic_iodine_barium_radioisotopes_last_7d, ya_p02_ic_knee_stability, ya_p02_ic_nutri_qs, ya_p02_ic_over_weight_200_height_195, ya_p02_ic_pacemaker_defibrillator, ya_p02_ic_pneumothorax, ya_p02_ic_pregnancy, ya_p02_ic_recent_eye_abdominal_chest_surgery, ya_p02_ic_recent_myocardial_infarction, ya_p02_ic_spirometry, ya_p02_ic_surgical_metal_body, ya_p02_ic_unstable_angina_pectoris, ya_p02_ic_ya_dl_elspac, ya_p02_ic_ya_med_find, ya_p02_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 15 -- Pilot ID );
Date: 2025-12-03 17:02:26 Duration: 1s911ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__15"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__15__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA, Pilot ID: 15 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__role" text, "psycap_p02_old_ya_p02__role" text, "ya_p02__role" text, "ya_p02_digi_ya03v2__role" text, "ya_p02_digi_ya04v2__role" text, "ya_p02_digi_ya05v2__role" text, "ya_p02_test__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__state" text, "psycap_p02_old_ya_p02__state" text, "ya_p02__state" text, "ya_p02_digi_ya03v2__state" text, "ya_p02_digi_ya04v2__state" text, "ya_p02_digi_ya05v2__state" text, "ya_p02_test__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p02__activity_state" text, "psycap_p02_old_ya_p02__activity_state" text, "ya_p02__activity_state" text, "ya_p02_digi_ya03v2__activity_state" text, "ya_p02_digi_ya04v2__activity_state" text, "ya_p02_digi_ya05v2__activity_state" text, "ya_p02_test__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p02__created_at" text, "psycap_p02_old_ya_p02__created_at" text, "ya_p02__created_at" text, "ya_p02_digi_ya03v2__created_at" text, "ya_p02_digi_ya04v2__created_at" text, "ya_p02_digi_ya05v2__created_at" text, "ya_p02_test__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p02__accepted_at" text, "psycap_p02_old_ya_p02__accepted_at" text, "ya_p02__accepted_at" text, "ya_p02_digi_ya03v2__accepted_at" text, "ya_p02_digi_ya04v2__accepted_at" text, "ya_p02_digi_ya05v2__accepted_at" text, "ya_p02_test__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p02__cancelled_at" text, "psycap_p02_old_ya_p02__cancelled_at" text, "ya_p02__cancelled_at" text, "ya_p02_digi_ya03v2__cancelled_at" text, "ya_p02_digi_ya04v2__cancelled_at" text, "ya_p02_digi_ya05v2__cancelled_at" text, "ya_p02_test__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p02__revoked_at" text, "psycap_p02_old_ya_p02__revoked_at" text, "ya_p02__revoked_at" text, "ya_p02_digi_ya03v2__revoked_at" text, "ya_p02_digi_ya04v2__revoked_at" text, "ya_p02_digi_ya05v2__revoked_at" text, "ya_p02_test__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p02__paused_at" text, "psycap_p02_old_ya_p02__paused_at" text, "ya_p02__paused_at" text, "ya_p02_digi_ya03v2__paused_at" text, "ya_p02_digi_ya04v2__paused_at" text, "ya_p02_digi_ya05v2__paused_at" text, "ya_p02_test__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_buccal_swab_proband'), ('ya_p02_ic_urine_proband'), ('ya_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p02_ic_buccal_swab_proband" text, "ya_p02_ic_urine_proband" text, "ya_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_anam_qs'), ('ya_p02_ic_aneurysm'), ('ya_p02_ic_anthropometry'), ('ya_p02_ic_arch_foot'), ('ya_p02_ic_basic_qs'), ('ya_p02_ic_blood_pressure'), ('ya_p02_ic_braces_piercing_iud'), ('ya_p02_ic_cognition_test'), ('ya_p02_ic_da_health_registry'), ('ya_p02_ic_dexa'), ('ya_p02_ic_enviro_qs'), ('ya_p02_ic_follow_up_studies'), ('ya_p02_ic_fracture_lower_body_last_3m'), ('ya_p02_ic_fracture_upper_body_last_3m'), ('ya_p02_ic_hand_grip'), ('ya_p02_ic_hearing_vision_impairment'), ('ya_p02_ic_heart_disease'), ('ya_p02_ic_hemoptysis_ns'), ('ya_p02_ic_hernia'), ('ya_p02_ic_hyperthyroidism'), ('ya_p02_ic_inability_hold_pencil'), ('ya_p02_ic_inability_stand_both_legs'), ('ya_p02_ic_inability_talk_cze'), ('ya_p02_ic_inability_walk'), ('ya_p02_ic_inbody'), ('ya_p02_ic_infectious_resp_diseases'), ('ya_p02_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p02_ic_knee_stability'), ('ya_p02_ic_nutri_qs'), ('ya_p02_ic_over_weight_200_height_195'), ('ya_p02_ic_pacemaker_defibrillator'), ('ya_p02_ic_pneumothorax'), ('ya_p02_ic_pregnancy'), ('ya_p02_ic_recent_eye_abdominal_chest_surgery'), ('ya_p02_ic_recent_myocardial_infarction'), ('ya_p02_ic_spirometry'), ('ya_p02_ic_surgical_metal_body'), ('ya_p02_ic_unstable_angina_pectoris'), ('ya_p02_ic_ya_dl_elspac'), ('ya_p02_ic_ya_med_find'), ('ya_p02_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p02_ic_anam_qs" text, "ya_p02_ic_aneurysm" text, "ya_p02_ic_anthropometry" text, "ya_p02_ic_arch_foot" text, "ya_p02_ic_basic_qs" text, "ya_p02_ic_blood_pressure" text, "ya_p02_ic_braces_piercing_iud" text, "ya_p02_ic_cognition_test" text, "ya_p02_ic_da_health_registry" text, "ya_p02_ic_dexa" text, "ya_p02_ic_enviro_qs" text, "ya_p02_ic_follow_up_studies" text, "ya_p02_ic_fracture_lower_body_last_3m" text, "ya_p02_ic_fracture_upper_body_last_3m" text, "ya_p02_ic_hand_grip" text, "ya_p02_ic_hearing_vision_impairment" text, "ya_p02_ic_heart_disease" text, "ya_p02_ic_hemoptysis_ns" text, "ya_p02_ic_hernia" text, "ya_p02_ic_hyperthyroidism" text, "ya_p02_ic_inability_hold_pencil" text, "ya_p02_ic_inability_stand_both_legs" text, "ya_p02_ic_inability_talk_cze" text, "ya_p02_ic_inability_walk" text, "ya_p02_ic_inbody" text, "ya_p02_ic_infectious_resp_diseases" text, "ya_p02_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p02_ic_knee_stability" text, "ya_p02_ic_nutri_qs" text, "ya_p02_ic_over_weight_200_height_195" text, "ya_p02_ic_pacemaker_defibrillator" text, "ya_p02_ic_pneumothorax" text, "ya_p02_ic_pregnancy" text, "ya_p02_ic_recent_eye_abdominal_chest_surgery" text, "ya_p02_ic_recent_myocardial_infarction" text, "ya_p02_ic_spirometry" text, "ya_p02_ic_surgical_metal_body" text, "ya_p02_ic_unstable_angina_pectoris" text, "ya_p02_ic_ya_dl_elspac" text, "ya_p02_ic_ya_med_find" text, "ya_p02_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p02__role, psc_role.psycap_p02_old_ya_p02__role, psc_role.ya_p02__role, psc_role.ya_p02_digi_ya03v2__role, psc_role.ya_p02_digi_ya04v2__role, psc_role.ya_p02_digi_ya05v2__role, psc_role.ya_p02_test__role, psc_state.psycap_p01_ya_p02__state, psc_state.psycap_p02_old_ya_p02__state, psc_state.ya_p02__state, psc_state.ya_p02_digi_ya03v2__state, psc_state.ya_p02_digi_ya04v2__state, psc_state.ya_p02_digi_ya05v2__state, psc_state.ya_p02_test__state, psc_activity_state.psycap_p01_ya_p02__activity_state, psc_activity_state.psycap_p02_old_ya_p02__activity_state, psc_activity_state.ya_p02__activity_state, psc_activity_state.ya_p02_digi_ya03v2__activity_state, psc_activity_state.ya_p02_digi_ya04v2__activity_state, psc_activity_state.ya_p02_digi_ya05v2__activity_state, psc_activity_state.ya_p02_test__activity_state, psc_created_at.psycap_p01_ya_p02__created_at, psc_created_at.psycap_p02_old_ya_p02__created_at, psc_created_at.ya_p02__created_at, psc_created_at.ya_p02_digi_ya03v2__created_at, psc_created_at.ya_p02_digi_ya04v2__created_at, psc_created_at.ya_p02_digi_ya05v2__created_at, psc_created_at.ya_p02_test__created_at, psc_accepted_at.psycap_p01_ya_p02__accepted_at, psc_accepted_at.psycap_p02_old_ya_p02__accepted_at, psc_accepted_at.ya_p02__accepted_at, psc_accepted_at.ya_p02_digi_ya03v2__accepted_at, psc_accepted_at.ya_p02_digi_ya04v2__accepted_at, psc_accepted_at.ya_p02_digi_ya05v2__accepted_at, psc_accepted_at.ya_p02_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p02__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p02__cancelled_at, psc_cancelled_at.ya_p02__cancelled_at, psc_cancelled_at.ya_p02_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p02_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p02__revoked_at, psc_revoked_at.psycap_p02_old_ya_p02__revoked_at, psc_revoked_at.ya_p02__revoked_at, psc_revoked_at.ya_p02_digi_ya03v2__revoked_at, psc_revoked_at.ya_p02_digi_ya04v2__revoked_at, psc_revoked_at.ya_p02_digi_ya05v2__revoked_at, psc_revoked_at.ya_p02_test__revoked_at, psc_paused_at.psycap_p01_ya_p02__paused_at, psc_paused_at.psycap_p02_old_ya_p02__paused_at, psc_paused_at.ya_p02__paused_at, psc_paused_at.ya_p02_digi_ya03v2__paused_at, psc_paused_at.ya_p02_digi_ya04v2__paused_at, psc_paused_at.ya_p02_digi_ya05v2__paused_at, psc_paused_at.ya_p02_test__paused_at, ya_p02_ic_buccal_swab_proband, ya_p02_ic_urine_proband, ya_p02_ic_venous_blood_proband, ya_p02_ic_anam_qs, ya_p02_ic_aneurysm, ya_p02_ic_anthropometry, ya_p02_ic_arch_foot, ya_p02_ic_basic_qs, ya_p02_ic_blood_pressure, ya_p02_ic_braces_piercing_iud, ya_p02_ic_cognition_test, ya_p02_ic_da_health_registry, ya_p02_ic_dexa, ya_p02_ic_enviro_qs, ya_p02_ic_follow_up_studies, ya_p02_ic_fracture_lower_body_last_3m, ya_p02_ic_fracture_upper_body_last_3m, ya_p02_ic_hand_grip, ya_p02_ic_hearing_vision_impairment, ya_p02_ic_heart_disease, ya_p02_ic_hemoptysis_ns, ya_p02_ic_hernia, ya_p02_ic_hyperthyroidism, ya_p02_ic_inability_hold_pencil, ya_p02_ic_inability_stand_both_legs, ya_p02_ic_inability_talk_cze, ya_p02_ic_inability_walk, ya_p02_ic_inbody, ya_p02_ic_infectious_resp_diseases, ya_p02_ic_iodine_barium_radioisotopes_last_7d, ya_p02_ic_knee_stability, ya_p02_ic_nutri_qs, ya_p02_ic_over_weight_200_height_195, ya_p02_ic_pacemaker_defibrillator, ya_p02_ic_pneumothorax, ya_p02_ic_pregnancy, ya_p02_ic_recent_eye_abdominal_chest_surgery, ya_p02_ic_recent_myocardial_infarction, ya_p02_ic_spirometry, ya_p02_ic_surgical_metal_body, ya_p02_ic_unstable_angina_pectoris, ya_p02_ic_ya_dl_elspac, ya_p02_ic_ya_med_find, ya_p02_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 15 -- Pilot ID );
Date: 2025-12-01 05:02:25 Duration: 1s892ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__15"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__15__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA, Pilot ID: 15 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__role" text, "psycap_p02_old_ya_p02__role" text, "ya_p02__role" text, "ya_p02_digi_ya03v2__role" text, "ya_p02_digi_ya04v2__role" text, "ya_p02_digi_ya05v2__role" text, "ya_p02_test__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__state" text, "psycap_p02_old_ya_p02__state" text, "ya_p02__state" text, "ya_p02_digi_ya03v2__state" text, "ya_p02_digi_ya04v2__state" text, "ya_p02_digi_ya05v2__state" text, "ya_p02_test__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p02__activity_state" text, "psycap_p02_old_ya_p02__activity_state" text, "ya_p02__activity_state" text, "ya_p02_digi_ya03v2__activity_state" text, "ya_p02_digi_ya04v2__activity_state" text, "ya_p02_digi_ya05v2__activity_state" text, "ya_p02_test__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p02__created_at" text, "psycap_p02_old_ya_p02__created_at" text, "ya_p02__created_at" text, "ya_p02_digi_ya03v2__created_at" text, "ya_p02_digi_ya04v2__created_at" text, "ya_p02_digi_ya05v2__created_at" text, "ya_p02_test__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p02__accepted_at" text, "psycap_p02_old_ya_p02__accepted_at" text, "ya_p02__accepted_at" text, "ya_p02_digi_ya03v2__accepted_at" text, "ya_p02_digi_ya04v2__accepted_at" text, "ya_p02_digi_ya05v2__accepted_at" text, "ya_p02_test__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p02__cancelled_at" text, "psycap_p02_old_ya_p02__cancelled_at" text, "ya_p02__cancelled_at" text, "ya_p02_digi_ya03v2__cancelled_at" text, "ya_p02_digi_ya04v2__cancelled_at" text, "ya_p02_digi_ya05v2__cancelled_at" text, "ya_p02_test__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p02__revoked_at" text, "psycap_p02_old_ya_p02__revoked_at" text, "ya_p02__revoked_at" text, "ya_p02_digi_ya03v2__revoked_at" text, "ya_p02_digi_ya04v2__revoked_at" text, "ya_p02_digi_ya05v2__revoked_at" text, "ya_p02_test__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p02__paused_at" text, "psycap_p02_old_ya_p02__paused_at" text, "ya_p02__paused_at" text, "ya_p02_digi_ya03v2__paused_at" text, "ya_p02_digi_ya04v2__paused_at" text, "ya_p02_digi_ya05v2__paused_at" text, "ya_p02_test__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_buccal_swab_proband'), ('ya_p02_ic_urine_proband'), ('ya_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p02_ic_buccal_swab_proband" text, "ya_p02_ic_urine_proband" text, "ya_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_anam_qs'), ('ya_p02_ic_aneurysm'), ('ya_p02_ic_anthropometry'), ('ya_p02_ic_arch_foot'), ('ya_p02_ic_basic_qs'), ('ya_p02_ic_blood_pressure'), ('ya_p02_ic_braces_piercing_iud'), ('ya_p02_ic_cognition_test'), ('ya_p02_ic_da_health_registry'), ('ya_p02_ic_dexa'), ('ya_p02_ic_enviro_qs'), ('ya_p02_ic_follow_up_studies'), ('ya_p02_ic_fracture_lower_body_last_3m'), ('ya_p02_ic_fracture_upper_body_last_3m'), ('ya_p02_ic_hand_grip'), ('ya_p02_ic_hearing_vision_impairment'), ('ya_p02_ic_heart_disease'), ('ya_p02_ic_hemoptysis_ns'), ('ya_p02_ic_hernia'), ('ya_p02_ic_hyperthyroidism'), ('ya_p02_ic_inability_hold_pencil'), ('ya_p02_ic_inability_stand_both_legs'), ('ya_p02_ic_inability_talk_cze'), ('ya_p02_ic_inability_walk'), ('ya_p02_ic_inbody'), ('ya_p02_ic_infectious_resp_diseases'), ('ya_p02_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p02_ic_knee_stability'), ('ya_p02_ic_nutri_qs'), ('ya_p02_ic_over_weight_200_height_195'), ('ya_p02_ic_pacemaker_defibrillator'), ('ya_p02_ic_pneumothorax'), ('ya_p02_ic_pregnancy'), ('ya_p02_ic_recent_eye_abdominal_chest_surgery'), ('ya_p02_ic_recent_myocardial_infarction'), ('ya_p02_ic_spirometry'), ('ya_p02_ic_surgical_metal_body'), ('ya_p02_ic_unstable_angina_pectoris'), ('ya_p02_ic_ya_dl_elspac'), ('ya_p02_ic_ya_med_find'), ('ya_p02_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p02_ic_anam_qs" text, "ya_p02_ic_aneurysm" text, "ya_p02_ic_anthropometry" text, "ya_p02_ic_arch_foot" text, "ya_p02_ic_basic_qs" text, "ya_p02_ic_blood_pressure" text, "ya_p02_ic_braces_piercing_iud" text, "ya_p02_ic_cognition_test" text, "ya_p02_ic_da_health_registry" text, "ya_p02_ic_dexa" text, "ya_p02_ic_enviro_qs" text, "ya_p02_ic_follow_up_studies" text, "ya_p02_ic_fracture_lower_body_last_3m" text, "ya_p02_ic_fracture_upper_body_last_3m" text, "ya_p02_ic_hand_grip" text, "ya_p02_ic_hearing_vision_impairment" text, "ya_p02_ic_heart_disease" text, "ya_p02_ic_hemoptysis_ns" text, "ya_p02_ic_hernia" text, "ya_p02_ic_hyperthyroidism" text, "ya_p02_ic_inability_hold_pencil" text, "ya_p02_ic_inability_stand_both_legs" text, "ya_p02_ic_inability_talk_cze" text, "ya_p02_ic_inability_walk" text, "ya_p02_ic_inbody" text, "ya_p02_ic_infectious_resp_diseases" text, "ya_p02_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p02_ic_knee_stability" text, "ya_p02_ic_nutri_qs" text, "ya_p02_ic_over_weight_200_height_195" text, "ya_p02_ic_pacemaker_defibrillator" text, "ya_p02_ic_pneumothorax" text, "ya_p02_ic_pregnancy" text, "ya_p02_ic_recent_eye_abdominal_chest_surgery" text, "ya_p02_ic_recent_myocardial_infarction" text, "ya_p02_ic_spirometry" text, "ya_p02_ic_surgical_metal_body" text, "ya_p02_ic_unstable_angina_pectoris" text, "ya_p02_ic_ya_dl_elspac" text, "ya_p02_ic_ya_med_find" text, "ya_p02_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p02__role, psc_role.psycap_p02_old_ya_p02__role, psc_role.ya_p02__role, psc_role.ya_p02_digi_ya03v2__role, psc_role.ya_p02_digi_ya04v2__role, psc_role.ya_p02_digi_ya05v2__role, psc_role.ya_p02_test__role, psc_state.psycap_p01_ya_p02__state, psc_state.psycap_p02_old_ya_p02__state, psc_state.ya_p02__state, psc_state.ya_p02_digi_ya03v2__state, psc_state.ya_p02_digi_ya04v2__state, psc_state.ya_p02_digi_ya05v2__state, psc_state.ya_p02_test__state, psc_activity_state.psycap_p01_ya_p02__activity_state, psc_activity_state.psycap_p02_old_ya_p02__activity_state, psc_activity_state.ya_p02__activity_state, psc_activity_state.ya_p02_digi_ya03v2__activity_state, psc_activity_state.ya_p02_digi_ya04v2__activity_state, psc_activity_state.ya_p02_digi_ya05v2__activity_state, psc_activity_state.ya_p02_test__activity_state, psc_created_at.psycap_p01_ya_p02__created_at, psc_created_at.psycap_p02_old_ya_p02__created_at, psc_created_at.ya_p02__created_at, psc_created_at.ya_p02_digi_ya03v2__created_at, psc_created_at.ya_p02_digi_ya04v2__created_at, psc_created_at.ya_p02_digi_ya05v2__created_at, psc_created_at.ya_p02_test__created_at, psc_accepted_at.psycap_p01_ya_p02__accepted_at, psc_accepted_at.psycap_p02_old_ya_p02__accepted_at, psc_accepted_at.ya_p02__accepted_at, psc_accepted_at.ya_p02_digi_ya03v2__accepted_at, psc_accepted_at.ya_p02_digi_ya04v2__accepted_at, psc_accepted_at.ya_p02_digi_ya05v2__accepted_at, psc_accepted_at.ya_p02_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p02__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p02__cancelled_at, psc_cancelled_at.ya_p02__cancelled_at, psc_cancelled_at.ya_p02_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p02_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p02__revoked_at, psc_revoked_at.psycap_p02_old_ya_p02__revoked_at, psc_revoked_at.ya_p02__revoked_at, psc_revoked_at.ya_p02_digi_ya03v2__revoked_at, psc_revoked_at.ya_p02_digi_ya04v2__revoked_at, psc_revoked_at.ya_p02_digi_ya05v2__revoked_at, psc_revoked_at.ya_p02_test__revoked_at, psc_paused_at.psycap_p01_ya_p02__paused_at, psc_paused_at.psycap_p02_old_ya_p02__paused_at, psc_paused_at.ya_p02__paused_at, psc_paused_at.ya_p02_digi_ya03v2__paused_at, psc_paused_at.ya_p02_digi_ya04v2__paused_at, psc_paused_at.ya_p02_digi_ya05v2__paused_at, psc_paused_at.ya_p02_test__paused_at, ya_p02_ic_buccal_swab_proband, ya_p02_ic_urine_proband, ya_p02_ic_venous_blood_proband, ya_p02_ic_anam_qs, ya_p02_ic_aneurysm, ya_p02_ic_anthropometry, ya_p02_ic_arch_foot, ya_p02_ic_basic_qs, ya_p02_ic_blood_pressure, ya_p02_ic_braces_piercing_iud, ya_p02_ic_cognition_test, ya_p02_ic_da_health_registry, ya_p02_ic_dexa, ya_p02_ic_enviro_qs, ya_p02_ic_follow_up_studies, ya_p02_ic_fracture_lower_body_last_3m, ya_p02_ic_fracture_upper_body_last_3m, ya_p02_ic_hand_grip, ya_p02_ic_hearing_vision_impairment, ya_p02_ic_heart_disease, ya_p02_ic_hemoptysis_ns, ya_p02_ic_hernia, ya_p02_ic_hyperthyroidism, ya_p02_ic_inability_hold_pencil, ya_p02_ic_inability_stand_both_legs, ya_p02_ic_inability_talk_cze, ya_p02_ic_inability_walk, ya_p02_ic_inbody, ya_p02_ic_infectious_resp_diseases, ya_p02_ic_iodine_barium_radioisotopes_last_7d, ya_p02_ic_knee_stability, ya_p02_ic_nutri_qs, ya_p02_ic_over_weight_200_height_195, ya_p02_ic_pacemaker_defibrillator, ya_p02_ic_pneumothorax, ya_p02_ic_pregnancy, ya_p02_ic_recent_eye_abdominal_chest_surgery, ya_p02_ic_recent_myocardial_infarction, ya_p02_ic_spirometry, ya_p02_ic_surgical_metal_body, ya_p02_ic_unstable_angina_pectoris, ya_p02_ic_ya_dl_elspac, ya_p02_ic_ya_med_find, ya_p02_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 15 -- Pilot ID );
Date: 2025-12-05 05:02:24 Duration: 1s779ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
20 17s841ms 14 1s188ms 1s619ms 1s274ms create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( with ranked_table_con as ( select *, row_number() over (partition by subject_id, type_code order by priority desc ) as ranked_row from "celspac"."core"."contact" where value -> ? = ?), ranked_table_contact as ( select *, row_number() over (partition by subject_id, type_code order by priority desc ) as ranked_row from "celspac"."core"."contact"), max_prio_perm as ( select * from ranked_table_con where ranked_row = ?), contact_table_max_prio as ( select * from ranked_table_contact where ranked_row = ?), contact_d as ( select distinct subject_id, replace((value -> ?)::text, ?, ? ) AS city, replace((value -> ?)::text, ?, ? ) as postal_code, replace((value -> ?)::text, ?, ? ) AS country, replace((value -> ?)::text, ?, ? ) as street, replace((value -> ?)::text, ?, ? ) AS street_number, replace((value -> ?)::text, ?, ? ) as permanent from max_prio_perm con where con.type_code = ?), contact_d_c as ( select distinct subject_id, replace((value -> ?)::text, ?, ? ) AS city, replace((value -> ?)::text, ?, ? ) as postal_code, replace((value -> ?)::text, ?, ? ) AS country, replace((value -> ?)::text, ?, ? ) as street, replace((value -> ?)::text, ?, ? ) AS street_number, replace((value -> ?)::text, ?, ? ) as permanent from contact_table_max_prio con where con.type_code = ?), con_email as ( select subject_id, replace(value::text, ?, ? ) AS email FROM contact_table_max_prio con WHERE con.type_code = ?), con_ph AS ( SELECT subject_id, replace(value::text, ?, ? ) as phone_number from contact_table_max_prio where type_code = ? ) select s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number as street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street as street_contact, con_d_c.street_number as street_number_contact, con_d_c.city as city_contact, con_d_c.postal_code as postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* from "celspac"."core"."subject" s left join "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se on se.subject_id = s.id left join "celspac"."core"."subject_dead" s_dead on s.id = s_dead.subject_id left join contact_d con_d on con_d.subject_id = s.id left join contact_d_c con_d_c on con_d_c.subject_id = s.id left join con_email c_e on c_e.subject_id = s.id left join con_ph c_p on c_p.subject_id = s.id );Times Reported Time consuming queries #20
Day Hour Count Duration Avg duration Nov 30 05 1 1s209ms 1s209ms 17 1 1s233ms 1s233ms Dec 01 05 1 1s269ms 1s269ms 17 1 1s223ms 1s223ms Dec 02 05 1 1s232ms 1s232ms 17 1 1s221ms 1s221ms Dec 03 05 1 1s382ms 1s382ms 17 1 1s210ms 1s210ms Dec 04 05 1 1s299ms 1s299ms 17 1 1s261ms 1s261ms Dec 05 05 1 1s619ms 1s619ms 17 1 1s188ms 1s188ms Dec 06 05 1 1s270ms 1s270ms 17 1 1s219ms 1s219ms [ User: tng_migration_user - Total duration: 17s841ms - Times executed: 14 ]
[ Application: dbt - Total duration: 17s841ms - Times executed: 14 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );
Date: 2025-12-05 05:02:20 Duration: 1s619ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );
Date: 2025-12-03 05:02:20 Duration: 1s382ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );
Date: 2025-12-04 05:02:19 Duration: 1s299ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
Most frequent queries (N)
Rank Times executed Total duration Min duration Max duration Avg duration Query 1 449,652 8s576ms 0ms 3ms 0ms select t0.is_archived as is_archived_1, t0.created_at as created_at_2, t0.updated_at as updated_at_3, t0.code as code_4, t0.name as name_5, t0.description as description_6 from core.notif_type t0 inner join core.notif_type_state on t0.code = core.notif_type_state.notif_type_code where core.notif_type_state.notif_state_code = ?;Times Reported Time consuming queries #1
Day Hour Count Duration Avg duration Nov 30 00 2,520 47ms 0ms 01 2,520 46ms 0ms 02 2,520 47ms 0ms 03 2,520 47ms 0ms 04 2,520 47ms 0ms 05 2,527 47ms 0ms 06 2,737 50ms 0ms 07 2,730 51ms 0ms 08 2,730 50ms 0ms 09 2,730 50ms 0ms 10 2,730 51ms 0ms 11 2,730 51ms 0ms 12 2,730 50ms 0ms 13 2,730 50ms 0ms 14 2,730 50ms 0ms 15 2,730 51ms 0ms 16 2,730 51ms 0ms 17 2,702 49ms 0ms 18 2,730 50ms 0ms 19 2,730 50ms 0ms 20 2,730 51ms 0ms 21 2,730 50ms 0ms 22 2,730 50ms 0ms 23 2,576 47ms 0ms Dec 01 00 2,520 47ms 0ms 01 2,520 47ms 0ms 02 2,520 47ms 0ms 03 2,520 47ms 0ms 04 2,520 46ms 0ms 05 2,527 50ms 0ms 06 2,737 50ms 0ms 07 2,730 50ms 0ms 08 2,730 49ms 0ms 09 2,730 50ms 0ms 10 2,730 50ms 0ms 11 2,723 50ms 0ms 12 2,730 50ms 0ms 13 2,730 50ms 0ms 14 2,730 49ms 0ms 15 2,730 50ms 0ms 16 2,730 51ms 0ms 17 2,702 48ms 0ms 18 2,737 48ms 0ms 19 2,730 48ms 0ms 20 2,730 48ms 0ms 21 2,730 49ms 0ms 22 2,730 49ms 0ms 23 2,730 49ms 0ms Dec 02 00 2,520 44ms 0ms 01 2,520 45ms 0ms 02 2,520 44ms 0ms 03 2,520 44ms 0ms 04 2,520 45ms 0ms 05 2,527 46ms 0ms 06 2,737 52ms 0ms 07 2,730 50ms 0ms 08 2,737 52ms 0ms 09 2,730 50ms 0ms 10 2,730 51ms 0ms 11 2,730 50ms 0ms 12 2,730 50ms 0ms 13 2,730 50ms 0ms 14 2,730 50ms 0ms 15 2,730 50ms 0ms 16 2,730 51ms 0ms 17 2,709 50ms 0ms 18 2,737 51ms 0ms 19 2,730 51ms 0ms 20 2,730 51ms 0ms 21 2,730 51ms 0ms 22 2,730 52ms 0ms 23 2,730 50ms 0ms Dec 03 00 2,520 47ms 0ms 01 2,520 47ms 0ms 02 2,520 48ms 0ms 03 2,520 47ms 0ms 04 2,520 46ms 0ms 05 2,527 46ms 0ms 06 2,737 51ms 0ms 07 2,737 50ms 0ms 08 2,730 50ms 0ms 09 2,737 51ms 0ms 10 2,737 51ms 0ms 11 2,730 50ms 0ms 12 2,730 51ms 0ms 13 2,737 50ms 0ms 14 2,730 51ms 0ms 15 2,730 50ms 0ms 16 2,730 51ms 0ms 17 2,702 48ms 0ms 18 2,737 49ms 0ms 19 2,730 49ms 0ms 20 2,730 51ms 0ms 21 2,730 50ms 0ms 22 2,730 51ms 0ms 23 2,730 51ms 0ms Dec 04 00 2,520 46ms 0ms 01 2,520 46ms 0ms 02 2,520 47ms 0ms 03 2,520 47ms 0ms 04 2,520 48ms 0ms 05 2,527 49ms 0ms 06 2,730 52ms 0ms 07 2,730 53ms 0ms 08 2,730 54ms 0ms 09 2,730 54ms 0ms 10 2,737 53ms 0ms 11 2,730 53ms 0ms 12 2,730 54ms 0ms 13 2,730 52ms 0ms 14 2,737 55ms 0ms 15 2,730 54ms 0ms 16 2,730 54ms 0ms 17 2,709 53ms 0ms 18 2,730 53ms 0ms 19 2,730 53ms 0ms 20 2,730 54ms 0ms 21 2,730 55ms 0ms 22 2,730 54ms 0ms 23 2,730 54ms 0ms Dec 05 00 2,520 51ms 0ms 01 2,520 50ms 0ms 02 2,520 49ms 0ms 03 2,520 49ms 0ms 04 2,520 50ms 0ms 05 2,527 49ms 0ms 06 2,737 53ms 0ms 07 2,737 53ms 0ms 08 2,730 53ms 0ms 09 2,730 54ms 0ms 10 2,737 53ms 0ms 11 2,730 53ms 0ms 12 2,730 54ms 0ms 13 2,730 54ms 0ms 14 2,730 54ms 0ms 15 2,730 53ms 0ms 16 2,730 54ms 0ms 17 2,702 52ms 0ms 18 2,730 54ms 0ms 19 2,730 53ms 0ms 20 2,730 54ms 0ms 21 2,730 55ms 0ms 22 2,730 54ms 0ms 23 2,730 54ms 0ms Dec 06 00 2,520 50ms 0ms 01 2,520 49ms 0ms 02 2,520 50ms 0ms 03 2,520 50ms 0ms 04 2,520 51ms 0ms 05 2,527 49ms 0ms 06 2,737 54ms 0ms 07 2,730 53ms 0ms 08 2,730 54ms 0ms 09 2,730 54ms 0ms 10 2,730 53ms 0ms 11 2,730 53ms 0ms 12 2,730 55ms 0ms 13 2,730 52ms 0ms 14 2,730 53ms 0ms 15 2,730 53ms 0ms 16 2,730 54ms 0ms 17 2,702 53ms 0ms 18 2,730 54ms 0ms 19 2,730 53ms 0ms 20 2,730 55ms 0ms 21 2,730 54ms 0ms 22 2,730 54ms 0ms 23 2,730 54ms 0ms [ User: tng_migration_user - Total duration: 8s576ms - Times executed: 449652 ]
[ Application: [unknown] - Total duration: 8s576ms - Times executed: 449652 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = 'ERROR';
Date: 2025-12-01 05:02:25 Duration: 3ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = 'ERROR';
Date: 2025-12-04 05:02:26 Duration: 2ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = 'ERROR';
Date: 2025-12-01 00:32:57 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
2 256,944 4s395ms 0ms 1ms 0ms select t0.is_archived as is_archived_1, t0.created_at as created_at_2, t0.updated_at as updated_at_3, t0.code as code_4, t0.name as name_5, t0.description as description_6 from core.notif_state t0 inner join core.notif_type_state on t0.code = core.notif_type_state.notif_state_code where core.notif_type_state.notif_type_code = ?;Times Reported Time consuming queries #2
Day Hour Count Duration Avg duration Nov 30 00 1,440 24ms 0ms 01 1,440 24ms 0ms 02 1,440 24ms 0ms 03 1,440 24ms 0ms 04 1,440 24ms 0ms 05 1,444 24ms 0ms 06 1,564 26ms 0ms 07 1,560 26ms 0ms 08 1,560 26ms 0ms 09 1,560 26ms 0ms 10 1,560 26ms 0ms 11 1,560 26ms 0ms 12 1,560 26ms 0ms 13 1,560 26ms 0ms 14 1,560 26ms 0ms 15 1,560 26ms 0ms 16 1,560 26ms 0ms 17 1,544 25ms 0ms 18 1,560 26ms 0ms 19 1,560 26ms 0ms 20 1,560 26ms 0ms 21 1,560 26ms 0ms 22 1,560 26ms 0ms 23 1,472 24ms 0ms Dec 01 00 1,440 24ms 0ms 01 1,440 24ms 0ms 02 1,440 24ms 0ms 03 1,440 24ms 0ms 04 1,440 24ms 0ms 05 1,444 24ms 0ms 06 1,564 26ms 0ms 07 1,560 26ms 0ms 08 1,560 26ms 0ms 09 1,560 26ms 0ms 10 1,560 26ms 0ms 11 1,556 26ms 0ms 12 1,560 26ms 0ms 13 1,560 26ms 0ms 14 1,560 26ms 0ms 15 1,560 26ms 0ms 16 1,560 26ms 0ms 17 1,544 25ms 0ms 18 1,564 26ms 0ms 19 1,560 26ms 0ms 20 1,560 26ms 0ms 21 1,560 26ms 0ms 22 1,560 26ms 0ms 23 1,560 26ms 0ms Dec 02 00 1,440 24ms 0ms 01 1,440 24ms 0ms 02 1,440 24ms 0ms 03 1,440 24ms 0ms 04 1,440 24ms 0ms 05 1,444 24ms 0ms 06 1,564 26ms 0ms 07 1,560 26ms 0ms 08 1,564 26ms 0ms 09 1,560 26ms 0ms 10 1,560 26ms 0ms 11 1,560 26ms 0ms 12 1,560 25ms 0ms 13 1,560 26ms 0ms 14 1,560 26ms 0ms 15 1,560 26ms 0ms 16 1,560 27ms 0ms 17 1,548 26ms 0ms 18 1,564 27ms 0ms 19 1,560 26ms 0ms 20 1,560 27ms 0ms 21 1,560 26ms 0ms 22 1,560 27ms 0ms 23 1,560 26ms 0ms Dec 03 00 1,440 24ms 0ms 01 1,440 25ms 0ms 02 1,440 24ms 0ms 03 1,440 24ms 0ms 04 1,440 24ms 0ms 05 1,444 24ms 0ms 06 1,564 27ms 0ms 07 1,564 26ms 0ms 08 1,560 26ms 0ms 09 1,564 27ms 0ms 10 1,564 27ms 0ms 11 1,560 26ms 0ms 12 1,560 26ms 0ms 13 1,564 26ms 0ms 14 1,560 26ms 0ms 15 1,560 26ms 0ms 16 1,560 26ms 0ms 17 1,544 28ms 0ms 18 1,564 26ms 0ms 19 1,560 26ms 0ms 20 1,560 26ms 0ms 21 1,560 26ms 0ms 22 1,560 26ms 0ms 23 1,560 26ms 0ms Dec 04 00 1,440 24ms 0ms 01 1,440 24ms 0ms 02 1,440 24ms 0ms 03 1,440 24ms 0ms 04 1,440 25ms 0ms 05 1,444 24ms 0ms 06 1,560 26ms 0ms 07 1,560 27ms 0ms 08 1,560 28ms 0ms 09 1,560 28ms 0ms 10 1,564 27ms 0ms 11 1,560 27ms 0ms 12 1,560 28ms 0ms 13 1,560 27ms 0ms 14 1,564 27ms 0ms 15 1,560 27ms 0ms 16 1,560 27ms 0ms 17 1,548 26ms 0ms 18 1,560 26ms 0ms 19 1,560 26ms 0ms 20 1,560 27ms 0ms 21 1,560 27ms 0ms 22 1,560 26ms 0ms 23 1,560 26ms 0ms Dec 05 00 1,440 25ms 0ms 01 1,440 24ms 0ms 02 1,440 24ms 0ms 03 1,440 24ms 0ms 04 1,440 25ms 0ms 05 1,444 24ms 0ms 06 1,564 26ms 0ms 07 1,564 26ms 0ms 08 1,560 26ms 0ms 09 1,560 26ms 0ms 10 1,564 26ms 0ms 11 1,560 26ms 0ms 12 1,560 26ms 0ms 13 1,560 26ms 0ms 14 1,560 26ms 0ms 15 1,560 26ms 0ms 16 1,560 26ms 0ms 17 1,544 26ms 0ms 18 1,560 26ms 0ms 19 1,560 26ms 0ms 20 1,560 26ms 0ms 21 1,560 27ms 0ms 22 1,560 27ms 0ms 23 1,560 27ms 0ms Dec 06 00 1,440 24ms 0ms 01 1,440 24ms 0ms 02 1,440 25ms 0ms 03 1,440 24ms 0ms 04 1,440 25ms 0ms 05 1,444 24ms 0ms 06 1,564 26ms 0ms 07 1,560 26ms 0ms 08 1,560 26ms 0ms 09 1,560 26ms 0ms 10 1,560 26ms 0ms 11 1,560 26ms 0ms 12 1,560 27ms 0ms 13 1,560 26ms 0ms 14 1,560 26ms 0ms 15 1,560 26ms 0ms 16 1,560 26ms 0ms 17 1,544 26ms 0ms 18 1,560 26ms 0ms 19 1,560 26ms 0ms 20 1,560 27ms 0ms 21 1,560 27ms 0ms 22 1,560 27ms 0ms 23 1,560 26ms 0ms [ User: tng_migration_user - Total duration: 4s395ms - Times executed: 256944 ]
[ Application: [unknown] - Total duration: 4s395ms - Times executed: 256944 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = 'FACE';
Date: 2025-12-03 17:02:26 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = 'FACE';
Date: 2025-12-04 16:56:17 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = 'PHONE';
Date: 2025-12-01 23:57:24 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
3 220,632 6s682ms 0ms 4ms 0ms select t0.is_archived as is_archived_1, t0.created_at as created_at_2, t0.updated_at as updated_at_3, t0.id as id_4, t0.name as name_5, t0.description as description_6, t0.is_automatic as is_automatic_7, t0.is_recruitment as is_recruitment_8, t0.is_welcome as is_welcome_9, t0.welcome_message as welcome_message_10, t0.biobank_id as biobank_id_11, t0.owner_user_id as owner_user_id_12, t0.owner_group_id as owner_group_id_13, t0.pilot_id as pilot_id_14, t0.subcohort_state_code as subcohort_state_code_15, t0.inform_consent_id as inform_consent_id_16 from core.subcohort t0 inner join core.subcohort_form_structure_variant on t0.id = core.subcohort_form_structure_variant.subcohort_id where core.subcohort_form_structure_variant.form_structure_variant_id = ?;Times Reported Time consuming queries #3
Day Hour Count Duration Avg duration Nov 30 00 28 1ms 0ms 05 1,540 44ms 0ms 06 1,541 45ms 0ms 07 1,626 48ms 0ms 08 1,542 44ms 0ms 09 1,541 47ms 0ms 10 1,556 46ms 0ms 11 1,598 47ms 0ms 12 1,542 45ms 0ms 13 1,615 47ms 0ms 14 1,547 44ms 0ms 15 1,729 55ms 0ms 16 1,540 44ms 0ms 17 1,386 40ms 0ms 18 1,577 43ms 0ms 19 1,541 44ms 0ms 20 1,540 46ms 0ms 21 1,594 47ms 0ms 22 1,866 53ms 0ms 23 1,540 46ms 0ms Dec 01 05 1,386 41ms 0ms 06 1,540 44ms 0ms 07 1,627 48ms 0ms 08 1,626 48ms 0ms 09 2,234 72ms 0ms 10 1,952 60ms 0ms 11 1,585 46ms 0ms 12 1,621 49ms 0ms 13 1,555 45ms 0ms 14 1,570 46ms 0ms 15 1,606 46ms 0ms 16 1,835 57ms 0ms 17 1,386 44ms 0ms 18 3,370 102ms 0ms 19 2,151 64ms 0ms 20 2,362 70ms 0ms 21 1,932 57ms 0ms 22 1,721 49ms 0ms 23 1,744 51ms 0ms Dec 02 02 1 0ms 0ms 03 1 0ms 0ms 05 1,386 40ms 0ms 06 1,540 46ms 0ms 07 1,593 51ms 0ms 08 1,710 50ms 0ms 09 1,877 56ms 0ms 10 1,992 61ms 0ms 11 1,658 50ms 0ms 12 1,831 57ms 0ms 13 1,872 57ms 0ms 14 1,825 57ms 0ms 15 1,658 50ms 0ms 16 1,651 50ms 0ms 17 1,726 51ms 0ms 18 1,615 48ms 0ms 19 1,540 45ms 0ms 20 1,540 45ms 0ms 21 1,599 49ms 0ms 22 1,540 45ms 0ms 23 1,622 47ms 0ms Dec 03 02 56 2ms 0ms 05 1,540 46ms 0ms 06 1,587 50ms 0ms 07 1,858 55ms 0ms 08 1,875 61ms 0ms 09 1,943 62ms 0ms 10 1,716 52ms 0ms 11 1,781 53ms 0ms 12 1,966 61ms 0ms 13 1,592 49ms 0ms 14 1,679 48ms 0ms 15 1,749 51ms 0ms 16 1,686 52ms 0ms 17 1,524 45ms 0ms 18 1,568 47ms 0ms 19 1,709 48ms 0ms 20 1,649 49ms 0ms 21 1,540 45ms 0ms 22 1,855 56ms 0ms 23 1,743 52ms 0ms Dec 04 05 1,540 46ms 0ms 06 1,576 50ms 0ms 07 1,570 47ms 0ms 08 1,614 49ms 0ms 09 1,769 57ms 0ms 10 1,562 46ms 0ms 11 1,634 50ms 0ms 12 1,699 51ms 0ms 13 1,619 47ms 0ms 14 1,924 59ms 0ms 15 1,589 47ms 0ms 16 1,593 50ms 0ms 17 1,540 46ms 0ms 18 1,560 47ms 0ms 19 1,540 47ms 0ms 20 1,540 46ms 0ms 21 1,652 51ms 0ms 22 1,540 45ms 0ms 23 1,621 49ms 0ms Dec 05 00 27 0ms 0ms 05 1,444 48ms 0ms 06 1,630 49ms 0ms 07 1,664 53ms 0ms 08 1,789 57ms 0ms 09 1,743 55ms 0ms 10 1,572 47ms 0ms 11 1,660 51ms 0ms 12 1,791 54ms 0ms 13 1,702 54ms 0ms 14 1,567 48ms 0ms 15 1,540 46ms 0ms 16 1,540 46ms 0ms 17 1,412 40ms 0ms 18 1,596 47ms 0ms 19 1,713 51ms 0ms 20 1,592 48ms 0ms 21 1,540 45ms 0ms 22 1,540 51ms 0ms 23 1,597 48ms 0ms Dec 06 00 28 0ms 0ms 05 1,540 44ms 0ms 06 1,540 46ms 0ms 07 1,540 49ms 0ms 08 1,582 47ms 0ms 09 1,596 47ms 0ms 10 1,540 45ms 0ms 11 1,546 45ms 0ms 12 1,629 48ms 0ms 13 1,543 49ms 0ms 14 1,598 47ms 0ms 15 1,540 44ms 0ms 16 1,540 45ms 0ms 17 1,586 46ms 0ms 18 1,786 55ms 0ms 19 1,568 45ms 0ms 20 1,611 47ms 0ms 21 1,584 47ms 0ms 22 1,566 48ms 0ms 23 1,643 52ms 0ms [ User: tng_migration_user - Total duration: 6s682ms - Times executed: 220632 ]
[ Application: [unknown] - Total duration: 6s682ms - Times executed: 220632 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = '13';
Date: 2025-12-05 05:12:02 Duration: 4ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = '171';
Date: 2025-12-03 18:18:01 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = '91';
Date: 2025-12-02 06:12:01 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
4 154,674 1m26s 0ms 4ms 0ms select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.subject_subcohort_id as subject_subcohort_id_11, m0_.form_structure_variant_id as form_structure_variant_id_12, m0_.form_id as form_id_13, m0_.form_state_code as form_state_code_14 from core.mv_subject_form m0_ where m0_.form_structure_variant_id in (...) and m0_.form_id is null and m0_.result_date <= ? and m0_.use_alternative <> ?;Times Reported Time consuming queries #4
Day Hour Count Duration Avg duration Nov 30 05 1,170 636ms 0ms 06 1,170 642ms 0ms 07 1,170 658ms 0ms 08 1,170 668ms 0ms 09 1,170 654ms 0ms 10 1,170 646ms 0ms 11 1,170 670ms 0ms 12 1,170 680ms 0ms 13 1,170 651ms 0ms 14 1,170 627ms 0ms 15 1,170 644ms 0ms 16 1,170 655ms 0ms 17 1,053 587ms 0ms 18 1,170 648ms 0ms 19 1,170 634ms 0ms 20 1,170 644ms 0ms 21 1,170 627ms 0ms 22 1,170 651ms 0ms 23 1,170 623ms 0ms Dec 01 05 1,053 578ms 0ms 06 1,170 660ms 0ms 07 1,170 687ms 0ms 08 1,170 674ms 0ms 09 1,170 658ms 0ms 10 1,170 645ms 0ms 11 1,170 671ms 0ms 12 1,170 644ms 0ms 13 1,170 649ms 0ms 14 1,170 666ms 0ms 15 1,170 660ms 0ms 16 1,170 661ms 0ms 17 1,053 608ms 0ms 18 1,170 655ms 0ms 19 1,170 658ms 0ms 20 1,170 658ms 0ms 21 1,170 663ms 0ms 22 1,170 664ms 0ms 23 1,170 661ms 0ms Dec 02 05 1,053 573ms 0ms 06 1,170 635ms 0ms 07 1,170 641ms 0ms 08 1,170 679ms 0ms 09 1,170 665ms 0ms 10 1,170 696ms 0ms 11 1,170 668ms 0ms 12 1,170 651ms 0ms 13 1,170 654ms 0ms 14 1,170 640ms 0ms 15 1,170 643ms 0ms 16 1,170 704ms 0ms 17 1,170 647ms 0ms 18 1,170 651ms 0ms 19 1,170 640ms 0ms 20 1,170 625ms 0ms 21 1,170 635ms 0ms 22 1,170 664ms 0ms 23 1,170 685ms 0ms Dec 03 05 1,170 652ms 0ms 06 1,170 669ms 0ms 07 1,170 652ms 0ms 08 1,170 667ms 0ms 09 1,170 632ms 0ms 10 1,170 667ms 0ms 11 1,170 668ms 0ms 12 1,170 690ms 0ms 13 1,170 651ms 0ms 14 1,170 646ms 0ms 15 1,170 640ms 0ms 16 1,170 681ms 0ms 17 1,053 583ms 0ms 18 1,170 674ms 0ms 19 1,170 625ms 0ms 20 1,170 639ms 0ms 21 1,170 629ms 0ms 22 1,170 646ms 0ms 23 1,170 657ms 0ms Dec 04 05 1,170 632ms 0ms 06 1,170 698ms 0ms 07 1,170 665ms 0ms 08 1,170 650ms 0ms 09 1,170 668ms 0ms 10 1,170 657ms 0ms 11 1,170 673ms 0ms 12 1,170 679ms 0ms 13 1,170 658ms 0ms 14 1,170 674ms 0ms 15 1,170 680ms 0ms 16 1,170 689ms 0ms 17 1,170 636ms 0ms 18 1,170 649ms 0ms 19 1,170 638ms 0ms 20 1,170 667ms 0ms 21 1,170 652ms 0ms 22 1,170 666ms 0ms 23 1,170 689ms 0ms Dec 05 05 1,053 600ms 0ms 06 1,170 659ms 0ms 07 1,170 642ms 0ms 08 1,170 661ms 0ms 09 1,170 638ms 0ms 10 1,170 647ms 0ms 11 1,170 645ms 0ms 12 1,170 651ms 0ms 13 1,170 638ms 0ms 14 1,170 645ms 0ms 15 1,170 663ms 0ms 16 1,170 655ms 0ms 17 1,053 585ms 0ms 18 1,170 664ms 0ms 19 1,170 667ms 0ms 20 1,170 652ms 0ms 21 1,170 670ms 0ms 22 1,170 663ms 0ms 23 1,170 652ms 0ms Dec 06 05 1,170 642ms 0ms 06 1,170 643ms 0ms 07 1,170 642ms 0ms 08 1,170 646ms 0ms 09 1,170 647ms 0ms 10 1,170 680ms 0ms 11 1,170 655ms 0ms 12 1,170 650ms 0ms 13 1,170 641ms 0ms 14 1,170 653ms 0ms 15 1,170 647ms 0ms 16 1,170 637ms 0ms 17 1,053 584ms 0ms 18 1,170 659ms 0ms 19 1,170 661ms 0ms 20 1,170 647ms 0ms 21 1,170 679ms 0ms 22 1,170 658ms 0ms 23 1,170 655ms 0ms [ User: tng_migration_user - Total duration: 1m26s - Times executed: 154674 ]
[ Application: [unknown] - Total duration: 1m26s - Times executed: 154674 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('82') AND m0_.form_id IS NULL AND m0_.result_date <= '2021-12-17 09:00:01' AND m0_.use_alternative <> 't';
Date: 2025-12-01 09:00:03 Duration: 4ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('83') AND m0_.form_id IS NULL AND m0_.result_date <= '2020-12-20 14:54:01' AND m0_.use_alternative <> 't';
Date: 2025-12-04 14:54:03 Duration: 4ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('86') AND m0_.form_id IS NULL AND m0_.result_date <= '2021-12-20 16:06:01' AND m0_.use_alternative <> 't';
Date: 2025-12-04 16:06:03 Duration: 4ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
5 80,377 1s639ms 0ms 4ms 0ms select t0.is_archived as is_archived_1, t0.created_at as created_at_2, t0.updated_at as updated_at_3, t0.id as id_4, t0.rc as rc_5, t0.tng_id as tng_id_6, t0.birthdate as birthdate_7, t0.name as name_8, t0.surname as surname_9, t0.maiden_name as maiden_name_10, t0.titles_before as titles_before_11, t0.titles_after as titles_after_12, t0.description as description_13, t0.test_proband as test_proband_14, t0.puk as puk_15, t0.is_origin_elspac as is_origin_elspac_16, t0.family_code as family_code_17, t0.enrolled_at as enrolled_at_18, t0.anonym_at as anonym_at_19, t0.elspac_family_relationship_type_code as elspac_family_relationship_type_code_20, t0.subject_state_code as subject_state_code_21, t0.sex_code as sex_code_22, t0.family_id as family_id_23, t0.user_id as user_id_24, t0.created_by as created_by_25, t0.enrolled_by as enrolled_by_26, t0.anonym_by as anonym_by_27, t28.id as id_29, t28.death_at as death_at_30, t28.date_of_death as date_of_death_31, t28.cause_of_death as cause_of_death_32, t28.subject_id as subject_id_33, t28.death_by as death_by_34, t0.owner_user_id as owner_user_id_35, t0.owner_group_id as owner_group_id_36 from core.subject t0 left join core.subject_dead t28 on t28.subject_id = t0.id where t0.id = ?;Times Reported Time consuming queries #5
Day Hour Count Duration Avg duration Nov 30 00 2 0ms 0ms 05 419 7ms 0ms 06 555 11ms 0ms 07 523 10ms 0ms 08 519 10ms 0ms 09 516 9ms 0ms 10 517 9ms 0ms 11 521 10ms 0ms 12 518 10ms 0ms 13 524 10ms 0ms 14 522 9ms 0ms 15 531 10ms 0ms 16 511 9ms 0ms 17 511 9ms 0ms 18 513 9ms 0ms 19 512 9ms 0ms 20 511 9ms 0ms 21 513 9ms 0ms 22 525 10ms 0ms 23 511 9ms 0ms Dec 01 05 381 7ms 0ms 06 508 10ms 0ms 07 509 10ms 0ms 08 739 14ms 0ms 09 2,098 45ms 0ms 10 1,193 25ms 0ms 11 592 11ms 0ms 12 606 12ms 0ms 13 468 8ms 0ms 14 767 15ms 0ms 15 474 9ms 0ms 16 644 13ms 0ms 17 463 8ms 0ms 18 594 13ms 0ms 19 478 8ms 0ms 20 488 10ms 0ms 21 478 9ms 0ms 22 469 9ms 0ms 23 588 11ms 0ms Dec 02 02 1 0ms 0ms 03 1 0ms 0ms 05 390 7ms 0ms 06 531 11ms 0ms 07 610 12ms 0ms 08 1,421 29ms 0ms 09 2,248 44ms 0ms 10 532 11ms 0ms 11 1,055 20ms 0ms 12 523 10ms 0ms 13 674 14ms 0ms 14 682 13ms 0ms 15 658 13ms 0ms 16 504 10ms 0ms 17 497 9ms 0ms 18 494 9ms 0ms 19 485 8ms 0ms 20 485 9ms 0ms 21 493 9ms 0ms 22 485 9ms 0ms 23 489 9ms 0ms Dec 03 02 4 0ms 0ms 05 389 7ms 0ms 06 552 11ms 0ms 07 555 11ms 0ms 08 985 24ms 0ms 09 702 17ms 0ms 10 832 16ms 0ms 11 559 12ms 0ms 12 777 17ms 0ms 13 823 17ms 0ms 14 524 10ms 0ms 15 657 12ms 0ms 16 720 14ms 0ms 17 511 10ms 0ms 18 509 9ms 0ms 19 512 10ms 0ms 20 514 10ms 0ms 21 502 9ms 0ms 22 520 10ms 0ms 23 516 10ms 0ms Dec 04 05 415 7ms 0ms 06 579 12ms 0ms 07 548 11ms 0ms 08 567 12ms 0ms 09 1,025 23ms 0ms 10 759 16ms 0ms 11 548 11ms 0ms 12 656 14ms 0ms 13 1,307 25ms 0ms 14 557 12ms 0ms 15 747 15ms 0ms 16 557 11ms 0ms 17 527 11ms 0ms 18 530 11ms 0ms 19 527 10ms 0ms 20 527 10ms 0ms 21 531 9ms 0ms 22 527 10ms 0ms 23 527 10ms 0ms Dec 05 00 2 0ms 0ms 05 438 15ms 0ms 06 539 11ms 0ms 07 638 13ms 0ms 08 539 12ms 0ms 09 853 18ms 0ms 10 617 12ms 0ms 11 1,169 23ms 0ms 12 621 13ms 0ms 13 544 11ms 0ms 14 508 10ms 0ms 15 488 9ms 0ms 16 488 9ms 0ms 17 491 9ms 0ms 18 498 9ms 0ms 19 501 9ms 0ms 20 490 9ms 0ms 21 486 9ms 0ms 22 486 9ms 0ms 23 491 9ms 0ms Dec 06 00 2 0ms 0ms 05 433 7ms 0ms 06 563 11ms 0ms 07 515 9ms 0ms 08 524 10ms 0ms 09 517 10ms 0ms 10 511 9ms 0ms 11 661 12ms 0ms 12 515 10ms 0ms 13 916 18ms 0ms 14 518 9ms 0ms 15 509 9ms 0ms 16 509 9ms 0ms 17 514 9ms 0ms 18 524 11ms 0ms 19 512 9ms 0ms 20 512 9ms 0ms 21 512 12ms 0ms 22 512 10ms 0ms 23 518 11ms 0ms [ User: tng_migration_user - Total duration: 1s639ms - Times executed: 80377 ]
[ Application: [unknown] - Total duration: 1s639ms - Times executed: 80377 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = '43340';
Date: 2025-12-05 05:00:03 Duration: 4ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = '38918';
Date: 2025-12-05 05:00:04 Duration: 2ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = '47734';
Date: 2025-12-02 08:32:02 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
6 76,703 8s872ms 0ms 27ms 0ms set names ?;Times Reported Time consuming queries #6
Day Hour Count Duration Avg duration Nov 30 00 425 71ms 0ms 01 420 44ms 0ms 02 420 45ms 0ms 03 420 45ms 0ms 04 420 47ms 0ms 05 413 44ms 0ms 06 421 44ms 0ms 07 433 47ms 0ms 08 422 46ms 0ms 09 421 44ms 0ms 10 424 46ms 0ms 11 429 46ms 0ms 12 422 46ms 0ms 13 434 46ms 0ms 14 427 45ms 0ms 15 454 50ms 0ms 16 420 46ms 0ms 17 411 41ms 0ms 18 435 46ms 0ms 19 421 45ms 0ms 20 420 46ms 0ms 21 424 45ms 0ms 22 438 45ms 0ms 23 398 42ms 0ms Dec 01 00 421 46ms 0ms 01 420 46ms 0ms 02 420 46ms 0ms 03 420 46ms 0ms 04 420 44ms 0ms 05 411 44ms 0ms 06 423 45ms 0ms 07 482 52ms 0ms 08 469 50ms 0ms 09 813 84ms 0ms 10 604 65ms 0ms 11 496 54ms 0ms 12 507 54ms 0ms 13 507 54ms 0ms 14 540 57ms 0ms 15 442 47ms 0ms 16 474 52ms 0ms 17 411 43ms 0ms 18 639 68ms 0ms 19 490 53ms 0ms 20 510 55ms 0ms 21 462 50ms 0ms 22 436 46ms 0ms 23 469 50ms 0ms Dec 02 00 421 45ms 0ms 01 420 45ms 0ms 02 421 46ms 0ms 03 421 45ms 0ms 04 420 46ms 0ms 05 410 43ms 0ms 06 426 48ms 0ms 07 484 53ms 0ms 08 543 61ms 0ms 09 608 68ms 0ms 10 543 61ms 0ms 11 501 54ms 0ms 12 509 55ms 0ms 13 539 58ms 0ms 14 483 52ms 0ms 15 466 50ms 0ms 16 455 51ms 0ms 17 441 48ms 0ms 18 429 47ms 0ms 19 420 45ms 0ms 20 420 47ms 0ms 21 431 47ms 0ms 22 420 46ms 0ms 23 426 45ms 0ms Dec 03 00 421 45ms 0ms 01 420 46ms 0ms 02 428 48ms 0ms 03 420 45ms 0ms 04 420 45ms 0ms 05 419 46ms 0ms 06 436 48ms 0ms 07 528 57ms 0ms 08 686 74ms 0ms 09 790 87ms 0ms 10 547 58ms 0ms 11 585 62ms 0ms 12 572 62ms 0ms 13 491 53ms 0ms 14 480 54ms 0ms 15 501 55ms 0ms 16 461 50ms 0ms 17 428 46ms 0ms 18 425 47ms 0ms 19 442 46ms 0ms 20 438 47ms 0ms 21 420 45ms 0ms 22 444 47ms 0ms 23 457 48ms 0ms Dec 04 00 421 46ms 0ms 01 420 45ms 0ms 02 420 45ms 0ms 03 420 45ms 0ms 04 420 47ms 0ms 05 413 44ms 0ms 06 424 47ms 0ms 07 464 59ms 0ms 08 617 79ms 0ms 09 639 82ms 0ms 10 484 60ms 0ms 11 474 60ms 0ms 12 479 63ms 0ms 13 532 65ms 0ms 14 488 64ms 0ms 15 479 63ms 0ms 16 512 65ms 0ms 17 414 51ms 0ms 18 425 53ms 0ms 19 420 52ms 0ms 20 420 53ms 0ms 21 429 54ms 0ms 22 420 52ms 0ms 23 441 56ms 0ms Dec 05 00 425 54ms 0ms 01 420 53ms 0ms 02 420 52ms 0ms 03 420 52ms 0ms 04 420 55ms 0ms 05 420 50ms 0ms 06 434 54ms 0ms 07 500 60ms 0ms 08 496 61ms 0ms 09 534 66ms 0ms 10 495 58ms 0ms 11 513 62ms 0ms 12 474 59ms 0ms 13 533 67ms 0ms 14 462 57ms 0ms 15 430 52ms 0ms 16 420 52ms 0ms 17 416 49ms 0ms 18 434 54ms 0ms 19 443 55ms 0ms 20 428 53ms 0ms 21 420 54ms 0ms 22 420 53ms 0ms 23 428 53ms 0ms Dec 06 00 425 54ms 0ms 01 420 53ms 0ms 02 420 53ms 0ms 03 420 52ms 0ms 04 420 56ms 0ms 05 413 49ms 0ms 06 420 53ms 0ms 07 420 51ms 0ms 08 431 55ms 0ms 09 428 52ms 0ms 10 422 52ms 0ms 11 427 51ms 0ms 12 437 56ms 0ms 13 440 54ms 0ms 14 430 52ms 0ms 15 420 51ms 0ms 16 420 52ms 0ms 17 436 53ms 0ms 18 454 57ms 0ms 19 427 52ms 0ms 20 429 55ms 0ms 21 426 54ms 0ms 22 426 53ms 0ms 23 438 55ms 0ms [ User: tng_migration_user - Total duration: 8s872ms - Times executed: 76703 ]
[ Application: [unknown] - Total duration: 8s872ms - Times executed: 76703 ]
-
SET NAMES 'utf8';
Date: 2025-11-30 00:01:42 Duration: 27ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
-
SET NAMES 'utf8';
Date: 2025-12-02 16:01:01 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SET NAMES 'utf8';
Date: 2025-12-02 10:09:21 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
7 70,428 2s415ms 0ms 1ms 0ms select t0.id as id_1, t0.version as version_2, t0.created_at as created_at_3, t0.name as name_4, t0.command as command_5, t0.arguments as arguments_6, t0.cron_expression as cron_expression_7, t0.last_execution as last_execution_8, t0.last_return_code as last_return_code_9, t0.log_file as log_file_10, t0.priority as priority_11, t0.execute_immediately as execute_immediately_12, t0.disabled as disabled_13, t0.locked as locked_14, t0.ping_back_url as ping_back_url_15, t0.ping_back_failed_url as ping_back_failed_url_16, t0.notes as notes_17 from scheduled_command t0 where t0.disabled = ? and t0.locked = ? order by t0.priority desc;Times Reported Time consuming queries #7
Day Hour Count Duration Avg duration Nov 30 00 420 14ms 0ms 01 420 13ms 0ms 02 420 14ms 0ms 03 420 14ms 0ms 04 420 14ms 0ms 05 413 14ms 0ms 06 420 15ms 0ms 07 420 15ms 0ms 08 420 15ms 0ms 09 420 15ms 0ms 10 420 15ms 0ms 11 420 16ms 0ms 12 420 16ms 0ms 13 420 16ms 0ms 14 420 16ms 0ms 15 420 16ms 0ms 16 420 16ms 0ms 17 411 15ms 0ms 18 420 16ms 0ms 19 420 16ms 0ms 20 420 14ms 0ms 21 420 13ms 0ms 22 420 13ms 0ms 23 398 13ms 0ms Dec 01 00 420 14ms 0ms 01 420 14ms 0ms 02 420 14ms 0ms 03 420 14ms 0ms 04 420 14ms 0ms 05 411 14ms 0ms 06 420 13ms 0ms 07 420 13ms 0ms 08 420 13ms 0ms 09 420 13ms 0ms 10 420 14ms 0ms 11 419 14ms 0ms 12 420 13ms 0ms 13 420 14ms 0ms 14 420 14ms 0ms 15 420 14ms 0ms 16 420 15ms 0ms 17 411 14ms 0ms 18 420 15ms 0ms 19 420 15ms 0ms 20 420 12ms 0ms 21 420 12ms 0ms 22 420 12ms 0ms 23 420 12ms 0ms Dec 02 00 420 11ms 0ms 01 420 11ms 0ms 02 420 11ms 0ms 03 420 10ms 0ms 04 420 11ms 0ms 05 410 11ms 0ms 06 420 14ms 0ms 07 420 14ms 0ms 08 420 14ms 0ms 09 420 14ms 0ms 10 420 14ms 0ms 11 420 14ms 0ms 12 420 15ms 0ms 13 420 15ms 0ms 14 420 15ms 0ms 15 420 15ms 0ms 16 420 16ms 0ms 17 414 15ms 0ms 18 420 17ms 0ms 19 420 16ms 0ms 20 420 17ms 0ms 21 420 14ms 0ms 22 420 14ms 0ms 23 420 14ms 0ms Dec 03 00 420 14ms 0ms 01 420 14ms 0ms 02 420 15ms 0ms 03 420 14ms 0ms 04 420 14ms 0ms 05 419 15ms 0ms 06 420 15ms 0ms 07 420 14ms 0ms 08 420 15ms 0ms 09 420 16ms 0ms 10 420 15ms 0ms 11 420 15ms 0ms 12 420 15ms 0ms 13 420 15ms 0ms 14 420 16ms 0ms 15 420 16ms 0ms 16 420 16ms 0ms 17 411 14ms 0ms 18 420 15ms 0ms 19 420 15ms 0ms 20 420 15ms 0ms 21 420 12ms 0ms 22 420 12ms 0ms 23 420 12ms 0ms Dec 04 00 420 14ms 0ms 01 420 13ms 0ms 02 420 14ms 0ms 03 420 13ms 0ms 04 420 15ms 0ms 05 413 13ms 0ms 06 419 13ms 0ms 07 420 12ms 0ms 08 420 13ms 0ms 09 420 13ms 0ms 10 420 13ms 0ms 11 420 13ms 0ms 12 420 14ms 0ms 13 420 13ms 0ms 14 420 14ms 0ms 15 420 14ms 0ms 16 420 14ms 0ms 17 414 13ms 0ms 18 420 14ms 0ms 19 420 14ms 0ms 20 420 14ms 0ms 21 420 15ms 0ms 22 420 12ms 0ms 23 420 12ms 0ms Dec 05 00 420 12ms 0ms 01 420 12ms 0ms 02 420 12ms 0ms 03 420 12ms 0ms 04 420 12ms 0ms 05 410 11ms 0ms 06 420 12ms 0ms 07 420 12ms 0ms 08 420 13ms 0ms 09 420 13ms 0ms 10 420 12ms 0ms 11 420 12ms 0ms 12 420 13ms 0ms 13 420 14ms 0ms 14 420 13ms 0ms 15 420 13ms 0ms 16 420 14ms 0ms 17 411 14ms 0ms 18 420 15ms 0ms 19 420 16ms 0ms 20 420 16ms 0ms 21 420 17ms 0ms 22 420 13ms 0ms 23 420 14ms 0ms Dec 06 00 420 14ms 0ms 01 420 14ms 0ms 02 420 14ms 0ms 03 420 14ms 0ms 04 420 15ms 0ms 05 413 13ms 0ms 06 420 14ms 0ms 07 420 14ms 0ms 08 420 14ms 0ms 09 420 13ms 0ms 10 420 14ms 0ms 11 420 14ms 0ms 12 420 14ms 0ms 13 420 14ms 0ms 14 420 14ms 0ms 15 420 14ms 0ms 16 420 14ms 0ms 17 411 13ms 0ms 18 420 14ms 0ms 19 420 14ms 0ms 20 420 14ms 0ms 21 420 15ms 0ms 22 420 15ms 0ms 23 420 12ms 0ms [ User: tng_migration_user - Total duration: 2s415ms - Times executed: 70428 ]
[ Application: [unknown] - Total duration: 2s415ms - Times executed: 70428 ]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = 'f' AND t0.locked = 'f' ORDER BY t0.priority DESC;
Date: 2025-12-04 04:09:02 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = 'f' AND t0.locked = 'f' ORDER BY t0.priority DESC;
Date: 2025-12-02 16:01:01 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = 'f' AND t0.locked = 'f' ORDER BY t0.priority DESC;
Date: 2025-12-03 02:44:02 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
8 66,642 974ms 0ms 10ms 0ms select t0.is_archived as is_archived_1, t0.created_at as created_at_2, t0.updated_at as updated_at_3, t0.id as id_4, t0.clade_id as clade_id_5, t0.expired_at as expired_at_6, t0.owner_user_id as owner_user_id_7, t0.owner_group_id as owner_group_id_8, t0.form_structure_variant_id as form_structure_variant_id_9, t0.form_state_code as form_state_code_10, t0.subject_id as subject_id_11, t0.about_subject_id as about_subject_id_12, t0.notif_state as notif_state_13 from core.form t0 where t0.id = ?;Times Reported Time consuming queries #8
Day Hour Count Duration Avg duration Nov 30 05 567 6ms 0ms 06 502 6ms 0ms 07 503 6ms 0ms 08 503 6ms 0ms 09 501 6ms 0ms 10 502 5ms 0ms 11 503 6ms 0ms 12 501 5ms 0ms 13 503 6ms 0ms 14 502 5ms 0ms 15 505 6ms 0ms 16 495 5ms 0ms 17 495 5ms 0ms 18 496 6ms 0ms 19 495 5ms 0ms 20 495 5ms 0ms 21 495 5ms 0ms 22 498 5ms 0ms 23 495 5ms 0ms Dec 01 05 531 6ms 0ms 06 473 5ms 0ms 07 489 63ms 0ms 08 480 5ms 0ms 09 508 7ms 0ms 10 480 11ms 0ms 11 472 5ms 0ms 12 473 5ms 0ms 13 471 5ms 0ms 14 471 6ms 0ms 15 471 6ms 0ms 16 482 6ms 0ms 17 471 5ms 0ms 18 472 6ms 0ms 19 472 5ms 0ms 20 473 7ms 0ms 21 474 6ms 0ms 22 469 6ms 0ms 23 473 5ms 0ms Dec 02 02 1 0ms 0ms 05 517 6ms 0ms 06 474 5ms 0ms 07 475 6ms 0ms 08 475 6ms 0ms 09 478 6ms 0ms 10 483 6ms 0ms 11 476 5ms 0ms 12 478 5ms 0ms 13 472 5ms 0ms 14 474 5ms 0ms 15 478 9ms 0ms 16 471 5ms 0ms 17 470 5ms 0ms 18 469 6ms 0ms 19 468 5ms 0ms 20 468 5ms 0ms 21 471 5ms 0ms 22 468 5ms 0ms 23 469 5ms 0ms Dec 03 02 1 0ms 0ms 05 522 6ms 0ms 06 470 5ms 0ms 07 474 6ms 0ms 08 485 13ms 0ms 09 486 6ms 0ms 10 470 6ms 0ms 11 480 8ms 0ms 12 478 6ms 0ms 13 469 6ms 0ms 14 473 6ms 0ms 15 485 5ms 0ms 16 483 6ms 0ms 17 467 5ms 0ms 18 466 5ms 0ms 19 469 5ms 0ms 20 467 5ms 0ms 21 464 5ms 0ms 22 468 5ms 0ms 23 467 5ms 0ms Dec 04 05 555 6ms 0ms 06 516 6ms 0ms 07 515 6ms 0ms 08 518 15ms 0ms 09 516 12ms 0ms 10 516 8ms 0ms 11 519 6ms 0ms 12 527 12ms 0ms 13 532 6ms 0ms 14 525 7ms 0ms 15 525 7ms 0ms 16 519 6ms 0ms 17 517 6ms 0ms 18 518 6ms 0ms 19 517 6ms 0ms 20 517 6ms 0ms 21 518 5ms 0ms 22 517 6ms 0ms 23 519 6ms 0ms Dec 05 05 576 14ms 0ms 06 511 28ms 0ms 07 516 6ms 0ms 08 512 11ms 0ms 09 511 6ms 0ms 10 511 5ms 0ms 11 514 6ms 0ms 12 518 6ms 0ms 13 517 11ms 0ms 14 508 6ms 0ms 15 508 6ms 0ms 16 508 5ms 0ms 17 509 5ms 0ms 18 509 6ms 0ms 19 512 6ms 0ms 20 507 6ms 0ms 21 505 6ms 0ms 22 505 6ms 0ms 23 507 5ms 0ms Dec 06 05 604 12ms 0ms 06 538 6ms 0ms 07 538 6ms 0ms 08 542 6ms 0ms 09 538 6ms 0ms 10 536 6ms 0ms 11 536 6ms 0ms 12 537 7ms 0ms 13 536 6ms 0ms 14 538 6ms 0ms 15 534 6ms 0ms 16 534 5ms 0ms 17 535 6ms 0ms 18 538 7ms 0ms 19 531 6ms 0ms 20 530 6ms 0ms 21 529 8ms 0ms 22 529 7ms 0ms 23 529 6ms 0ms [ User: tng_migration_user - Total duration: 974ms - Times executed: 66642 ]
[ Application: [unknown] - Total duration: 974ms - Times executed: 66642 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = '130077';
Date: 2025-12-01 07:05:53 Duration: 10ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = '136563';
Date: 2025-12-05 05:29:25 Duration: 7ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = '22670';
Date: 2025-12-04 08:15:57 Duration: 6ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
9 65,918 830ms 0ms 0ms 0ms select t0.is_archived as is_archived_1, t0.created_at as created_at_2, t0.updated_at as updated_at_3, t0.code as code_4, t0.name as name_5, t0.description as description_6 from core.notif_state t0 where t0.code = ? limit ?;Times Reported Time consuming queries #9
Day Hour Count Duration Avg duration Nov 30 00 360 4ms 0ms 01 360 4ms 0ms 02 360 4ms 0ms 03 360 4ms 0ms 04 360 4ms 0ms 05 360 4ms 0ms 06 614 6ms 0ms 07 390 4ms 0ms 08 390 4ms 0ms 09 390 4ms 0ms 10 390 4ms 0ms 11 390 4ms 0ms 12 390 4ms 0ms 13 390 4ms 0ms 14 390 4ms 0ms 15 390 4ms 0ms 16 390 4ms 0ms 17 386 4ms 0ms 18 390 4ms 0ms 19 390 4ms 0ms 20 390 4ms 0ms 21 390 4ms 0ms 22 390 4ms 0ms 23 368 4ms 0ms Dec 01 00 360 4ms 0ms 01 360 4ms 0ms 02 360 4ms 0ms 03 360 4ms 0ms 04 360 4ms 0ms 05 360 6ms 0ms 06 552 8ms 0ms 07 390 6ms 0ms 08 390 6ms 0ms 09 390 6ms 0ms 10 390 6ms 0ms 11 389 6ms 0ms 12 390 6ms 0ms 13 390 6ms 0ms 14 390 6ms 0ms 15 390 6ms 0ms 16 390 6ms 0ms 17 386 5ms 0ms 18 486 5ms 0ms 19 390 4ms 0ms 20 390 4ms 0ms 21 390 4ms 0ms 22 390 4ms 0ms 23 390 4ms 0ms Dec 02 00 360 4ms 0ms 01 360 4ms 0ms 02 360 4ms 0ms 03 360 4ms 0ms 04 360 4ms 0ms 05 360 4ms 0ms 06 638 7ms 0ms 07 390 4ms 0ms 08 392 5ms 0ms 09 390 4ms 0ms 10 390 4ms 0ms 11 390 4ms 0ms 12 390 4ms 0ms 13 390 4ms 0ms 14 390 4ms 0ms 15 390 4ms 0ms 16 390 4ms 0ms 17 387 4ms 0ms 18 396 4ms 0ms 19 390 4ms 0ms 20 390 5ms 0ms 21 390 4ms 0ms 22 390 4ms 0ms 23 390 4ms 0ms Dec 03 00 360 4ms 0ms 01 360 4ms 0ms 02 360 4ms 0ms 03 360 4ms 0ms 04 360 4ms 0ms 05 360 4ms 0ms 06 612 7ms 0ms 07 392 4ms 0ms 08 390 4ms 0ms 09 391 4ms 0ms 10 392 4ms 0ms 11 390 4ms 0ms 12 390 4ms 0ms 13 392 4ms 0ms 14 390 4ms 0ms 15 390 4ms 0ms 16 390 4ms 0ms 17 386 4ms 0ms 18 392 5ms 0ms 19 390 6ms 0ms 20 390 6ms 0ms 21 390 6ms 0ms 22 390 6ms 0ms 23 390 6ms 0ms Dec 04 00 360 6ms 0ms 01 360 6ms 0ms 02 360 6ms 0ms 03 360 6ms 0ms 04 360 6ms 0ms 05 360 6ms 0ms 06 655 8ms 0ms 07 390 4ms 0ms 08 390 4ms 0ms 09 390 4ms 0ms 10 392 4ms 0ms 11 390 4ms 0ms 12 390 4ms 0ms 13 390 4ms 0ms 14 390 4ms 0ms 15 390 4ms 0ms 16 390 4ms 0ms 17 387 4ms 0ms 18 390 4ms 0ms 19 390 4ms 0ms 20 390 4ms 0ms 21 390 4ms 0ms 22 390 4ms 0ms 23 390 4ms 0ms Dec 05 00 360 4ms 0ms 01 360 4ms 0ms 02 360 4ms 0ms 03 360 4ms 0ms 04 360 4ms 0ms 05 360 4ms 0ms 06 602 6ms 0ms 07 391 4ms 0ms 08 390 4ms 0ms 09 390 4ms 0ms 10 392 4ms 0ms 11 390 4ms 0ms 12 390 4ms 0ms 13 390 4ms 0ms 14 390 4ms 0ms 15 390 4ms 0ms 16 390 4ms 0ms 17 386 4ms 0ms 18 390 4ms 0ms 19 390 4ms 0ms 20 390 4ms 0ms 21 390 4ms 0ms 22 390 4ms 0ms 23 390 4ms 0ms Dec 06 00 360 4ms 0ms 01 360 4ms 0ms 02 360 4ms 0ms 03 360 4ms 0ms 04 360 4ms 0ms 05 360 4ms 0ms 06 646 7ms 0ms 07 390 4ms 0ms 08 390 4ms 0ms 09 390 4ms 0ms 10 390 4ms 0ms 11 390 4ms 0ms 12 390 4ms 0ms 13 390 4ms 0ms 14 390 4ms 0ms 15 390 4ms 0ms 16 390 4ms 0ms 17 386 4ms 0ms 18 390 4ms 0ms 19 390 4ms 0ms 20 390 4ms 0ms 21 390 4ms 0ms 22 390 4ms 0ms 23 390 4ms 0ms [ User: tng_migration_user - Total duration: 830ms - Times executed: 65918 ]
[ Application: [unknown] - Total duration: 830ms - Times executed: 65918 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = 'ERROR' LIMIT 1;
Date: 2025-11-30 00:58:15 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = 'ERROR' LIMIT 1;
Date: 2025-12-01 17:06:25 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = 'ERROR' LIMIT 1;
Date: 2025-12-04 15:30:18 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
10 60,456 11s728ms 0ms 144ms 0ms select count(n0_.id) as sclr_0 from core.notif n0_ where n0_.notif_state_code = ? and n0_.processed_time >= ?;Times Reported Time consuming queries #10
Day Hour Count Duration Avg duration Nov 30 00 360 60ms 0ms 01 360 60ms 0ms 02 360 61ms 0ms 03 360 61ms 0ms 04 360 63ms 0ms 05 360 62ms 0ms 06 360 61ms 0ms 07 360 63ms 0ms 08 360 64ms 0ms 09 360 61ms 0ms 10 360 64ms 0ms 11 360 63ms 0ms 12 360 63ms 0ms 13 360 61ms 0ms 14 360 61ms 0ms 15 360 64ms 0ms 16 360 62ms 0ms 17 360 61ms 0ms 18 360 64ms 0ms 19 360 62ms 0ms 20 360 63ms 0ms 21 360 62ms 0ms 22 360 61ms 0ms 23 338 58ms 0ms Dec 01 00 360 69ms 0ms 01 360 65ms 0ms 02 360 66ms 0ms 03 360 65ms 0ms 04 360 62ms 0ms 05 360 208ms 0ms 06 360 63ms 0ms 07 360 63ms 0ms 08 360 61ms 0ms 09 360 61ms 0ms 10 360 63ms 0ms 11 359 64ms 0ms 12 360 63ms 0ms 13 360 63ms 0ms 14 360 60ms 0ms 15 360 63ms 0ms 16 360 65ms 0ms 17 360 64ms 0ms 18 360 61ms 0ms 19 360 63ms 0ms 20 360 63ms 0ms 21 360 63ms 0ms 22 360 63ms 0ms 23 360 62ms 0ms Dec 02 00 360 63ms 0ms 01 360 62ms 0ms 02 360 62ms 0ms 03 360 61ms 0ms 04 360 62ms 0ms 05 360 79ms 0ms 06 360 86ms 0ms 07 360 82ms 0ms 08 360 89ms 0ms 09 360 85ms 0ms 10 360 85ms 0ms 11 360 85ms 0ms 12 360 84ms 0ms 13 360 83ms 0ms 14 360 83ms 0ms 15 360 84ms 0ms 16 360 86ms 0ms 17 360 64ms 0ms 18 360 62ms 0ms 19 360 61ms 0ms 20 360 65ms 0ms 21 360 62ms 0ms 22 360 63ms 0ms 23 360 61ms 0ms Dec 03 00 360 62ms 0ms 01 360 63ms 0ms 02 360 63ms 0ms 03 360 60ms 0ms 04 360 59ms 0ms 05 360 135ms 0ms 06 360 136ms 0ms 07 360 133ms 0ms 08 360 133ms 0ms 09 360 135ms 0ms 10 360 129ms 0ms 11 360 126ms 0ms 12 360 128ms 0ms 13 360 133ms 0ms 14 360 136ms 0ms 15 360 134ms 0ms 16 360 131ms 0ms 17 360 57ms 0ms 18 360 58ms 0ms 19 360 63ms 0ms 20 360 67ms 0ms 21 360 66ms 0ms 22 360 66ms 0ms 23 360 65ms 0ms Dec 04 00 360 66ms 0ms 01 360 65ms 0ms 02 360 66ms 0ms 03 360 66ms 0ms 04 360 69ms 0ms 05 360 108ms 0ms 06 359 91ms 0ms 07 360 59ms 0ms 08 360 60ms 0ms 09 360 60ms 0ms 10 360 56ms 0ms 11 360 59ms 0ms 12 360 62ms 0ms 13 360 56ms 0ms 14 360 59ms 0ms 15 360 60ms 0ms 16 360 60ms 0ms 17 360 60ms 0ms 18 360 59ms 0ms 19 360 59ms 0ms 20 360 61ms 0ms 21 360 61ms 0ms 22 360 59ms 0ms 23 360 60ms 0ms Dec 05 00 360 62ms 0ms 01 360 61ms 0ms 02 360 58ms 0ms 03 360 59ms 0ms 04 360 63ms 0ms 05 360 57ms 0ms 06 360 60ms 0ms 07 360 58ms 0ms 08 360 60ms 0ms 09 360 60ms 0ms 10 360 56ms 0ms 11 360 59ms 0ms 12 360 60ms 0ms 13 360 61ms 0ms 14 360 60ms 0ms 15 360 57ms 0ms 16 360 58ms 0ms 17 360 58ms 0ms 18 360 59ms 0ms 19 360 60ms 0ms 20 360 58ms 0ms 21 360 62ms 0ms 22 360 62ms 0ms 23 360 60ms 0ms Dec 06 00 360 60ms 0ms 01 360 60ms 0ms 02 360 60ms 0ms 03 360 59ms 0ms 04 360 63ms 0ms 05 360 58ms 0ms 06 360 61ms 0ms 07 360 58ms 0ms 08 360 60ms 0ms 09 360 58ms 0ms 10 360 59ms 0ms 11 360 57ms 0ms 12 360 61ms 0ms 13 360 58ms 0ms 14 360 58ms 0ms 15 360 59ms 0ms 16 360 61ms 0ms 17 360 58ms 0ms 18 360 59ms 0ms 19 360 58ms 0ms 20 360 61ms 0ms 21 360 61ms 0ms 22 360 59ms 0ms 23 360 59ms 0ms [ User: tng_migration_user - Total duration: 11s728ms - Times executed: 60456 ]
[ Application: [unknown] - Total duration: 11s728ms - Times executed: 60456 ]
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = 'ERROR' AND n0_.processed_time >= '2025-11-24 05:02:25';
Date: 2025-12-01 05:02:25 Duration: 144ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = 'ERROR' AND n0_.processed_time >= '2025-11-24 00:32:57';
Date: 2025-12-01 00:32:57 Duration: 5ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = 'ERROR' AND n0_.processed_time >= '2025-11-23 17:00:15';
Date: 2025-11-30 17:00:15 Duration: 2ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
11 60,456 7s333ms 0ms 4ms 0ms select t0.id as id_1, t0.version as version_2, t0.created_at as created_at_3, t0.name as name_4, t0.command as command_5, t0.arguments as arguments_6, t0.cron_expression as cron_expression_7, t0.last_execution as last_execution_8, t0.last_return_code as last_return_code_9, t0.log_file as log_file_10, t0.priority as priority_11, t0.execute_immediately as execute_immediately_12, t0.disabled as disabled_13, t0.locked as locked_14, t0.ping_back_url as ping_back_url_15, t0.ping_back_failed_url as ping_back_failed_url_16, t0.notes as notes_17 from scheduled_command t0 order by t0.disabled asc, t0.priority desc;Times Reported Time consuming queries #11
Day Hour Count Duration Avg duration Nov 30 00 360 46ms 0ms 01 360 42ms 0ms 02 360 43ms 0ms 03 360 43ms 0ms 04 360 44ms 0ms 05 360 44ms 0ms 06 360 44ms 0ms 07 360 45ms 0ms 08 360 45ms 0ms 09 360 44ms 0ms 10 360 45ms 0ms 11 360 45ms 0ms 12 360 45ms 0ms 13 360 45ms 0ms 14 360 45ms 0ms 15 360 47ms 0ms 16 360 46ms 0ms 17 360 44ms 0ms 18 360 46ms 0ms 19 360 46ms 0ms 20 360 41ms 0ms 21 360 41ms 0ms 22 360 41ms 0ms 23 338 39ms 0ms Dec 01 00 360 43ms 0ms 01 360 43ms 0ms 02 360 44ms 0ms 03 360 43ms 0ms 04 360 42ms 0ms 05 360 47ms 0ms 06 360 42ms 0ms 07 360 42ms 0ms 08 360 42ms 0ms 09 360 42ms 0ms 10 360 43ms 0ms 11 359 44ms 0ms 12 360 43ms 0ms 13 360 44ms 0ms 14 360 42ms 0ms 15 360 45ms 0ms 16 360 45ms 0ms 17 360 46ms 0ms 18 360 44ms 0ms 19 360 45ms 0ms 20 360 40ms 0ms 21 360 42ms 0ms 22 360 42ms 0ms 23 360 41ms 0ms Dec 02 00 360 41ms 0ms 01 360 41ms 0ms 02 360 41ms 0ms 03 360 41ms 0ms 04 360 40ms 0ms 05 360 39ms 0ms 06 360 42ms 0ms 07 360 41ms 0ms 08 360 43ms 0ms 09 360 42ms 0ms 10 360 42ms 0ms 11 360 42ms 0ms 12 360 42ms 0ms 13 360 41ms 0ms 14 360 42ms 0ms 15 360 42ms 0ms 16 360 43ms 0ms 17 360 43ms 0ms 18 360 44ms 0ms 19 360 43ms 0ms 20 360 45ms 0ms 21 360 40ms 0ms 22 360 40ms 0ms 23 360 40ms 0ms Dec 03 00 360 40ms 0ms 01 360 41ms 0ms 02 360 42ms 0ms 03 360 40ms 0ms 04 360 40ms 0ms 05 360 45ms 0ms 06 360 45ms 0ms 07 360 44ms 0ms 08 360 44ms 0ms 09 360 45ms 0ms 10 360 44ms 0ms 11 360 43ms 0ms 12 360 45ms 0ms 13 360 46ms 0ms 14 360 46ms 0ms 15 360 46ms 0ms 16 360 45ms 0ms 17 360 44ms 0ms 18 360 44ms 0ms 19 360 43ms 0ms 20 360 46ms 0ms 21 360 43ms 0ms 22 360 43ms 0ms 23 360 43ms 0ms Dec 04 00 360 45ms 0ms 01 360 44ms 0ms 02 360 44ms 0ms 03 360 45ms 0ms 04 360 46ms 0ms 05 360 44ms 0ms 06 359 42ms 0ms 07 360 41ms 0ms 08 360 42ms 0ms 09 360 42ms 0ms 10 360 41ms 0ms 11 360 42ms 0ms 12 360 44ms 0ms 13 360 41ms 0ms 14 360 43ms 0ms 15 360 44ms 0ms 16 360 43ms 0ms 17 360 44ms 0ms 18 360 44ms 0ms 19 360 44ms 0ms 20 360 45ms 0ms 21 360 46ms 0ms 22 360 41ms 0ms 23 360 42ms 0ms Dec 05 00 360 43ms 0ms 01 360 42ms 0ms 02 360 41ms 0ms 03 360 41ms 0ms 04 360 43ms 0ms 05 360 41ms 0ms 06 360 43ms 0ms 07 360 42ms 0ms 08 360 43ms 0ms 09 360 43ms 0ms 10 360 41ms 0ms 11 360 42ms 0ms 12 360 44ms 0ms 13 360 45ms 0ms 14 360 44ms 0ms 15 360 43ms 0ms 16 360 43ms 0ms 17 360 43ms 0ms 18 360 45ms 0ms 19 360 45ms 0ms 20 360 44ms 0ms 21 360 47ms 0ms 22 360 42ms 0ms 23 360 42ms 0ms Dec 06 00 360 43ms 0ms 01 360 42ms 0ms 02 360 43ms 0ms 03 360 42ms 0ms 04 360 44ms 0ms 05 360 41ms 0ms 06 360 42ms 0ms 07 360 42ms 0ms 08 360 43ms 0ms 09 360 42ms 0ms 10 360 43ms 0ms 11 360 41ms 0ms 12 360 45ms 0ms 13 360 42ms 0ms 14 360 42ms 0ms 15 360 43ms 0ms 16 360 44ms 0ms 17 360 43ms 0ms 18 360 46ms 0ms 19 360 44ms 0ms 20 360 46ms 0ms 21 360 47ms 0ms 22 360 46ms 0ms 23 360 42ms 0ms [ User: tng_migration_user - Total duration: 7s333ms - Times executed: 60456 ]
[ Application: [unknown] - Total duration: 7s333ms - Times executed: 60456 ]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-12-01 05:02:25 Duration: 4ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-30 00:01:42 Duration: 3ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-12-06 18:10:17 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
12 60,456 1s52ms 0ms 0ms 0ms select s0_.id as id_0, s0_.version as version_1, s0_.created_at as created_at_2, s0_.name as name_3, s0_.command as command_4, s0_.arguments as arguments_5, s0_.cron_expression as cron_expression_6, s0_.last_execution as last_execution_7, s0_.last_return_code as last_return_code_8, s0_.log_file as log_file_9, s0_.priority as priority_10, s0_.execute_immediately as execute_immediately_11, s0_.disabled as disabled_12, s0_.locked as locked_13, s0_.ping_back_url as ping_back_url_14, s0_.ping_back_failed_url as ping_back_failed_url_15, s0_.notes as notes_16 from scheduled_command s0_ where s0_.disabled = ? and s0_.last_return_code <> ?;Times Reported Time consuming queries #12
Day Hour Count Duration Avg duration Nov 30 00 360 5ms 0ms 01 360 5ms 0ms 02 360 5ms 0ms 03 360 5ms 0ms 04 360 6ms 0ms 05 360 5ms 0ms 06 360 5ms 0ms 07 360 6ms 0ms 08 360 6ms 0ms 09 360 6ms 0ms 10 360 6ms 0ms 11 360 6ms 0ms 12 360 6ms 0ms 13 360 6ms 0ms 14 360 6ms 0ms 15 360 7ms 0ms 16 360 7ms 0ms 17 360 6ms 0ms 18 360 7ms 0ms 19 360 7ms 0ms 20 360 5ms 0ms 21 360 5ms 0ms 22 360 5ms 0ms 23 338 5ms 0ms Dec 01 00 360 6ms 0ms 01 360 6ms 0ms 02 360 6ms 0ms 03 360 6ms 0ms 04 360 5ms 0ms 05 360 6ms 0ms 06 360 5ms 0ms 07 360 5ms 0ms 08 360 5ms 0ms 09 360 6ms 0ms 10 360 6ms 0ms 11 359 6ms 0ms 12 360 6ms 0ms 13 360 6ms 0ms 14 360 6ms 0ms 15 360 7ms 0ms 16 360 7ms 0ms 17 360 7ms 0ms 18 360 7ms 0ms 19 360 7ms 0ms 20 360 4ms 0ms 21 360 5ms 0ms 22 360 5ms 0ms 23 360 5ms 0ms Dec 02 00 360 4ms 0ms 01 360 4ms 0ms 02 360 4ms 0ms 03 360 4ms 0ms 04 360 4ms 0ms 05 360 4ms 0ms 06 360 5ms 0ms 07 360 5ms 0ms 08 360 6ms 0ms 09 360 6ms 0ms 10 360 6ms 0ms 11 360 6ms 0ms 12 360 6ms 0ms 13 360 6ms 0ms 14 360 6ms 0ms 15 360 6ms 0ms 16 360 7ms 0ms 17 360 7ms 0ms 18 360 7ms 0ms 19 360 7ms 0ms 20 360 8ms 0ms 21 360 5ms 0ms 22 360 5ms 0ms 23 360 5ms 0ms Dec 03 00 360 5ms 0ms 01 360 5ms 0ms 02 360 5ms 0ms 03 360 5ms 0ms 04 360 5ms 0ms 05 360 7ms 0ms 06 360 7ms 0ms 07 360 7ms 0ms 08 360 7ms 0ms 09 360 8ms 0ms 10 360 8ms 0ms 11 360 7ms 0ms 12 360 8ms 0ms 13 360 8ms 0ms 14 360 8ms 0ms 15 360 8ms 0ms 16 360 8ms 0ms 17 360 7ms 0ms 18 360 7ms 0ms 19 360 7ms 0ms 20 360 7ms 0ms 21 360 4ms 0ms 22 360 5ms 0ms 23 360 5ms 0ms Dec 04 00 360 6ms 0ms 01 360 6ms 0ms 02 360 6ms 0ms 03 360 6ms 0ms 04 360 6ms 0ms 05 360 5ms 0ms 06 359 5ms 0ms 07 360 5ms 0ms 08 360 5ms 0ms 09 360 5ms 0ms 10 360 5ms 0ms 11 360 6ms 0ms 12 360 6ms 0ms 13 360 5ms 0ms 14 360 6ms 0ms 15 360 6ms 0ms 16 360 6ms 0ms 17 360 7ms 0ms 18 360 6ms 0ms 19 360 7ms 0ms 20 360 7ms 0ms 21 360 7ms 0ms 22 360 5ms 0ms 23 360 5ms 0ms Dec 05 00 360 5ms 0ms 01 360 5ms 0ms 02 360 4ms 0ms 03 360 4ms 0ms 04 360 5ms 0ms 05 360 5ms 0ms 06 360 5ms 0ms 07 360 5ms 0ms 08 360 5ms 0ms 09 360 5ms 0ms 10 360 5ms 0ms 11 360 5ms 0ms 12 360 6ms 0ms 13 360 6ms 0ms 14 360 6ms 0ms 15 360 6ms 0ms 16 360 6ms 0ms 17 360 6ms 0ms 18 360 6ms 0ms 19 360 6ms 0ms 20 360 6ms 0ms 21 360 7ms 0ms 22 360 5ms 0ms 23 360 5ms 0ms Dec 06 00 360 5ms 0ms 01 360 5ms 0ms 02 360 5ms 0ms 03 360 5ms 0ms 04 360 6ms 0ms 05 360 5ms 0ms 06 360 5ms 0ms 07 360 5ms 0ms 08 360 5ms 0ms 09 360 5ms 0ms 10 360 5ms 0ms 11 360 5ms 0ms 12 360 6ms 0ms 13 360 5ms 0ms 14 360 5ms 0ms 15 360 6ms 0ms 16 360 6ms 0ms 17 360 6ms 0ms 18 360 6ms 0ms 19 360 6ms 0ms 20 360 7ms 0ms 21 360 7ms 0ms 22 360 7ms 0ms 23 360 5ms 0ms [ User: tng_migration_user - Total duration: 1s52ms - Times executed: 60456 ]
[ Application: [unknown] - Total duration: 1s52ms - Times executed: 60456 ]
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = 'f' AND s0_.last_return_code <> '0';
Date: 2025-11-30 04:14:17 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = 'f' AND s0_.last_return_code <> '0';
Date: 2025-11-30 09:07:15 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = 'f' AND s0_.last_return_code <> '0';
Date: 2025-12-05 00:25:17 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
13 51,364 1s360ms 0ms 4ms 0ms select s0_.is_archived as is_archived_0, s0_.created_at as created_at_1, s0_.updated_at as updated_at_2, s0_.ordering as ordering_3, s0_.id as id_4, s0_.is_required as is_required_5, s0_.subcohort_id as subcohort_id_6, s0_.info_consent_id as info_consent_id_7, s0_.subject_role_code as subject_role_code_8 from core.subcohort_inform_consent s0_ inner join core.subcohort s1_ on s0_.subcohort_id = s1_.id where s0_.info_consent_id = s1_.inform_consent_id and s0_.subcohort_id in (...);Times Reported Time consuming queries #13
Day Hour Count Duration Avg duration Nov 30 00 123 2ms 0ms 05 109 3ms 0ms 07 369 7ms 0ms 10 39 0ms 0ms 11 246 5ms 0ms 13 306 6ms 0ms 15 806 17ms 0ms 18 142 3ms 0ms 21 246 5ms 0ms 22 1,204 22ms 0ms Dec 01 05 71 2ms 0ms 07 207 4ms 0ms 08 195 3ms 0ms 09 884 31ms 0ms 10 719 28ms 0ms 11 482 9ms 0ms 12 250 4ms 0ms 13 45 2ms 0ms 14 162 4ms 0ms 15 351 7ms 0ms 16 1,131 24ms 0ms 18 4,997 155ms 0ms 19 1,874 52ms 0ms 20 2,640 73ms 0ms 21 1,248 30ms 0ms 22 599 14ms 0ms 23 1,464 28ms 0ms Dec 02 05 120 3ms 0ms 07 113 5ms 0ms 08 434 13ms 0ms 09 789 24ms 0ms 10 1,268 40ms 0ms 11 377 9ms 0ms 12 1,010 23ms 0ms 13 670 26ms 0ms 14 508 20ms 0ms 15 331 6ms 0ms 16 286 8ms 0ms 17 521 15ms 0ms 18 302 6ms 0ms 21 246 5ms 0ms 23 301 6ms 0ms Dec 03 02 246 5ms 0ms 05 105 2ms 0ms 06 119 2ms 0ms 07 561 22ms 0ms 08 1,538 35ms 0ms 09 1,019 29ms 0ms 10 427 14ms 0ms 11 659 20ms 0ms 12 510 22ms 0ms 13 85 5ms 0ms 14 412 12ms 0ms 15 189 4ms 0ms 16 469 10ms 0ms 17 471 13ms 0ms 18 82 1ms 0ms 19 423 13ms 0ms 20 462 9ms 0ms 22 1,107 23ms 0ms 23 787 18ms 0ms Dec 04 05 131 3ms 0ms 06 140 3ms 0ms 07 95 2ms 0ms 08 331 9ms 0ms 09 582 17ms 0ms 10 202 4ms 0ms 11 384 8ms 0ms 12 297 6ms 0ms 13 157 3ms 0ms 14 1,339 27ms 0ms 15 46 1ms 0ms 16 596 12ms 0ms 18 80 1ms 0ms 21 199 7ms 0ms 23 224 6ms 0ms Dec 05 00 71 1ms 0ms 05 350 15ms 0ms 06 360 7ms 0ms 07 153 3ms 0ms 08 596 13ms 0ms 09 636 17ms 0ms 10 104 3ms 0ms 11 447 10ms 0ms 12 418 8ms 0ms 13 382 11ms 0ms 14 91 2ms 0ms 15 1 0ms 0ms 17 65 1ms 0ms 18 130 3ms 0ms 19 520 10ms 0ms 20 226 4ms 0ms 23 246 5ms 0ms Dec 06 00 123 2ms 0ms 05 122 3ms 0ms 08 94 2ms 0ms 09 246 4ms 0ms 11 2 0ms 0ms 12 246 7ms 0ms 13 4 0ms 0ms 14 222 4ms 0ms 17 639 15ms 0ms 18 1,077 22ms 0ms 19 113 2ms 0ms 20 306 6ms 0ms 21 180 3ms 0ms 22 103 2ms 0ms 23 432 9ms 0ms [ User: tng_migration_user - Total duration: 1s360ms - Times executed: 51364 ]
[ Application: [unknown] - Total duration: 1s360ms - Times executed: 51364 ]
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ('53');
Date: 2025-12-05 05:29:21 Duration: 4ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ('39', '64', '66', '70', '20', '12', '4', '11', '1', '6', '7', '8', '9', '10', '41', '68', '53', '5', '40', '67', '43', '75', '72', '78', '79', '71', '73', '81', '37', '82');
Date: 2025-12-05 05:29:21 Duration: 2ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ('39', '64', '66', '70', '20', '12', '4', '11', '1', '6', '7', '8', '9', '10', '41', '68', '53', '5', '40', '67', '43', '75', '72', '78', '79', '71', '73', '81', '37', '82');
Date: 2025-12-03 07:59:02 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
14 40,991 1s175ms 0ms 0ms 0ms select a0_.id as id_0, a0_.name as name_1, a0_.acronym as acronym_2, a0_.description as description_3, a0_.structure_root_group_id as structure_root_group_id_4, a0_.structure_left_tree as structure_left_tree_5, a0_.structure_right_tree as structure_right_tree_6, a0_.info as info_7 from acl_group a0_ where a0_.structure_root_group_id = ? and a0_.structure_left_tree > ? and a0_.structure_right_tree < ? order by a0_.structure_left_tree asc;Times Reported Time consuming queries #14
Day Hour Count Duration Avg duration Nov 30 00 3 0ms 0ms 07 10 0ms 0ms 10 4 0ms 0ms 11 7 0ms 0ms 13 9 0ms 0ms 15 53 2ms 0ms 18 12 0ms 0ms 21 4 0ms 0ms 22 15 0ms 0ms Dec 01 06 18 0ms 0ms 07 384 13ms 0ms 08 405 11ms 0ms 09 2,951 90ms 0ms 10 1,476 44ms 0ms 11 674 19ms 0ms 12 540 16ms 0ms 13 161 6ms 0ms 14 545 16ms 0ms 15 114 3ms 0ms 16 94 3ms 0ms 18 216 9ms 0ms 19 69 3ms 0ms 20 86 3ms 0ms 21 40 1ms 0ms 22 13 0ms 0ms 23 65 2ms 0ms Dec 02 06 66 2ms 0ms 07 561 18ms 0ms 08 993 29ms 0ms 09 1,288 40ms 0ms 10 485 16ms 0ms 11 1,032 26ms 0ms 12 782 20ms 0ms 13 1,766 44ms 0ms 14 583 16ms 0ms 15 173 5ms 0ms 16 36 1ms 0ms 17 20 0ms 0ms 18 7 0ms 0ms 21 8 0ms 0ms 23 5 0ms 0ms Dec 03 02 7 0ms 0ms 06 74 2ms 0ms 07 1,048 28ms 0ms 08 2,975 80ms 0ms 09 1,730 55ms 0ms 10 387 12ms 0ms 11 2,263 55ms 0ms 12 694 22ms 0ms 13 311 10ms 0ms 14 459 13ms 0ms 15 501 15ms 0ms 16 149 5ms 0ms 17 15 0ms 0ms 18 4 0ms 0ms 19 21 0ms 0ms 20 14 0ms 0ms 22 18 0ms 0ms 23 31 1ms 0ms Dec 04 06 4 0ms 0ms 07 924 20ms 0ms 08 1,635 39ms 0ms 09 2,942 75ms 0ms 10 627 17ms 0ms 11 567 13ms 0ms 12 428 12ms 0ms 13 392 11ms 0ms 14 183 4ms 0ms 15 382 10ms 0ms 16 854 23ms 0ms 18 4 0ms 0ms 21 8 0ms 0ms 23 18 0ms 0ms Dec 05 00 3 0ms 0ms 05 8 0ms 0ms 06 12 0ms 0ms 07 672 19ms 0ms 08 470 15ms 0ms 09 704 22ms 0ms 10 687 18ms 0ms 11 311 10ms 0ms 12 294 8ms 0ms 13 1,621 41ms 0ms 14 420 12ms 0ms 15 6 0ms 0ms 17 4 0ms 0ms 18 7 0ms 0ms 19 19 0ms 0ms 20 7 0ms 0ms 23 7 0ms 0ms Dec 06 00 3 0ms 0ms 08 8 0ms 0ms 09 7 0ms 0ms 10 2 0ms 0ms 11 7 0ms 0ms 12 16 0ms 0ms 13 160 4ms 0ms 14 7 0ms 0ms 17 25 0ms 0ms 18 29 1ms 0ms 19 5 0ms 0ms 20 7 0ms 0ms 21 4 0ms 0ms 22 4 0ms 0ms 23 13 0ms 0ms [ User: tng_migration_user - Total duration: 1s175ms - Times executed: 40991 ]
[ Application: [unknown] - Total duration: 1s175ms - Times executed: 40991 ]
-
SELECT a0_.ID AS id_0, a0_.NAME AS name_1, a0_.ACRONYM AS acronym_2, a0_.DESCRIPTION AS description_3, a0_.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_4, a0_.STRUCTURE_LEFT_TREE AS structure_left_tree_5, a0_.STRUCTURE_RIGHT_TREE AS structure_right_tree_6, a0_.INFO AS info_7 FROM ACL_GROUP a0_ WHERE a0_.STRUCTURE_ROOT_GROUP_ID = '1028' AND a0_.STRUCTURE_LEFT_TREE > '1' AND a0_.STRUCTURE_RIGHT_TREE < '6' ORDER BY a0_.STRUCTURE_LEFT_TREE ASC;
Date: 2025-12-03 15:32:31 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT a0_.ID AS id_0, a0_.NAME AS name_1, a0_.ACRONYM AS acronym_2, a0_.DESCRIPTION AS description_3, a0_.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_4, a0_.STRUCTURE_LEFT_TREE AS structure_left_tree_5, a0_.STRUCTURE_RIGHT_TREE AS structure_right_tree_6, a0_.INFO AS info_7 FROM ACL_GROUP a0_ WHERE a0_.STRUCTURE_ROOT_GROUP_ID = '1025' AND a0_.STRUCTURE_LEFT_TREE > '2' AND a0_.STRUCTURE_RIGHT_TREE < '7' ORDER BY a0_.STRUCTURE_LEFT_TREE ASC;
Date: 2025-12-05 09:47:43 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT a0_.ID AS id_0, a0_.NAME AS name_1, a0_.ACRONYM AS acronym_2, a0_.DESCRIPTION AS description_3, a0_.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_4, a0_.STRUCTURE_LEFT_TREE AS structure_left_tree_5, a0_.STRUCTURE_RIGHT_TREE AS structure_right_tree_6, a0_.INFO AS info_7 FROM ACL_GROUP a0_ WHERE a0_.STRUCTURE_ROOT_GROUP_ID = '1026' AND a0_.STRUCTURE_LEFT_TREE > '1' AND a0_.STRUCTURE_RIGHT_TREE < '46' ORDER BY a0_.STRUCTURE_LEFT_TREE ASC;
Date: 2025-12-01 09:55:18 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
15 39,811 11s836ms 0ms 8ms 0ms fetch ? from c1;Times Reported Time consuming queries #15
Day Hour Count Duration Avg duration Nov 30 23 5,685 1s593ms 0ms Dec 01 23 5,686 1s595ms 0ms Dec 02 23 5,686 1s837ms 0ms Dec 03 23 5,688 1s735ms 0ms Dec 04 23 5,688 1s646ms 0ms Dec 05 23 5,689 1s922ms 0ms Dec 06 23 5,689 1s504ms 0ms [ User: tng__dwh_celspac_fdw - Total duration: 11s836ms - Times executed: 39811 ]
[ Application: postgres_fdw - Total duration: 11s836ms - Times executed: 39811 ]
-
FETCH 100 FROM c1;
Date: 2025-12-04 23:35:20 Duration: 8ms Database: celspac User: tng__dwh_celspac_fdw Remote: 10.16.50.4 Application: postgres_fdw Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
FETCH 100 FROM c1;
Date: 2025-12-05 23:35:20 Duration: 7ms Database: celspac User: tng__dwh_celspac_fdw Remote: 10.16.50.4 Application: postgres_fdw Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
FETCH 100 FROM c1;
Date: 2025-12-03 23:35:15 Duration: 6ms Database: celspac User: tng__dwh_celspac_fdw Remote: 10.16.50.4 Application: postgres_fdw Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
16 38,836 3s657ms 0ms 0ms 0ms select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.subject_subcohort_id as subject_subcohort_id_11, m0_.form_structure_variant_id as form_structure_variant_id_12, m0_.form_id as form_id_13, m0_.form_state_code as form_state_code_14 from core.mv_subject_form m0_ where m0_.form_structure_variant_id = ? and m0_.form_state_code not in (...) and m0_.use_alternative <> ? and m0_.result_date is not null and (m0_.result_date between ? and ?);Times Reported Time consuming queries #16
Day Hour Count Duration Avg duration Nov 30 05 292 26ms 0ms 06 292 29ms 0ms 07 292 27ms 0ms 08 292 30ms 0ms 09 292 26ms 0ms 10 292 25ms 0ms 11 292 27ms 0ms 12 292 28ms 0ms 13 292 28ms 0ms 14 292 26ms 0ms 15 292 29ms 0ms 16 292 28ms 0ms 17 292 25ms 0ms 18 292 27ms 0ms 19 292 24ms 0ms 20 292 26ms 0ms 21 292 24ms 0ms 22 292 27ms 0ms 23 292 25ms 0ms Dec 01 05 292 27ms 0ms 06 292 26ms 0ms 07 292 26ms 0ms 08 292 26ms 0ms 09 292 27ms 0ms 10 292 28ms 0ms 11 292 27ms 0ms 12 292 27ms 0ms 13 292 27ms 0ms 14 292 28ms 0ms 15 292 32ms 0ms 16 292 27ms 0ms 17 292 27ms 0ms 18 292 31ms 0ms 19 292 25ms 0ms 20 292 30ms 0ms 21 292 29ms 0ms 22 292 31ms 0ms 23 292 27ms 0ms Dec 02 05 292 27ms 0ms 06 292 27ms 0ms 07 292 29ms 0ms 08 292 32ms 0ms 09 292 28ms 0ms 10 292 33ms 0ms 11 292 26ms 0ms 12 292 25ms 0ms 13 292 25ms 0ms 14 292 25ms 0ms 15 292 24ms 0ms 16 292 26ms 0ms 17 292 27ms 0ms 18 292 28ms 0ms 19 292 24ms 0ms 20 292 25ms 0ms 21 292 25ms 0ms 22 292 27ms 0ms 23 292 29ms 0ms Dec 03 05 292 29ms 0ms 06 292 26ms 0ms 07 292 25ms 0ms 08 292 27ms 0ms 09 292 26ms 0ms 10 292 29ms 0ms 11 292 27ms 0ms 12 292 28ms 0ms 13 292 26ms 0ms 14 292 27ms 0ms 15 292 24ms 0ms 16 292 26ms 0ms 17 292 26ms 0ms 18 292 27ms 0ms 19 292 26ms 0ms 20 292 28ms 0ms 21 292 23ms 0ms 22 292 27ms 0ms 23 292 27ms 0ms Dec 04 05 292 26ms 0ms 06 292 28ms 0ms 07 292 26ms 0ms 08 292 27ms 0ms 09 292 25ms 0ms 10 292 33ms 0ms 11 292 27ms 0ms 12 292 32ms 0ms 13 292 25ms 0ms 14 292 29ms 0ms 15 292 30ms 0ms 16 292 25ms 0ms 17 292 28ms 0ms 18 292 27ms 0ms 19 292 27ms 0ms 20 292 26ms 0ms 21 292 25ms 0ms 22 292 27ms 0ms 23 292 29ms 0ms Dec 05 05 292 27ms 0ms 06 292 27ms 0ms 07 292 26ms 0ms 08 292 27ms 0ms 09 292 26ms 0ms 10 292 26ms 0ms 11 292 26ms 0ms 12 292 29ms 0ms 13 292 25ms 0ms 14 292 26ms 0ms 15 292 29ms 0ms 16 292 26ms 0ms 17 292 25ms 0ms 18 292 27ms 0ms 19 292 26ms 0ms 20 292 25ms 0ms 21 292 26ms 0ms 22 292 28ms 0ms 23 292 27ms 0ms Dec 06 05 292 26ms 0ms 06 292 25ms 0ms 07 292 26ms 0ms 08 292 26ms 0ms 09 292 26ms 0ms 10 292 30ms 0ms 11 292 25ms 0ms 12 292 29ms 0ms 13 292 26ms 0ms 14 292 27ms 0ms 15 292 25ms 0ms 16 292 24ms 0ms 17 292 26ms 0ms 18 292 30ms 0ms 19 292 27ms 0ms 20 292 27ms 0ms 21 292 37ms 0ms 22 292 29ms 0ms 23 292 28ms 0ms [ User: tng_migration_user - Total duration: 3s657ms - Times executed: 38836 ]
[ Application: [unknown] - Total duration: 3s657ms - Times executed: 38836 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id = '77' AND m0_.form_state_code NOT IN ('READY', 'PROCESSING', 'DONE', 'CLOSED', 'EXPIRED', 'EXPIRED_EMPTY') AND m0_.use_alternative <> 't' AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN '2023-05-19 08:00:02' AND '2023-06-18 08:00:02');
Date: 2025-12-02 08:00:04 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id = '173' AND m0_.form_state_code NOT IN ('READY', 'PROCESSING', 'DONE', 'CLOSED', 'EXPIRED', 'EXPIRED_EMPTY') AND m0_.use_alternative <> 't' AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN '2022-10-03 10:00:01' AND '2022-11-17 10:00:01');
Date: 2025-12-04 10:00:03 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id = '171' AND m0_.form_state_code NOT IN ('READY', 'PROCESSING', 'DONE', 'CLOSED', 'EXPIRED', 'EXPIRED_EMPTY') AND m0_.use_alternative <> 't' AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN '2022-10-05 21:00:01' AND '2022-11-19 21:00:01');
Date: 2025-12-06 21:00:04 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
17 38,127 427ms 0ms 2ms 0ms select t0.is_archived as is_archived_1, t0.created_at as created_at_2, t0.updated_at as updated_at_3, t0.ordering as ordering_4, t0.id as id_5, t0.is_required as is_required_6, t0.subcohort_id as subcohort_id_7, t0.info_consent_id as info_consent_id_8, t0.subject_role_code as subject_role_code_9 from core.subcohort_inform_consent t0 where t0.id = ?;Times Reported Time consuming queries #17
Day Hour Count Duration Avg duration Nov 30 00 6 0ms 0ms 05 7 0ms 0ms 06 5 0ms 0ms 07 18 0ms 0ms 10 13 0ms 0ms 11 12 0ms 0ms 13 14 0ms 0ms 15 426 4ms 0ms 18 85 0ms 0ms 21 12 0ms 0ms 22 344 3ms 0ms Dec 01 06 7 0ms 0ms 07 440 4ms 0ms 08 492 5ms 0ms 09 2,879 30ms 0ms 10 1,729 18ms 0ms 11 927 10ms 0ms 12 898 9ms 0ms 13 402 4ms 0ms 14 716 7ms 0ms 15 435 4ms 0ms 16 222 2ms 0ms 18 1,216 13ms 0ms 19 332 3ms 0ms 20 516 5ms 0ms 21 394 3ms 0ms 22 73 0ms 0ms 23 307 3ms 0ms Dec 02 05 3 0ms 0ms 07 214 2ms 0ms 08 1,569 17ms 0ms 09 2,342 25ms 0ms 10 840 9ms 0ms 11 533 5ms 0ms 12 197 2ms 0ms 13 552 7ms 0ms 14 450 5ms 0ms 15 261 2ms 0ms 16 281 2ms 0ms 17 148 1ms 0ms 18 24 0ms 0ms 21 12 0ms 0ms 23 86 0ms 0ms Dec 03 02 12 0ms 0ms 05 7 0ms 0ms 06 57 0ms 0ms 07 405 4ms 0ms 08 2,332 25ms 0ms 09 1,350 15ms 0ms 10 458 4ms 0ms 11 562 6ms 0ms 12 756 8ms 0ms 13 294 3ms 0ms 14 286 3ms 0ms 15 499 5ms 0ms 16 134 1ms 0ms 17 39 0ms 0ms 18 60 0ms 0ms 19 61 0ms 0ms 20 25 0ms 0ms 22 406 4ms 0ms 23 92 1ms 0ms Dec 04 05 4 0ms 0ms 06 13 0ms 0ms 07 140 1ms 0ms 08 875 10ms 0ms 09 1,320 15ms 0ms 10 546 5ms 0ms 11 234 2ms 0ms 12 317 3ms 0ms 13 187 2ms 0ms 14 452 4ms 0ms 15 177 2ms 0ms 16 1,344 14ms 0ms 18 6 0ms 0ms 21 39 0ms 0ms 23 185 1ms 0ms Dec 05 00 13 0ms 0ms 05 15 4ms 0ms 06 36 0ms 0ms 07 357 4ms 0ms 08 334 4ms 0ms 09 471 5ms 0ms 10 271 2ms 0ms 11 354 4ms 0ms 12 310 3ms 0ms 13 515 6ms 0ms 14 162 2ms 0ms 15 21 0ms 0ms 17 13 0ms 0ms 18 26 0ms 0ms 19 85 0ms 0ms 20 12 0ms 0ms 23 12 0ms 0ms Dec 06 00 6 0ms 0ms 05 3 0ms 0ms 06 6 0ms 0ms 08 26 0ms 0ms 09 12 0ms 0ms 10 13 0ms 0ms 11 64 0ms 0ms 12 44 0ms 0ms 13 84 1ms 0ms 14 12 0ms 0ms 17 132 1ms 0ms 18 498 5ms 0ms 19 6 0ms 0ms 20 14 0ms 0ms 21 57 0ms 0ms 22 6 0ms 0ms 23 24 0ms 0ms [ User: tng_migration_user - Total duration: 427ms - Times executed: 38127 ]
[ Application: [unknown] - Total duration: 427ms - Times executed: 38127 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.ordering AS ordering_4, t0.id AS id_5, t0.is_required AS is_required_6, t0.subcohort_id AS subcohort_id_7, t0.info_consent_id AS info_consent_id_8, t0.subject_role_code AS subject_role_code_9 FROM core.subcohort_inform_consent t0 WHERE t0.id = '384';
Date: 2025-12-05 05:29:21 Duration: 2ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.ordering AS ordering_4, t0.id AS id_5, t0.is_required AS is_required_6, t0.subcohort_id AS subcohort_id_7, t0.info_consent_id AS info_consent_id_8, t0.subject_role_code AS subject_role_code_9 FROM core.subcohort_inform_consent t0 WHERE t0.id = '383';
Date: 2025-12-05 05:29:21 Duration: 2ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.ordering AS ordering_4, t0.id AS id_5, t0.is_required AS is_required_6, t0.subcohort_id AS subcohort_id_7, t0.info_consent_id AS info_consent_id_8, t0.subject_role_code AS subject_role_code_9 FROM core.subcohort_inform_consent t0 WHERE t0.id = '295';
Date: 2025-12-04 16:44:27 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
18 37,995 1s488ms 0ms 7ms 0ms select t0.is_archived as is_archived_1, t0.created_at as created_at_2, t0.updated_at as updated_at_3, t0.id as id_4, t0.assigned_at as assigned_at_5, t0.revoke_at as revoke_at_6, t0.cancelled_at as cancelled_at_7, t0.upload_at as upload_at_8, t0.paused_at as paused_at_9, t0.owner_user_id as owner_user_id_10, t0.owner_group_id as owner_group_id_11, t0.subject_id as subject_id_12, t0.subject_about_id as subject_about_id_13, t0.subcohort_inform_consent_id as subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code as subject_inform_consent_state_code_15, t0.activity_state_code as activity_state_code_16, t0.terminated_state_code as terminated_state_code_17, t0.assigned_by as assigned_by_18, t0.revoke_by as revoke_by_19, t0.created_by as created_by_20, t0.cancelled_by as cancelled_by_21, t0.upload_by as upload_by_22, t0.paused_by as paused_by_23, t0.subject_plugin_id as subject_plugin_id_24, t25.is_archived as is_archived_26, t25.created_at as created_at_27, t25.updated_at as updated_at_28, t25.id as id_29, t25.extend as extend_30, t25.description as description_31, t25.description_internal as description_internal_32, t25.owner_user_id as owner_user_id_33, t25.owner_group_id as owner_group_id_34, t25.subject_id as subject_id_35 from core.subject_inform_consent t0 left join core.subject_extend t25 on t0.subject_plugin_id = t25.id where t0.subject_about_id = ? and t0.subcohort_inform_consent_id in (...) limit ?;Times Reported Time consuming queries #18
Day Hour Count Duration Avg duration Nov 30 00 95 2ms 0ms 06 3 2ms 0ms 07 285 8ms 0ms 10 23 0ms 0ms 11 190 4ms 0ms 13 236 7ms 0ms 15 622 26ms 0ms 18 106 2ms 0ms 21 190 6ms 0ms 22 892 27ms 0ms Dec 01 06 20 9ms 0ms 07 180 8ms 0ms 08 67 8ms 0ms 09 788 49ms 0ms 10 471 21ms 0ms 11 144 6ms 0ms 12 196 8ms 0ms 13 38 1ms 0ms 14 128 5ms 0ms 15 176 6ms 0ms 16 845 25ms 0ms 18 3,276 101ms 0ms 19 1,293 38ms 0ms 20 1,848 56ms 0ms 21 870 26ms 0ms 22 423 12ms 0ms 23 1,143 44ms 0ms Dec 02 06 6 0ms 0ms 07 148 6ms 0ms 08 374 14ms 0ms 09 753 28ms 0ms 10 767 24ms 0ms 11 310 14ms 0ms 12 885 33ms 0ms 13 506 24ms 0ms 14 249 8ms 0ms 15 264 8ms 0ms 16 198 6ms 0ms 17 351 11ms 0ms 18 228 7ms 0ms 21 190 4ms 0ms 23 223 8ms 0ms Dec 03 02 190 5ms 0ms 06 88 3ms 0ms 07 432 19ms 0ms 08 999 42ms 0ms 09 836 35ms 0ms 10 378 14ms 0ms 11 625 22ms 0ms 12 389 19ms 0ms 13 178 9ms 0ms 14 270 11ms 0ms 15 218 9ms 0ms 16 355 10ms 0ms 17 341 12ms 0ms 18 56 1ms 0ms 19 269 8ms 0ms 20 355 9ms 0ms 22 807 27ms 0ms 23 577 18ms 0ms Dec 04 06 109 4ms 0ms 07 112 5ms 0ms 08 235 15ms 0ms 09 613 39ms 0ms 10 192 10ms 0ms 11 289 12ms 0ms 12 282 10ms 0ms 13 142 5ms 0ms 14 972 32ms 0ms 15 55 2ms 0ms 16 349 13ms 0ms 18 61 1ms 0ms 21 95 2ms 0ms 23 135 3ms 0ms Dec 05 00 45 1ms 0ms 05 190 25ms 0ms 06 281 38ms 0ms 07 214 17ms 0ms 08 526 21ms 0ms 09 584 22ms 0ms 10 196 10ms 0ms 11 393 21ms 0ms 12 362 13ms 0ms 13 375 21ms 0ms 14 113 8ms 0ms 17 41 1ms 0ms 18 82 2ms 0ms 19 345 9ms 0ms 20 174 4ms 0ms 23 190 5ms 0ms Dec 06 00 95 2ms 0ms 06 11 3ms 0ms 08 58 1ms 0ms 09 190 4ms 0ms 10 1 0ms 0ms 11 17 0ms 0ms 12 163 4ms 0ms 13 25 1ms 0ms 14 166 5ms 0ms 17 449 18ms 0ms 18 833 28ms 0ms 19 87 2ms 0ms 20 236 7ms 0ms 21 138 4ms 0ms 22 79 1ms 0ms 23 332 9ms 0ms [ User: tng_migration_user - Total duration: 1s488ms - Times executed: 37995 ]
[ Application: [unknown] - Total duration: 1s488ms - Times executed: 37995 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = '43049' AND t0.subcohort_inform_consent_id IN ('250', '249') LIMIT 1;
Date: 2025-12-05 05:29:21 Duration: 7ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = '2597' AND t0.subcohort_inform_consent_id IN ('612', '611') LIMIT 1;
Date: 2025-12-05 07:41:32 Duration: 6ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = '5255' AND t0.subcohort_inform_consent_id IN ('561', '560') LIMIT 1;
Date: 2025-12-01 08:59:19 Duration: 4ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
19 35,280 547ms 0ms 2ms 0ms select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.plan_id as plan_id_11, m0_.proband_event_id as proband_event_id_12, m0_.state_code as state_code_13, m0_.subject_subcohort_id as subject_subcohort_id_14 from core.mv_subject_event m0_ inner join core.proband_event p1_ on m0_.proband_event_id = p1_.id where m0_.plan_id in (...) and m0_.proband_event_id is not null and p1_.state_code not in (...) and (m0_.result_date between ? and ?);Times Reported Time consuming queries #19
Day Hour Count Duration Avg duration Nov 30 06 280 4ms 0ms 07 280 4ms 0ms 08 280 4ms 0ms 09 280 4ms 0ms 10 280 4ms 0ms 11 280 4ms 0ms 12 280 4ms 0ms 13 280 4ms 0ms 14 280 4ms 0ms 15 280 4ms 0ms 16 280 4ms 0ms 17 280 3ms 0ms 18 280 4ms 0ms 19 280 4ms 0ms 20 280 4ms 0ms 21 280 3ms 0ms 22 280 4ms 0ms 23 280 4ms 0ms Dec 01 06 280 4ms 0ms 07 280 4ms 0ms 08 280 4ms 0ms 09 280 4ms 0ms 10 280 4ms 0ms 11 280 3ms 0ms 12 280 3ms 0ms 13 280 3ms 0ms 14 280 4ms 0ms 15 280 4ms 0ms 16 280 3ms 0ms 17 280 3ms 0ms 18 280 3ms 0ms 19 280 3ms 0ms 20 280 4ms 0ms 21 280 3ms 0ms 22 280 3ms 0ms 23 280 3ms 0ms Dec 02 06 280 4ms 0ms 07 280 3ms 0ms 08 280 4ms 0ms 09 280 4ms 0ms 10 280 4ms 0ms 11 280 3ms 0ms 12 280 4ms 0ms 13 280 4ms 0ms 14 280 4ms 0ms 15 280 4ms 0ms 16 280 4ms 0ms 17 280 4ms 0ms 18 280 4ms 0ms 19 280 3ms 0ms 20 280 4ms 0ms 21 280 4ms 0ms 22 280 4ms 0ms 23 280 4ms 0ms Dec 03 06 280 4ms 0ms 07 280 4ms 0ms 08 280 4ms 0ms 09 280 4ms 0ms 10 280 4ms 0ms 11 280 4ms 0ms 12 280 4ms 0ms 13 280 4ms 0ms 14 280 4ms 0ms 15 280 4ms 0ms 16 280 4ms 0ms 17 280 4ms 0ms 18 280 4ms 0ms 19 280 4ms 0ms 20 280 4ms 0ms 21 280 4ms 0ms 22 280 4ms 0ms 23 280 4ms 0ms Dec 04 06 280 4ms 0ms 07 280 4ms 0ms 08 280 4ms 0ms 09 280 4ms 0ms 10 280 4ms 0ms 11 280 4ms 0ms 12 280 4ms 0ms 13 280 4ms 0ms 14 280 5ms 0ms 15 280 5ms 0ms 16 280 4ms 0ms 17 280 5ms 0ms 18 280 4ms 0ms 19 280 4ms 0ms 20 280 4ms 0ms 21 280 4ms 0ms 22 280 5ms 0ms 23 280 4ms 0ms Dec 05 06 280 7ms 0ms 07 280 4ms 0ms 08 280 4ms 0ms 09 280 4ms 0ms 10 280 4ms 0ms 11 280 4ms 0ms 12 280 4ms 0ms 13 280 3ms 0ms 14 280 4ms 0ms 15 280 4ms 0ms 16 280 4ms 0ms 17 280 3ms 0ms 18 280 3ms 0ms 19 280 4ms 0ms 20 280 4ms 0ms 21 280 4ms 0ms 22 280 4ms 0ms 23 280 4ms 0ms Dec 06 06 280 4ms 0ms 07 280 4ms 0ms 08 280 4ms 0ms 09 280 4ms 0ms 10 280 4ms 0ms 11 280 4ms 0ms 12 280 4ms 0ms 13 280 4ms 0ms 14 280 4ms 0ms 15 280 4ms 0ms 16 280 4ms 0ms 17 280 4ms 0ms 18 280 3ms 0ms 19 280 4ms 0ms 20 280 4ms 0ms 21 280 4ms 0ms 22 280 4ms 0ms 23 280 4ms 0ms [ User: tng_migration_user - Total duration: 547ms - Times executed: 35280 ]
[ Application: [unknown] - Total duration: 547ms - Times executed: 35280 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ('116') AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ('AWAITING', 'MISSED', 'DONE', 'CANCELED') AND (m0_.result_date BETWEEN '2025-08-21 06:05:01' AND '2025-09-07 06:05:01');
Date: 2025-12-05 06:05:02 Duration: 2ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ('102') AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ('AWAITING', 'MISSED', 'DONE', 'CANCELED') AND (m0_.result_date BETWEEN '2025-02-22 17:32:02' AND '2025-02-26 17:32:02');
Date: 2025-12-02 17:32:02 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ('100') AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ('AWAITING', 'MISSED', 'DONE', 'CANCELED') AND (m0_.result_date BETWEEN '2025-06-17 07:05:01' AND '2025-06-21 07:05:01');
Date: 2025-12-05 07:05:01 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
20 33,050 11s459ms 0ms 1ms 0ms select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.subject_subcohort_id as subject_subcohort_id_11, m0_.form_structure_variant_id as form_structure_variant_id_12, m0_.form_id as form_id_13, m0_.form_state_code as form_state_code_14 from core.mv_subject_form m0_ where m0_.form_structure_variant_id in (...) and m0_.form_id is null;Times Reported Time consuming queries #20
Day Hour Count Duration Avg duration Nov 30 05 250 87ms 0ms 06 250 86ms 0ms 07 250 83ms 0ms 08 250 84ms 0ms 09 250 86ms 0ms 10 250 86ms 0ms 11 250 88ms 0ms 12 250 86ms 0ms 13 250 86ms 0ms 14 250 83ms 0ms 15 250 85ms 0ms 16 250 86ms 0ms 17 225 76ms 0ms 18 250 84ms 0ms 19 250 81ms 0ms 20 250 85ms 0ms 21 250 83ms 0ms 22 250 85ms 0ms 23 250 85ms 0ms Dec 01 05 225 77ms 0ms 06 250 86ms 0ms 07 250 94ms 0ms 08 250 90ms 0ms 09 250 84ms 0ms 10 250 87ms 0ms 11 250 88ms 0ms 12 250 83ms 0ms 13 250 84ms 0ms 14 250 87ms 0ms 15 250 85ms 0ms 16 250 87ms 0ms 17 225 78ms 0ms 18 250 84ms 0ms 19 250 89ms 0ms 20 250 85ms 0ms 21 250 85ms 0ms 22 250 88ms 0ms 23 250 86ms 0ms Dec 02 05 225 74ms 0ms 06 250 84ms 0ms 07 250 86ms 0ms 08 250 88ms 0ms 09 250 89ms 0ms 10 250 92ms 0ms 11 250 87ms 0ms 12 250 87ms 0ms 13 250 88ms 0ms 14 250 85ms 0ms 15 250 84ms 0ms 16 250 91ms 0ms 17 250 87ms 0ms 18 250 84ms 0ms 19 250 85ms 0ms 20 250 85ms 0ms 21 250 85ms 0ms 22 250 89ms 0ms 23 250 89ms 0ms Dec 03 05 250 84ms 0ms 06 250 89ms 0ms 07 250 86ms 0ms 08 250 90ms 0ms 09 250 82ms 0ms 10 250 88ms 0ms 11 250 86ms 0ms 12 250 88ms 0ms 13 250 84ms 0ms 14 250 82ms 0ms 15 250 86ms 0ms 16 250 90ms 0ms 17 225 76ms 0ms 18 250 88ms 0ms 19 250 82ms 0ms 20 250 84ms 0ms 21 250 84ms 0ms 22 250 84ms 0ms 23 250 86ms 0ms Dec 04 05 250 84ms 0ms 06 250 91ms 0ms 07 250 84ms 0ms 08 250 86ms 0ms 09 250 89ms 0ms 10 250 86ms 0ms 11 250 87ms 0ms 12 250 91ms 0ms 13 250 90ms 0ms 14 250 88ms 0ms 15 250 88ms 0ms 16 250 89ms 0ms 17 250 86ms 0ms 18 250 85ms 0ms 19 250 85ms 0ms 20 250 86ms 0ms 21 250 86ms 0ms 22 250 86ms 0ms 23 250 91ms 0ms Dec 05 05 225 78ms 0ms 06 250 88ms 0ms 07 250 85ms 0ms 08 250 87ms 0ms 09 250 86ms 0ms 10 250 88ms 0ms 11 250 87ms 0ms 12 250 84ms 0ms 13 250 83ms 0ms 14 250 85ms 0ms 15 250 85ms 0ms 16 250 86ms 0ms 17 225 77ms 0ms 18 250 86ms 0ms 19 250 88ms 0ms 20 250 85ms 0ms 21 250 87ms 0ms 22 250 85ms 0ms 23 250 88ms 0ms Dec 06 05 250 84ms 0ms 06 250 85ms 0ms 07 250 85ms 0ms 08 250 85ms 0ms 09 250 86ms 0ms 10 250 87ms 0ms 11 250 85ms 0ms 12 250 85ms 0ms 13 250 87ms 0ms 14 250 86ms 0ms 15 250 87ms 0ms 16 250 85ms 0ms 17 225 76ms 0ms 18 250 88ms 0ms 19 250 87ms 0ms 20 250 84ms 0ms 21 250 88ms 0ms 22 250 89ms 0ms 23 250 86ms 0ms [ User: tng_migration_user - Total duration: 11s459ms - Times executed: 33050 ]
[ Application: [unknown] - Total duration: 11s459ms - Times executed: 33050 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('127') AND m0_.form_id IS NULL;
Date: 2025-12-03 17:30:04 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('30') AND m0_.form_id IS NULL;
Date: 2025-12-06 23:36:03 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('87') AND m0_.form_id IS NULL;
Date: 2025-12-03 08:42:03 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
Normalized slowest queries (N)
Rank Min duration Max duration Avg duration Times executed Total duration Query 1 6m3s 9m35s 8m7s 13 1h45m31s create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #1
Day Hour Count Duration Avg duration Nov 30 05 1 6m6s 6m6s 17 1 9m19s 9m19s Dec 01 05 1 9m35s 9m35s 17 1 9m20s 9m20s Dec 02 05 1 9m19s 9m19s 17 1 6m6s 6m6s Dec 03 17 1 9m12s 9m12s Dec 04 05 1 6m3s 6m3s 17 1 6m9s 6m9s Dec 05 05 1 9m19s 9m19s 17 1 9m21s 9m21s Dec 06 05 1 6m12s 6m12s 17 1 9m24s 9m24s [ User: tng_migration_user - Total duration: 1h45m31s - Times executed: 13 ]
[ Application: dbt - Total duration: 1h45m31s - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-12-01 05:11:55 Duration: 9m35s Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-12-06 17:11:48 Duration: 9m24s Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );
Date: 2025-12-05 17:11:46 Duration: 9m21s Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
2 1m12s 1m12s 1m12s 1 1m12s copy core.notif (id, subject_id, notif_template_id, notif_state_code, subject, content, other_side_id, created_at, is_archived, processed_time, owner_user_id, owner_group_id, notif_type_code, is_attachments, external_id, updated_at, addressee) to stdout;Times Reported Time consuming queries #2
Day Hour Count Duration Avg duration Dec 03 18 1 1m12s 1m12s [ User: bilik - Total duration: 1m12s - Times executed: 1 ]
[ Application: pg_dump - Total duration: 1m12s - Times executed: 1 ]
-
COPY core.notif (id, subject_id, notif_template_id, notif_state_code, subject, content, other_side_id, created_at, is_archived, processed_time, owner_user_id, owner_group_id, notif_type_code, is_attachments, external_id, updated_at, addressee) TO stdout;
Date: 2025-12-03 18:53:30 Duration: 1m12s Database: celspac User: bilik Remote: [local] Application: pg_dump Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
3 1s598ms 39s78ms 30s161ms 13 6m32s create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #3
Day Hour Count Duration Avg duration Nov 30 05 1 25s998ms 25s998ms 17 1 34s291ms 34s291ms Dec 01 05 1 39s78ms 39s78ms 17 1 34s774ms 34s774ms Dec 02 05 1 37s33ms 37s33ms 17 1 24s124ms 24s124ms Dec 03 17 1 37s617ms 37s617ms Dec 04 05 1 24s172ms 24s172ms 17 1 1s598ms 1s598ms Dec 05 05 1 34s962ms 34s962ms 17 1 36s649ms 36s649ms Dec 06 05 1 26s491ms 26s491ms 17 1 35s305ms 35s305ms [ User: tng_migration_user - Total duration: 6m32s - Times executed: 13 ]
[ Application: dbt - Total duration: 6m32s - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__23"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( -- suject (proband) patrici do kohorty ..., Pilot ID: 23 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 23 -- Pilot ID );
Date: 2025-12-01 05:02:59 Duration: 39s78ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__23"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( -- suject (proband) patrici do kohorty ..., Pilot ID: 23 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 23 -- Pilot ID );
Date: 2025-12-03 17:02:58 Duration: 37s617ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__23"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( -- suject (proband) patrici do kohorty ..., Pilot ID: 23 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 23 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01') $$ ) AS paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 23 -- Pilot ID );
Date: 2025-12-02 05:02:56 Duration: 37s33ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
4 4s243ms 5s836ms 5s10ms 13 1m5s create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?) $$ ) as biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #4
Day Hour Count Duration Avg duration Nov 30 05 1 4s774ms 4s774ms 17 1 5s369ms 5s369ms Dec 01 05 1 5s236ms 5s236ms 17 1 5s207ms 5s207ms Dec 02 05 1 5s292ms 5s292ms 17 1 4s642ms 4s642ms Dec 03 17 1 5s258ms 5s258ms Dec 04 05 1 4s243ms 4s243ms 17 1 4s439ms 4s439ms Dec 05 05 1 4s885ms 4s885ms 17 1 5s246ms 5s246ms Dec 06 05 1 4s703ms 4s703ms 17 1 5s836ms 5s836ms [ User: tng_migration_user - Total duration: 1m5s - Times executed: 13 ]
[ Application: dbt - Total duration: 1m5s - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__27"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... HAPIEE Pilot II, Pilot ID: 27 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_dl_hapiee'), ('hapiee_p02_ic_dl_statistics'), ('hapiee_p02_ic_examination'), ('hapiee_p02_ic_health_qs'), ('hapiee_p02_ic_samples_storage') $$ ) AS extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 27 -- Pilot ID );
Date: 2025-12-06 17:02:33 Duration: 5s836ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__27"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... HAPIEE Pilot II, Pilot ID: 27 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_dl_hapiee'), ('hapiee_p02_ic_dl_statistics'), ('hapiee_p02_ic_examination'), ('hapiee_p02_ic_health_qs'), ('hapiee_p02_ic_samples_storage') $$ ) AS extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 27 -- Pilot ID );
Date: 2025-11-30 17:02:33 Duration: 5s369ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__27"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... HAPIEE Pilot II, Pilot ID: 27 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_dl_hapiee'), ('hapiee_p02_ic_dl_statistics'), ('hapiee_p02_ic_examination'), ('hapiee_p02_ic_health_qs'), ('hapiee_p02_ic_samples_storage') $$ ) AS extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 27 -- Pilot ID );
Date: 2025-12-02 05:02:34 Duration: 5s292ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
5 4s134ms 5s930ms 4s761ms 13 1m1s create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__26__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "tng_p13__role" text, "tng_p13_monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "tng_p13__state" text, "tng_p13_monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as activity ("subject_id" int, "tng_p13__activity_state" text, "tng_p13_monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as created_at ("subject_id" int, "tng_p13__created_at" text, "tng_p13_monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as accepted_at ("subject_id" int, "tng_p13__accepted_at" text, "tng_p13_monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as cancelled_at ("subject_id" int, "tng_p13__cancelled_at" text, "tng_p13_monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as revoked_at ("subject_id" int, "tng_p13__revoked_at" text, "tng_p13_monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as paused_at ("subject_id" int, "tng_p13__paused_at" text, "tng_p13_monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "tng_p13_ic_buccal_swab_child" text, "tng_p13_ic_buccal_swab_mother" text, "tng_p13_ic_cord_blood_child" text, "tng_p13_ic_drop_blood_child" text, "tng_p13_ic_stool_child" text, "tng_p13_ic_urine_mother" text, "tng_p13_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as extra_state ("subject_id" int, "tng_p13_ic_celspac_newsletter" text, "tng_p13_ic_dl_celpac_studies" text, "tng_p13_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.tng_p13__role, psc_role.tng_p13_monitor__role, psc_state.tng_p13__state, psc_state.tng_p13_monitor__state, psc_activity_state.tng_p13__activity_state, psc_activity_state.tng_p13_monitor__activity_state, psc_created_at.tng_p13__created_at, psc_created_at.tng_p13_monitor__created_at, psc_accepted_at.tng_p13__accepted_at, psc_accepted_at.tng_p13_monitor__accepted_at, psc_cancelled_at.tng_p13__cancelled_at, psc_cancelled_at.tng_p13_monitor__cancelled_at, psc_revoked_at.tng_p13__revoked_at, psc_revoked_at.tng_p13_monitor__revoked_at, psc_paused_at.tng_p13__paused_at, psc_paused_at.tng_p13_monitor__paused_at, tng_p13_ic_buccal_swab_child, tng_p13_ic_buccal_swab_mother, tng_p13_ic_cord_blood_child, tng_p13_ic_drop_blood_child, tng_p13_ic_stool_child, tng_p13_ic_urine_mother, tng_p13_ic_venous_blood_mother, tng_p13_ic_celspac_newsletter, tng_p13_ic_dl_celpac_studies, tng_p13_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #5
Day Hour Count Duration Avg duration Nov 30 05 1 4s190ms 4s190ms 17 1 4s901ms 4s901ms Dec 01 05 1 4s777ms 4s777ms 17 1 5s194ms 5s194ms Dec 02 05 1 4s948ms 4s948ms 17 1 4s134ms 4s134ms Dec 03 17 1 4s821ms 4s821ms Dec 04 05 1 4s236ms 4s236ms 17 1 4s396ms 4s396ms Dec 05 05 1 4s779ms 4s779ms 17 1 5s437ms 5s437ms Dec 06 05 1 4s154ms 4s154ms 17 1 5s930ms 5s930ms [ User: tng_migration_user - Total duration: 1m1s - Times executed: 13 ]
[ Application: dbt - Total duration: 1m1s - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__26"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__26__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... TNG Pilot XIII, Pilot ID: 26 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__role" text, "tng_p13_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__state" text, "tng_p13_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS activity ("subject_id" int, "tng_p13__activity_state" text, "tng_p13_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS created_at ("subject_id" int, "tng_p13__created_at" text, "tng_p13_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p13__accepted_at" text, "tng_p13_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p13__cancelled_at" text, "tng_p13_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p13__revoked_at" text, "tng_p13_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p13__paused_at" text, "tng_p13_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_buccal_swab_child'), ('tng_p13_ic_buccal_swab_mother'), ('tng_p13_ic_cord_blood_child'), ('tng_p13_ic_drop_blood_child'), ('tng_p13_ic_stool_child'), ('tng_p13_ic_urine_mother'), ('tng_p13_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p13_ic_buccal_swab_child" text, "tng_p13_ic_buccal_swab_mother" text, "tng_p13_ic_cord_blood_child" text, "tng_p13_ic_drop_blood_child" text, "tng_p13_ic_stool_child" text, "tng_p13_ic_urine_mother" text, "tng_p13_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_celspac_newsletter'), ('tng_p13_ic_dl_celpac_studies'), ('tng_p13_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p13_ic_celspac_newsletter" text, "tng_p13_ic_dl_celpac_studies" text, "tng_p13_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p13__role, psc_role.tng_p13_monitor__role, psc_state.tng_p13__state, psc_state.tng_p13_monitor__state, psc_activity_state.tng_p13__activity_state, psc_activity_state.tng_p13_monitor__activity_state, psc_created_at.tng_p13__created_at, psc_created_at.tng_p13_monitor__created_at, psc_accepted_at.tng_p13__accepted_at, psc_accepted_at.tng_p13_monitor__accepted_at, psc_cancelled_at.tng_p13__cancelled_at, psc_cancelled_at.tng_p13_monitor__cancelled_at, psc_revoked_at.tng_p13__revoked_at, psc_revoked_at.tng_p13_monitor__revoked_at, psc_paused_at.tng_p13__paused_at, psc_paused_at.tng_p13_monitor__paused_at, tng_p13_ic_buccal_swab_child, tng_p13_ic_buccal_swab_mother, tng_p13_ic_cord_blood_child, tng_p13_ic_drop_blood_child, tng_p13_ic_stool_child, tng_p13_ic_urine_mother, tng_p13_ic_venous_blood_mother, tng_p13_ic_celspac_newsletter, tng_p13_ic_dl_celpac_studies, tng_p13_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 26 -- Pilot ID );
Date: 2025-12-06 17:02:33 Duration: 5s930ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__26"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__26__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... TNG Pilot XIII, Pilot ID: 26 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__role" text, "tng_p13_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__state" text, "tng_p13_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS activity ("subject_id" int, "tng_p13__activity_state" text, "tng_p13_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS created_at ("subject_id" int, "tng_p13__created_at" text, "tng_p13_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p13__accepted_at" text, "tng_p13_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p13__cancelled_at" text, "tng_p13_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p13__revoked_at" text, "tng_p13_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p13__paused_at" text, "tng_p13_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_buccal_swab_child'), ('tng_p13_ic_buccal_swab_mother'), ('tng_p13_ic_cord_blood_child'), ('tng_p13_ic_drop_blood_child'), ('tng_p13_ic_stool_child'), ('tng_p13_ic_urine_mother'), ('tng_p13_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p13_ic_buccal_swab_child" text, "tng_p13_ic_buccal_swab_mother" text, "tng_p13_ic_cord_blood_child" text, "tng_p13_ic_drop_blood_child" text, "tng_p13_ic_stool_child" text, "tng_p13_ic_urine_mother" text, "tng_p13_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_celspac_newsletter'), ('tng_p13_ic_dl_celpac_studies'), ('tng_p13_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p13_ic_celspac_newsletter" text, "tng_p13_ic_dl_celpac_studies" text, "tng_p13_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p13__role, psc_role.tng_p13_monitor__role, psc_state.tng_p13__state, psc_state.tng_p13_monitor__state, psc_activity_state.tng_p13__activity_state, psc_activity_state.tng_p13_monitor__activity_state, psc_created_at.tng_p13__created_at, psc_created_at.tng_p13_monitor__created_at, psc_accepted_at.tng_p13__accepted_at, psc_accepted_at.tng_p13_monitor__accepted_at, psc_cancelled_at.tng_p13__cancelled_at, psc_cancelled_at.tng_p13_monitor__cancelled_at, psc_revoked_at.tng_p13__revoked_at, psc_revoked_at.tng_p13_monitor__revoked_at, psc_paused_at.tng_p13__paused_at, psc_paused_at.tng_p13_monitor__paused_at, tng_p13_ic_buccal_swab_child, tng_p13_ic_buccal_swab_mother, tng_p13_ic_cord_blood_child, tng_p13_ic_drop_blood_child, tng_p13_ic_stool_child, tng_p13_ic_urine_mother, tng_p13_ic_venous_blood_mother, tng_p13_ic_celspac_newsletter, tng_p13_ic_dl_celpac_studies, tng_p13_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 26 -- Pilot ID );
Date: 2025-12-05 17:02:34 Duration: 5s437ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__26"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__26__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... TNG Pilot XIII, Pilot ID: 26 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__role" text, "tng_p13_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS role ("subject_id" int, "tng_p13__state" text, "tng_p13_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS activity ("subject_id" int, "tng_p13__activity_state" text, "tng_p13_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS created_at ("subject_id" int, "tng_p13__created_at" text, "tng_p13_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p13__accepted_at" text, "tng_p13_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p13__cancelled_at" text, "tng_p13_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p13__revoked_at" text, "tng_p13_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13'), ('tng_p13_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p13__paused_at" text, "tng_p13_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_buccal_swab_child'), ('tng_p13_ic_buccal_swab_mother'), ('tng_p13_ic_cord_blood_child'), ('tng_p13_ic_drop_blood_child'), ('tng_p13_ic_stool_child'), ('tng_p13_ic_urine_mother'), ('tng_p13_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p13_ic_buccal_swab_child" text, "tng_p13_ic_buccal_swab_mother" text, "tng_p13_ic_cord_blood_child" text, "tng_p13_ic_drop_blood_child" text, "tng_p13_ic_stool_child" text, "tng_p13_ic_urine_mother" text, "tng_p13_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 26 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p13_ic_celspac_newsletter'), ('tng_p13_ic_dl_celpac_studies'), ('tng_p13_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p13_ic_celspac_newsletter" text, "tng_p13_ic_dl_celpac_studies" text, "tng_p13_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p13__role, psc_role.tng_p13_monitor__role, psc_state.tng_p13__state, psc_state.tng_p13_monitor__state, psc_activity_state.tng_p13__activity_state, psc_activity_state.tng_p13_monitor__activity_state, psc_created_at.tng_p13__created_at, psc_created_at.tng_p13_monitor__created_at, psc_accepted_at.tng_p13__accepted_at, psc_accepted_at.tng_p13_monitor__accepted_at, psc_cancelled_at.tng_p13__cancelled_at, psc_cancelled_at.tng_p13_monitor__cancelled_at, psc_revoked_at.tng_p13__revoked_at, psc_revoked_at.tng_p13_monitor__revoked_at, psc_paused_at.tng_p13__paused_at, psc_paused_at.tng_p13_monitor__paused_at, tng_p13_ic_buccal_swab_child, tng_p13_ic_buccal_swab_mother, tng_p13_ic_cord_blood_child, tng_p13_ic_drop_blood_child, tng_p13_ic_stool_child, tng_p13_ic_urine_mother, tng_p13_ic_venous_blood_mother, tng_p13_ic_celspac_newsletter, tng_p13_ic_dl_celpac_studies, tng_p13_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 26 -- Pilot ID );
Date: 2025-12-01 17:02:34 Duration: 5s194ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
6 1s794ms 3s360ms 2s758ms 13 35s859ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #6
Day Hour Count Duration Avg duration Nov 30 05 1 2s301ms 2s301ms 17 1 3s259ms 3s259ms Dec 01 05 1 3s116ms 3s116ms 17 1 3s155ms 3s155ms Dec 02 05 1 3s180ms 3s180ms 17 1 1s970ms 1s970ms Dec 03 17 1 3s360ms 3s360ms Dec 04 05 1 1s794ms 1s794ms 17 1 2s553ms 2s553ms Dec 05 05 1 2s946ms 2s946ms 17 1 2s979ms 2s979ms Dec 06 05 1 2s104ms 2s104ms 17 1 3s136ms 3s136ms [ User: tng_migration_user - Total duration: 35s859ms - Times executed: 13 ]
[ Application: dbt - Total duration: 35s859ms - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__17"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot X, Pilot ID: 17 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dust_mother'), ('tng_p10_ic_buccal_swab_child'), ('tng_p10_ic_buccal_swab_mother'), ('tng_p10_ic_cord_blood_mother'), ('tng_p10_ic_drop_blood_child'), ('tng_p10_ic_stool_child'), ('tng_p10_ic_urine_mother'), ('tng_p10_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dl_celpac_studies'), ('dust_p01_tng_p10_ic_survey'), ('tng_p10_ic_follow_up_studies'), ('tng_p10_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 17 -- Pilot ID );
Date: 2025-12-03 17:02:27 Duration: 3s360ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__17"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot X, Pilot ID: 17 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dust_mother'), ('tng_p10_ic_buccal_swab_child'), ('tng_p10_ic_buccal_swab_mother'), ('tng_p10_ic_cord_blood_mother'), ('tng_p10_ic_drop_blood_child'), ('tng_p10_ic_stool_child'), ('tng_p10_ic_urine_mother'), ('tng_p10_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dl_celpac_studies'), ('dust_p01_tng_p10_ic_survey'), ('tng_p10_ic_follow_up_studies'), ('tng_p10_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 17 -- Pilot ID );
Date: 2025-11-30 17:02:24 Duration: 3s259ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__17"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot X, Pilot ID: 17 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dust_mother'), ('tng_p10_ic_buccal_swab_child'), ('tng_p10_ic_buccal_swab_mother'), ('tng_p10_ic_cord_blood_mother'), ('tng_p10_ic_drop_blood_child'), ('tng_p10_ic_stool_child'), ('tng_p10_ic_urine_mother'), ('tng_p10_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dl_celpac_studies'), ('dust_p01_tng_p10_ic_survey'), ('tng_p10_ic_follow_up_studies'), ('tng_p10_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 17 -- Pilot ID );
Date: 2025-12-02 05:02:25 Duration: 3s180ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
7 893ms 12s17ms 2s416ms 13 31s410ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__21__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p03__role" text, "psycap_p02_new_ya_p03__role" text, "psycap_p02_old_ya_p03__role" text, "ya_p03__role" text, "ya_p03_digi_ya03v2__role" text, "ya_p03_digi_ya04v2__role" text, "ya_p03_digi_ya05v2__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p03__state" text, "psycap_p02_new_ya_p03__state" text, "psycap_p02_old_ya_p03__state" text, "ya_p03__state" text, "ya_p03_digi_ya03v2__state" text, "ya_p03_digi_ya04v2__state" text, "ya_p03_digi_ya05v2__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "psycap_p01_ya_p03__activity_state" text, "psycap_p02_new_ya_p03__activity_state" text, "psycap_p02_old_ya_p03__activity_state" text, "ya_p03__activity_state" text, "ya_p03_digi_ya03v2__activity_state" text, "ya_p03_digi_ya04v2__activity_state" text, "ya_p03_digi_ya05v2__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "psycap_p01_ya_p03__created_at" text, "psycap_p02_new_ya_p03__created_at" text, "psycap_p02_old_ya_p03__created_at" text, "ya_p03__created_at" text, "ya_p03_digi_ya03v2__created_at" text, "ya_p03_digi_ya04v2__created_at" text, "ya_p03_digi_ya05v2__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "psycap_p01_ya_p03__accepted_at" text, "psycap_p02_new_ya_p03__accepted_at" text, "psycap_p02_old_ya_p03__accepted_at" text, "ya_p03__accepted_at" text, "ya_p03_digi_ya03v2__accepted_at" text, "ya_p03_digi_ya04v2__accepted_at" text, "ya_p03_digi_ya05v2__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "psycap_p01_ya_p03__cancelled_at" text, "psycap_p02_new_ya_p03__cancelled_at" text, "psycap_p02_old_ya_p03__cancelled_at" text, "ya_p03__cancelled_at" text, "ya_p03_digi_ya03v2__cancelled_at" text, "ya_p03_digi_ya04v2__cancelled_at" text, "ya_p03_digi_ya05v2__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "psycap_p01_ya_p03__revoked_at" text, "psycap_p02_new_ya_p03__revoked_at" text, "psycap_p02_old_ya_p03__revoked_at" text, "ya_p03__revoked_at" text, "ya_p03_digi_ya03v2__revoked_at" text, "ya_p03_digi_ya04v2__revoked_at" text, "ya_p03_digi_ya05v2__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "psycap_p01_ya_p03__paused_at" text, "psycap_p02_new_ya_p03__paused_at" text, "psycap_p02_old_ya_p03__paused_at" text, "ya_p03__paused_at" text, "ya_p03_digi_ya03v2__paused_at" text, "ya_p03_digi_ya04v2__paused_at" text, "ya_p03_digi_ya05v2__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "ya_p03_ic_buccal_swab_proband" text, "ya_p03_ic_urine_proband" text, "ya_p03_ic_venous_blood_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "ya_p03_ic_anam_qs" text, "ya_p03_ic_aneurysm" text, "ya_p03_ic_anthropometry" text, "ya_p03_ic_arch_foot" text, "ya_p03_ic_basic_qs" text, "ya_p03_ic_blood_pressure" text, "ya_p03_ic_braces_piercing_iud" text, "ya_p03_ic_cognition_test" text, "ya_p03_ic_da_health_registry" text, "ya_p03_ic_dexa" text, "ya_p03_ic_enviro_qs" text, "ya_p03_ic_follow_up_studies" text, "ya_p03_ic_fracture_lower_body_last_3m" text, "ya_p03_ic_fracture_upper_body_last_3m" text, "ya_p03_ic_hand_grip" text, "ya_p03_ic_hearing_vision_impairment" text, "ya_p03_ic_heart_disease" text, "ya_p03_ic_hemoptysis_ns" text, "ya_p03_ic_hernia" text, "ya_p03_ic_hyperthyroidism" text, "ya_p03_ic_inability_hold_pencil" text, "ya_p03_ic_inability_stand_both_legs" text, "ya_p03_ic_inability_talk_cze" text, "ya_p03_ic_inability_walk" text, "ya_p03_ic_inbody" text, "ya_p03_ic_infectious_resp_diseases" text, "ya_p03_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p03_ic_knee_stability" text, "ya_p03_ic_nutri_qs" text, "ya_p03_ic_over_weight_200_height_195" text, "ya_p03_ic_pacemaker_defibrillator" text, "ya_p03_ic_pneumothorax" text, "ya_p03_ic_pregnancy" text, "ya_p03_ic_recent_eye_abdominal_chest_surgery" text, "ya_p03_ic_recent_myocardial_infarction" text, "ya_p03_ic_spirometry" text, "ya_p03_ic_surgical_metal_body" text, "ya_p03_ic_unstable_angina_pectoris" text, "ya_p03_ic_ya_dl_elspac" text, "ya_p03_ic_ya_med_find" text, "ya_p03_ic_ya_newsletter" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.psycap_p01_ya_p03__role, psc_role.psycap_p02_new_ya_p03__role, psc_role.psycap_p02_old_ya_p03__role, psc_role.ya_p03__role, psc_role.ya_p03_digi_ya03v2__role, psc_role.ya_p03_digi_ya04v2__role, psc_role.ya_p03_digi_ya05v2__role, psc_state.psycap_p01_ya_p03__state, psc_state.psycap_p02_new_ya_p03__state, psc_state.psycap_p02_old_ya_p03__state, psc_state.ya_p03__state, psc_state.ya_p03_digi_ya03v2__state, psc_state.ya_p03_digi_ya04v2__state, psc_state.ya_p03_digi_ya05v2__state, psc_activity_state.psycap_p01_ya_p03__activity_state, psc_activity_state.psycap_p02_new_ya_p03__activity_state, psc_activity_state.psycap_p02_old_ya_p03__activity_state, psc_activity_state.ya_p03__activity_state, psc_activity_state.ya_p03_digi_ya03v2__activity_state, psc_activity_state.ya_p03_digi_ya04v2__activity_state, psc_activity_state.ya_p03_digi_ya05v2__activity_state, psc_created_at.psycap_p01_ya_p03__created_at, psc_created_at.psycap_p02_new_ya_p03__created_at, psc_created_at.psycap_p02_old_ya_p03__created_at, psc_created_at.ya_p03__created_at, psc_created_at.ya_p03_digi_ya03v2__created_at, psc_created_at.ya_p03_digi_ya04v2__created_at, psc_created_at.ya_p03_digi_ya05v2__created_at, psc_accepted_at.psycap_p01_ya_p03__accepted_at, psc_accepted_at.psycap_p02_new_ya_p03__accepted_at, psc_accepted_at.psycap_p02_old_ya_p03__accepted_at, psc_accepted_at.ya_p03__accepted_at, psc_accepted_at.ya_p03_digi_ya03v2__accepted_at, psc_accepted_at.ya_p03_digi_ya04v2__accepted_at, psc_accepted_at.ya_p03_digi_ya05v2__accepted_at, psc_cancelled_at.psycap_p01_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_new_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p03__cancelled_at, psc_cancelled_at.ya_p03__cancelled_at, psc_cancelled_at.ya_p03_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya05v2__cancelled_at, psc_revoked_at.psycap_p01_ya_p03__revoked_at, psc_revoked_at.psycap_p02_new_ya_p03__revoked_at, psc_revoked_at.psycap_p02_old_ya_p03__revoked_at, psc_revoked_at.ya_p03__revoked_at, psc_revoked_at.ya_p03_digi_ya03v2__revoked_at, psc_revoked_at.ya_p03_digi_ya04v2__revoked_at, psc_revoked_at.ya_p03_digi_ya05v2__revoked_at, psc_paused_at.psycap_p01_ya_p03__paused_at, psc_paused_at.psycap_p02_new_ya_p03__paused_at, psc_paused_at.psycap_p02_old_ya_p03__paused_at, psc_paused_at.ya_p03__paused_at, psc_paused_at.ya_p03_digi_ya03v2__paused_at, psc_paused_at.ya_p03_digi_ya04v2__paused_at, psc_paused_at.ya_p03_digi_ya05v2__paused_at, ya_p03_ic_buccal_swab_proband, ya_p03_ic_urine_proband, ya_p03_ic_venous_blood_proband, ya_p03_ic_anam_qs, ya_p03_ic_aneurysm, ya_p03_ic_anthropometry, ya_p03_ic_arch_foot, ya_p03_ic_basic_qs, ya_p03_ic_blood_pressure, ya_p03_ic_braces_piercing_iud, ya_p03_ic_cognition_test, ya_p03_ic_da_health_registry, ya_p03_ic_dexa, ya_p03_ic_enviro_qs, ya_p03_ic_follow_up_studies, ya_p03_ic_fracture_lower_body_last_3m, ya_p03_ic_fracture_upper_body_last_3m, ya_p03_ic_hand_grip, ya_p03_ic_hearing_vision_impairment, ya_p03_ic_heart_disease, ya_p03_ic_hemoptysis_ns, ya_p03_ic_hernia, ya_p03_ic_hyperthyroidism, ya_p03_ic_inability_hold_pencil, ya_p03_ic_inability_stand_both_legs, ya_p03_ic_inability_talk_cze, ya_p03_ic_inability_walk, ya_p03_ic_inbody, ya_p03_ic_infectious_resp_diseases, ya_p03_ic_iodine_barium_radioisotopes_last_7d, ya_p03_ic_knee_stability, ya_p03_ic_nutri_qs, ya_p03_ic_over_weight_200_height_195, ya_p03_ic_pacemaker_defibrillator, ya_p03_ic_pneumothorax, ya_p03_ic_pregnancy, ya_p03_ic_recent_eye_abdominal_chest_surgery, ya_p03_ic_recent_myocardial_infarction, ya_p03_ic_spirometry, ya_p03_ic_surgical_metal_body, ya_p03_ic_unstable_angina_pectoris, ya_p03_ic_ya_dl_elspac, ya_p03_ic_ya_med_find, ya_p03_ic_ya_newsletter from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #7
Day Hour Count Duration Avg duration Nov 30 05 1 893ms 893ms 17 1 1s756ms 1s756ms Dec 01 05 1 12s17ms 12s17ms 17 1 1s931ms 1s931ms Dec 02 05 1 1s841ms 1s841ms 17 1 1s477ms 1s477ms Dec 03 17 1 2s157ms 2s157ms Dec 04 05 1 1s389ms 1s389ms 17 1 1s361ms 1s361ms Dec 05 05 1 2s30ms 2s30ms 17 1 1s913ms 1s913ms Dec 06 05 1 925ms 925ms 17 1 1s713ms 1s713ms [ User: tng_migration_user - Total duration: 31s410ms - Times executed: 13 ]
[ Application: dbt - Total duration: 31s410ms - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__21__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: Young Adults, Pilot ID: 21 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__role" text, "psycap_p02_new_ya_p03__role" text, "psycap_p02_old_ya_p03__role" text, "ya_p03__role" text, "ya_p03_digi_ya03v2__role" text, "ya_p03_digi_ya04v2__role" text, "ya_p03_digi_ya05v2__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__state" text, "psycap_p02_new_ya_p03__state" text, "psycap_p02_old_ya_p03__state" text, "ya_p03__state" text, "ya_p03_digi_ya03v2__state" text, "ya_p03_digi_ya04v2__state" text, "ya_p03_digi_ya05v2__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p03__activity_state" text, "psycap_p02_new_ya_p03__activity_state" text, "psycap_p02_old_ya_p03__activity_state" text, "ya_p03__activity_state" text, "ya_p03_digi_ya03v2__activity_state" text, "ya_p03_digi_ya04v2__activity_state" text, "ya_p03_digi_ya05v2__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p03__created_at" text, "psycap_p02_new_ya_p03__created_at" text, "psycap_p02_old_ya_p03__created_at" text, "ya_p03__created_at" text, "ya_p03_digi_ya03v2__created_at" text, "ya_p03_digi_ya04v2__created_at" text, "ya_p03_digi_ya05v2__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p03__accepted_at" text, "psycap_p02_new_ya_p03__accepted_at" text, "psycap_p02_old_ya_p03__accepted_at" text, "ya_p03__accepted_at" text, "ya_p03_digi_ya03v2__accepted_at" text, "ya_p03_digi_ya04v2__accepted_at" text, "ya_p03_digi_ya05v2__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p03__cancelled_at" text, "psycap_p02_new_ya_p03__cancelled_at" text, "psycap_p02_old_ya_p03__cancelled_at" text, "ya_p03__cancelled_at" text, "ya_p03_digi_ya03v2__cancelled_at" text, "ya_p03_digi_ya04v2__cancelled_at" text, "ya_p03_digi_ya05v2__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p03__revoked_at" text, "psycap_p02_new_ya_p03__revoked_at" text, "psycap_p02_old_ya_p03__revoked_at" text, "ya_p03__revoked_at" text, "ya_p03_digi_ya03v2__revoked_at" text, "ya_p03_digi_ya04v2__revoked_at" text, "ya_p03_digi_ya05v2__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p03__paused_at" text, "psycap_p02_new_ya_p03__paused_at" text, "psycap_p02_old_ya_p03__paused_at" text, "ya_p03__paused_at" text, "ya_p03_digi_ya03v2__paused_at" text, "ya_p03_digi_ya04v2__paused_at" text, "ya_p03_digi_ya05v2__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_buccal_swab_proband'), ('ya_p03_ic_urine_proband'), ('ya_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p03_ic_buccal_swab_proband" text, "ya_p03_ic_urine_proband" text, "ya_p03_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_anam_qs'), ('ya_p03_ic_aneurysm'), ('ya_p03_ic_anthropometry'), ('ya_p03_ic_arch_foot'), ('ya_p03_ic_basic_qs'), ('ya_p03_ic_blood_pressure'), ('ya_p03_ic_braces_piercing_iud'), ('ya_p03_ic_cognition_test'), ('ya_p03_ic_da_health_registry'), ('ya_p03_ic_dexa'), ('ya_p03_ic_enviro_qs'), ('ya_p03_ic_follow_up_studies'), ('ya_p03_ic_fracture_lower_body_last_3m'), ('ya_p03_ic_fracture_upper_body_last_3m'), ('ya_p03_ic_hand_grip'), ('ya_p03_ic_hearing_vision_impairment'), ('ya_p03_ic_heart_disease'), ('ya_p03_ic_hemoptysis_ns'), ('ya_p03_ic_hernia'), ('ya_p03_ic_hyperthyroidism'), ('ya_p03_ic_inability_hold_pencil'), ('ya_p03_ic_inability_stand_both_legs'), ('ya_p03_ic_inability_talk_cze'), ('ya_p03_ic_inability_walk'), ('ya_p03_ic_inbody'), ('ya_p03_ic_infectious_resp_diseases'), ('ya_p03_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p03_ic_knee_stability'), ('ya_p03_ic_nutri_qs'), ('ya_p03_ic_over_weight_200_height_195'), ('ya_p03_ic_pacemaker_defibrillator'), ('ya_p03_ic_pneumothorax'), ('ya_p03_ic_pregnancy'), ('ya_p03_ic_recent_eye_abdominal_chest_surgery'), ('ya_p03_ic_recent_myocardial_infarction'), ('ya_p03_ic_spirometry'), ('ya_p03_ic_surgical_metal_body'), ('ya_p03_ic_unstable_angina_pectoris'), ('ya_p03_ic_ya_dl_elspac'), ('ya_p03_ic_ya_med_find'), ('ya_p03_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p03_ic_anam_qs" text, "ya_p03_ic_aneurysm" text, "ya_p03_ic_anthropometry" text, "ya_p03_ic_arch_foot" text, "ya_p03_ic_basic_qs" text, "ya_p03_ic_blood_pressure" text, "ya_p03_ic_braces_piercing_iud" text, "ya_p03_ic_cognition_test" text, "ya_p03_ic_da_health_registry" text, "ya_p03_ic_dexa" text, "ya_p03_ic_enviro_qs" text, "ya_p03_ic_follow_up_studies" text, "ya_p03_ic_fracture_lower_body_last_3m" text, "ya_p03_ic_fracture_upper_body_last_3m" text, "ya_p03_ic_hand_grip" text, "ya_p03_ic_hearing_vision_impairment" text, "ya_p03_ic_heart_disease" text, "ya_p03_ic_hemoptysis_ns" text, "ya_p03_ic_hernia" text, "ya_p03_ic_hyperthyroidism" text, "ya_p03_ic_inability_hold_pencil" text, "ya_p03_ic_inability_stand_both_legs" text, "ya_p03_ic_inability_talk_cze" text, "ya_p03_ic_inability_walk" text, "ya_p03_ic_inbody" text, "ya_p03_ic_infectious_resp_diseases" text, "ya_p03_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p03_ic_knee_stability" text, "ya_p03_ic_nutri_qs" text, "ya_p03_ic_over_weight_200_height_195" text, "ya_p03_ic_pacemaker_defibrillator" text, "ya_p03_ic_pneumothorax" text, "ya_p03_ic_pregnancy" text, "ya_p03_ic_recent_eye_abdominal_chest_surgery" text, "ya_p03_ic_recent_myocardial_infarction" text, "ya_p03_ic_spirometry" text, "ya_p03_ic_surgical_metal_body" text, "ya_p03_ic_unstable_angina_pectoris" text, "ya_p03_ic_ya_dl_elspac" text, "ya_p03_ic_ya_med_find" text, "ya_p03_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p03__role, psc_role.psycap_p02_new_ya_p03__role, psc_role.psycap_p02_old_ya_p03__role, psc_role.ya_p03__role, psc_role.ya_p03_digi_ya03v2__role, psc_role.ya_p03_digi_ya04v2__role, psc_role.ya_p03_digi_ya05v2__role, psc_state.psycap_p01_ya_p03__state, psc_state.psycap_p02_new_ya_p03__state, psc_state.psycap_p02_old_ya_p03__state, psc_state.ya_p03__state, psc_state.ya_p03_digi_ya03v2__state, psc_state.ya_p03_digi_ya04v2__state, psc_state.ya_p03_digi_ya05v2__state, psc_activity_state.psycap_p01_ya_p03__activity_state, psc_activity_state.psycap_p02_new_ya_p03__activity_state, psc_activity_state.psycap_p02_old_ya_p03__activity_state, psc_activity_state.ya_p03__activity_state, psc_activity_state.ya_p03_digi_ya03v2__activity_state, psc_activity_state.ya_p03_digi_ya04v2__activity_state, psc_activity_state.ya_p03_digi_ya05v2__activity_state, psc_created_at.psycap_p01_ya_p03__created_at, psc_created_at.psycap_p02_new_ya_p03__created_at, psc_created_at.psycap_p02_old_ya_p03__created_at, psc_created_at.ya_p03__created_at, psc_created_at.ya_p03_digi_ya03v2__created_at, psc_created_at.ya_p03_digi_ya04v2__created_at, psc_created_at.ya_p03_digi_ya05v2__created_at, psc_accepted_at.psycap_p01_ya_p03__accepted_at, psc_accepted_at.psycap_p02_new_ya_p03__accepted_at, psc_accepted_at.psycap_p02_old_ya_p03__accepted_at, psc_accepted_at.ya_p03__accepted_at, psc_accepted_at.ya_p03_digi_ya03v2__accepted_at, psc_accepted_at.ya_p03_digi_ya04v2__accepted_at, psc_accepted_at.ya_p03_digi_ya05v2__accepted_at, psc_cancelled_at.psycap_p01_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_new_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p03__cancelled_at, psc_cancelled_at.ya_p03__cancelled_at, psc_cancelled_at.ya_p03_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya05v2__cancelled_at, psc_revoked_at.psycap_p01_ya_p03__revoked_at, psc_revoked_at.psycap_p02_new_ya_p03__revoked_at, psc_revoked_at.psycap_p02_old_ya_p03__revoked_at, psc_revoked_at.ya_p03__revoked_at, psc_revoked_at.ya_p03_digi_ya03v2__revoked_at, psc_revoked_at.ya_p03_digi_ya04v2__revoked_at, psc_revoked_at.ya_p03_digi_ya05v2__revoked_at, psc_paused_at.psycap_p01_ya_p03__paused_at, psc_paused_at.psycap_p02_new_ya_p03__paused_at, psc_paused_at.psycap_p02_old_ya_p03__paused_at, psc_paused_at.ya_p03__paused_at, psc_paused_at.ya_p03_digi_ya03v2__paused_at, psc_paused_at.ya_p03_digi_ya04v2__paused_at, psc_paused_at.ya_p03_digi_ya05v2__paused_at, ya_p03_ic_buccal_swab_proband, ya_p03_ic_urine_proband, ya_p03_ic_venous_blood_proband, ya_p03_ic_anam_qs, ya_p03_ic_aneurysm, ya_p03_ic_anthropometry, ya_p03_ic_arch_foot, ya_p03_ic_basic_qs, ya_p03_ic_blood_pressure, ya_p03_ic_braces_piercing_iud, ya_p03_ic_cognition_test, ya_p03_ic_da_health_registry, ya_p03_ic_dexa, ya_p03_ic_enviro_qs, ya_p03_ic_follow_up_studies, ya_p03_ic_fracture_lower_body_last_3m, ya_p03_ic_fracture_upper_body_last_3m, ya_p03_ic_hand_grip, ya_p03_ic_hearing_vision_impairment, ya_p03_ic_heart_disease, ya_p03_ic_hemoptysis_ns, ya_p03_ic_hernia, ya_p03_ic_hyperthyroidism, ya_p03_ic_inability_hold_pencil, ya_p03_ic_inability_stand_both_legs, ya_p03_ic_inability_talk_cze, ya_p03_ic_inability_walk, ya_p03_ic_inbody, ya_p03_ic_infectious_resp_diseases, ya_p03_ic_iodine_barium_radioisotopes_last_7d, ya_p03_ic_knee_stability, ya_p03_ic_nutri_qs, ya_p03_ic_over_weight_200_height_195, ya_p03_ic_pacemaker_defibrillator, ya_p03_ic_pneumothorax, ya_p03_ic_pregnancy, ya_p03_ic_recent_eye_abdominal_chest_surgery, ya_p03_ic_recent_myocardial_infarction, ya_p03_ic_spirometry, ya_p03_ic_surgical_metal_body, ya_p03_ic_unstable_angina_pectoris, ya_p03_ic_ya_dl_elspac, ya_p03_ic_ya_med_find, ya_p03_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 21 -- Pilot ID );
Date: 2025-12-01 05:02:38 Duration: 12s17ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__21__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: Young Adults, Pilot ID: 21 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__role" text, "psycap_p02_new_ya_p03__role" text, "psycap_p02_old_ya_p03__role" text, "ya_p03__role" text, "ya_p03_digi_ya03v2__role" text, "ya_p03_digi_ya04v2__role" text, "ya_p03_digi_ya05v2__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__state" text, "psycap_p02_new_ya_p03__state" text, "psycap_p02_old_ya_p03__state" text, "ya_p03__state" text, "ya_p03_digi_ya03v2__state" text, "ya_p03_digi_ya04v2__state" text, "ya_p03_digi_ya05v2__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p03__activity_state" text, "psycap_p02_new_ya_p03__activity_state" text, "psycap_p02_old_ya_p03__activity_state" text, "ya_p03__activity_state" text, "ya_p03_digi_ya03v2__activity_state" text, "ya_p03_digi_ya04v2__activity_state" text, "ya_p03_digi_ya05v2__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p03__created_at" text, "psycap_p02_new_ya_p03__created_at" text, "psycap_p02_old_ya_p03__created_at" text, "ya_p03__created_at" text, "ya_p03_digi_ya03v2__created_at" text, "ya_p03_digi_ya04v2__created_at" text, "ya_p03_digi_ya05v2__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p03__accepted_at" text, "psycap_p02_new_ya_p03__accepted_at" text, "psycap_p02_old_ya_p03__accepted_at" text, "ya_p03__accepted_at" text, "ya_p03_digi_ya03v2__accepted_at" text, "ya_p03_digi_ya04v2__accepted_at" text, "ya_p03_digi_ya05v2__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p03__cancelled_at" text, "psycap_p02_new_ya_p03__cancelled_at" text, "psycap_p02_old_ya_p03__cancelled_at" text, "ya_p03__cancelled_at" text, "ya_p03_digi_ya03v2__cancelled_at" text, "ya_p03_digi_ya04v2__cancelled_at" text, "ya_p03_digi_ya05v2__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p03__revoked_at" text, "psycap_p02_new_ya_p03__revoked_at" text, "psycap_p02_old_ya_p03__revoked_at" text, "ya_p03__revoked_at" text, "ya_p03_digi_ya03v2__revoked_at" text, "ya_p03_digi_ya04v2__revoked_at" text, "ya_p03_digi_ya05v2__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p03__paused_at" text, "psycap_p02_new_ya_p03__paused_at" text, "psycap_p02_old_ya_p03__paused_at" text, "ya_p03__paused_at" text, "ya_p03_digi_ya03v2__paused_at" text, "ya_p03_digi_ya04v2__paused_at" text, "ya_p03_digi_ya05v2__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_buccal_swab_proband'), ('ya_p03_ic_urine_proband'), ('ya_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p03_ic_buccal_swab_proband" text, "ya_p03_ic_urine_proband" text, "ya_p03_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_anam_qs'), ('ya_p03_ic_aneurysm'), ('ya_p03_ic_anthropometry'), ('ya_p03_ic_arch_foot'), ('ya_p03_ic_basic_qs'), ('ya_p03_ic_blood_pressure'), ('ya_p03_ic_braces_piercing_iud'), ('ya_p03_ic_cognition_test'), ('ya_p03_ic_da_health_registry'), ('ya_p03_ic_dexa'), ('ya_p03_ic_enviro_qs'), ('ya_p03_ic_follow_up_studies'), ('ya_p03_ic_fracture_lower_body_last_3m'), ('ya_p03_ic_fracture_upper_body_last_3m'), ('ya_p03_ic_hand_grip'), ('ya_p03_ic_hearing_vision_impairment'), ('ya_p03_ic_heart_disease'), ('ya_p03_ic_hemoptysis_ns'), ('ya_p03_ic_hernia'), ('ya_p03_ic_hyperthyroidism'), ('ya_p03_ic_inability_hold_pencil'), ('ya_p03_ic_inability_stand_both_legs'), ('ya_p03_ic_inability_talk_cze'), ('ya_p03_ic_inability_walk'), ('ya_p03_ic_inbody'), ('ya_p03_ic_infectious_resp_diseases'), ('ya_p03_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p03_ic_knee_stability'), ('ya_p03_ic_nutri_qs'), ('ya_p03_ic_over_weight_200_height_195'), ('ya_p03_ic_pacemaker_defibrillator'), ('ya_p03_ic_pneumothorax'), ('ya_p03_ic_pregnancy'), ('ya_p03_ic_recent_eye_abdominal_chest_surgery'), ('ya_p03_ic_recent_myocardial_infarction'), ('ya_p03_ic_spirometry'), ('ya_p03_ic_surgical_metal_body'), ('ya_p03_ic_unstable_angina_pectoris'), ('ya_p03_ic_ya_dl_elspac'), ('ya_p03_ic_ya_med_find'), ('ya_p03_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p03_ic_anam_qs" text, "ya_p03_ic_aneurysm" text, "ya_p03_ic_anthropometry" text, "ya_p03_ic_arch_foot" text, "ya_p03_ic_basic_qs" text, "ya_p03_ic_blood_pressure" text, "ya_p03_ic_braces_piercing_iud" text, "ya_p03_ic_cognition_test" text, "ya_p03_ic_da_health_registry" text, "ya_p03_ic_dexa" text, "ya_p03_ic_enviro_qs" text, "ya_p03_ic_follow_up_studies" text, "ya_p03_ic_fracture_lower_body_last_3m" text, "ya_p03_ic_fracture_upper_body_last_3m" text, "ya_p03_ic_hand_grip" text, "ya_p03_ic_hearing_vision_impairment" text, "ya_p03_ic_heart_disease" text, "ya_p03_ic_hemoptysis_ns" text, "ya_p03_ic_hernia" text, "ya_p03_ic_hyperthyroidism" text, "ya_p03_ic_inability_hold_pencil" text, "ya_p03_ic_inability_stand_both_legs" text, "ya_p03_ic_inability_talk_cze" text, "ya_p03_ic_inability_walk" text, "ya_p03_ic_inbody" text, "ya_p03_ic_infectious_resp_diseases" text, "ya_p03_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p03_ic_knee_stability" text, "ya_p03_ic_nutri_qs" text, "ya_p03_ic_over_weight_200_height_195" text, "ya_p03_ic_pacemaker_defibrillator" text, "ya_p03_ic_pneumothorax" text, "ya_p03_ic_pregnancy" text, "ya_p03_ic_recent_eye_abdominal_chest_surgery" text, "ya_p03_ic_recent_myocardial_infarction" text, "ya_p03_ic_spirometry" text, "ya_p03_ic_surgical_metal_body" text, "ya_p03_ic_unstable_angina_pectoris" text, "ya_p03_ic_ya_dl_elspac" text, "ya_p03_ic_ya_med_find" text, "ya_p03_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p03__role, psc_role.psycap_p02_new_ya_p03__role, psc_role.psycap_p02_old_ya_p03__role, psc_role.ya_p03__role, psc_role.ya_p03_digi_ya03v2__role, psc_role.ya_p03_digi_ya04v2__role, psc_role.ya_p03_digi_ya05v2__role, psc_state.psycap_p01_ya_p03__state, psc_state.psycap_p02_new_ya_p03__state, psc_state.psycap_p02_old_ya_p03__state, psc_state.ya_p03__state, psc_state.ya_p03_digi_ya03v2__state, psc_state.ya_p03_digi_ya04v2__state, psc_state.ya_p03_digi_ya05v2__state, psc_activity_state.psycap_p01_ya_p03__activity_state, psc_activity_state.psycap_p02_new_ya_p03__activity_state, psc_activity_state.psycap_p02_old_ya_p03__activity_state, psc_activity_state.ya_p03__activity_state, psc_activity_state.ya_p03_digi_ya03v2__activity_state, psc_activity_state.ya_p03_digi_ya04v2__activity_state, psc_activity_state.ya_p03_digi_ya05v2__activity_state, psc_created_at.psycap_p01_ya_p03__created_at, psc_created_at.psycap_p02_new_ya_p03__created_at, psc_created_at.psycap_p02_old_ya_p03__created_at, psc_created_at.ya_p03__created_at, psc_created_at.ya_p03_digi_ya03v2__created_at, psc_created_at.ya_p03_digi_ya04v2__created_at, psc_created_at.ya_p03_digi_ya05v2__created_at, psc_accepted_at.psycap_p01_ya_p03__accepted_at, psc_accepted_at.psycap_p02_new_ya_p03__accepted_at, psc_accepted_at.psycap_p02_old_ya_p03__accepted_at, psc_accepted_at.ya_p03__accepted_at, psc_accepted_at.ya_p03_digi_ya03v2__accepted_at, psc_accepted_at.ya_p03_digi_ya04v2__accepted_at, psc_accepted_at.ya_p03_digi_ya05v2__accepted_at, psc_cancelled_at.psycap_p01_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_new_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p03__cancelled_at, psc_cancelled_at.ya_p03__cancelled_at, psc_cancelled_at.ya_p03_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya05v2__cancelled_at, psc_revoked_at.psycap_p01_ya_p03__revoked_at, psc_revoked_at.psycap_p02_new_ya_p03__revoked_at, psc_revoked_at.psycap_p02_old_ya_p03__revoked_at, psc_revoked_at.ya_p03__revoked_at, psc_revoked_at.ya_p03_digi_ya03v2__revoked_at, psc_revoked_at.ya_p03_digi_ya04v2__revoked_at, psc_revoked_at.ya_p03_digi_ya05v2__revoked_at, psc_paused_at.psycap_p01_ya_p03__paused_at, psc_paused_at.psycap_p02_new_ya_p03__paused_at, psc_paused_at.psycap_p02_old_ya_p03__paused_at, psc_paused_at.ya_p03__paused_at, psc_paused_at.ya_p03_digi_ya03v2__paused_at, psc_paused_at.ya_p03_digi_ya04v2__paused_at, psc_paused_at.ya_p03_digi_ya05v2__paused_at, ya_p03_ic_buccal_swab_proband, ya_p03_ic_urine_proband, ya_p03_ic_venous_blood_proband, ya_p03_ic_anam_qs, ya_p03_ic_aneurysm, ya_p03_ic_anthropometry, ya_p03_ic_arch_foot, ya_p03_ic_basic_qs, ya_p03_ic_blood_pressure, ya_p03_ic_braces_piercing_iud, ya_p03_ic_cognition_test, ya_p03_ic_da_health_registry, ya_p03_ic_dexa, ya_p03_ic_enviro_qs, ya_p03_ic_follow_up_studies, ya_p03_ic_fracture_lower_body_last_3m, ya_p03_ic_fracture_upper_body_last_3m, ya_p03_ic_hand_grip, ya_p03_ic_hearing_vision_impairment, ya_p03_ic_heart_disease, ya_p03_ic_hemoptysis_ns, ya_p03_ic_hernia, ya_p03_ic_hyperthyroidism, ya_p03_ic_inability_hold_pencil, ya_p03_ic_inability_stand_both_legs, ya_p03_ic_inability_talk_cze, ya_p03_ic_inability_walk, ya_p03_ic_inbody, ya_p03_ic_infectious_resp_diseases, ya_p03_ic_iodine_barium_radioisotopes_last_7d, ya_p03_ic_knee_stability, ya_p03_ic_nutri_qs, ya_p03_ic_over_weight_200_height_195, ya_p03_ic_pacemaker_defibrillator, ya_p03_ic_pneumothorax, ya_p03_ic_pregnancy, ya_p03_ic_recent_eye_abdominal_chest_surgery, ya_p03_ic_recent_myocardial_infarction, ya_p03_ic_spirometry, ya_p03_ic_surgical_metal_body, ya_p03_ic_unstable_angina_pectoris, ya_p03_ic_ya_dl_elspac, ya_p03_ic_ya_med_find, ya_p03_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 21 -- Pilot ID );
Date: 2025-12-03 17:02:29 Duration: 2s157ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__21__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: Young Adults, Pilot ID: 21 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__role" text, "psycap_p02_new_ya_p03__role" text, "psycap_p02_old_ya_p03__role" text, "ya_p03__role" text, "ya_p03_digi_ya03v2__role" text, "ya_p03_digi_ya04v2__role" text, "ya_p03_digi_ya05v2__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p03__state" text, "psycap_p02_new_ya_p03__state" text, "psycap_p02_old_ya_p03__state" text, "ya_p03__state" text, "ya_p03_digi_ya03v2__state" text, "ya_p03_digi_ya04v2__state" text, "ya_p03_digi_ya05v2__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p03__activity_state" text, "psycap_p02_new_ya_p03__activity_state" text, "psycap_p02_old_ya_p03__activity_state" text, "ya_p03__activity_state" text, "ya_p03_digi_ya03v2__activity_state" text, "ya_p03_digi_ya04v2__activity_state" text, "ya_p03_digi_ya05v2__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p03__created_at" text, "psycap_p02_new_ya_p03__created_at" text, "psycap_p02_old_ya_p03__created_at" text, "ya_p03__created_at" text, "ya_p03_digi_ya03v2__created_at" text, "ya_p03_digi_ya04v2__created_at" text, "ya_p03_digi_ya05v2__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p03__accepted_at" text, "psycap_p02_new_ya_p03__accepted_at" text, "psycap_p02_old_ya_p03__accepted_at" text, "ya_p03__accepted_at" text, "ya_p03_digi_ya03v2__accepted_at" text, "ya_p03_digi_ya04v2__accepted_at" text, "ya_p03_digi_ya05v2__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p03__cancelled_at" text, "psycap_p02_new_ya_p03__cancelled_at" text, "psycap_p02_old_ya_p03__cancelled_at" text, "ya_p03__cancelled_at" text, "ya_p03_digi_ya03v2__cancelled_at" text, "ya_p03_digi_ya04v2__cancelled_at" text, "ya_p03_digi_ya05v2__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p03__revoked_at" text, "psycap_p02_new_ya_p03__revoked_at" text, "psycap_p02_old_ya_p03__revoked_at" text, "ya_p03__revoked_at" text, "ya_p03_digi_ya03v2__revoked_at" text, "ya_p03_digi_ya04v2__revoked_at" text, "ya_p03_digi_ya05v2__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p03'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_ya_p03'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p03__paused_at" text, "psycap_p02_new_ya_p03__paused_at" text, "psycap_p02_old_ya_p03__paused_at" text, "ya_p03__paused_at" text, "ya_p03_digi_ya03v2__paused_at" text, "ya_p03_digi_ya04v2__paused_at" text, "ya_p03_digi_ya05v2__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_buccal_swab_proband'), ('ya_p03_ic_urine_proband'), ('ya_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p03_ic_buccal_swab_proband" text, "ya_p03_ic_urine_proband" text, "ya_p03_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p03_ic_anam_qs'), ('ya_p03_ic_aneurysm'), ('ya_p03_ic_anthropometry'), ('ya_p03_ic_arch_foot'), ('ya_p03_ic_basic_qs'), ('ya_p03_ic_blood_pressure'), ('ya_p03_ic_braces_piercing_iud'), ('ya_p03_ic_cognition_test'), ('ya_p03_ic_da_health_registry'), ('ya_p03_ic_dexa'), ('ya_p03_ic_enviro_qs'), ('ya_p03_ic_follow_up_studies'), ('ya_p03_ic_fracture_lower_body_last_3m'), ('ya_p03_ic_fracture_upper_body_last_3m'), ('ya_p03_ic_hand_grip'), ('ya_p03_ic_hearing_vision_impairment'), ('ya_p03_ic_heart_disease'), ('ya_p03_ic_hemoptysis_ns'), ('ya_p03_ic_hernia'), ('ya_p03_ic_hyperthyroidism'), ('ya_p03_ic_inability_hold_pencil'), ('ya_p03_ic_inability_stand_both_legs'), ('ya_p03_ic_inability_talk_cze'), ('ya_p03_ic_inability_walk'), ('ya_p03_ic_inbody'), ('ya_p03_ic_infectious_resp_diseases'), ('ya_p03_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p03_ic_knee_stability'), ('ya_p03_ic_nutri_qs'), ('ya_p03_ic_over_weight_200_height_195'), ('ya_p03_ic_pacemaker_defibrillator'), ('ya_p03_ic_pneumothorax'), ('ya_p03_ic_pregnancy'), ('ya_p03_ic_recent_eye_abdominal_chest_surgery'), ('ya_p03_ic_recent_myocardial_infarction'), ('ya_p03_ic_spirometry'), ('ya_p03_ic_surgical_metal_body'), ('ya_p03_ic_unstable_angina_pectoris'), ('ya_p03_ic_ya_dl_elspac'), ('ya_p03_ic_ya_med_find'), ('ya_p03_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p03_ic_anam_qs" text, "ya_p03_ic_aneurysm" text, "ya_p03_ic_anthropometry" text, "ya_p03_ic_arch_foot" text, "ya_p03_ic_basic_qs" text, "ya_p03_ic_blood_pressure" text, "ya_p03_ic_braces_piercing_iud" text, "ya_p03_ic_cognition_test" text, "ya_p03_ic_da_health_registry" text, "ya_p03_ic_dexa" text, "ya_p03_ic_enviro_qs" text, "ya_p03_ic_follow_up_studies" text, "ya_p03_ic_fracture_lower_body_last_3m" text, "ya_p03_ic_fracture_upper_body_last_3m" text, "ya_p03_ic_hand_grip" text, "ya_p03_ic_hearing_vision_impairment" text, "ya_p03_ic_heart_disease" text, "ya_p03_ic_hemoptysis_ns" text, "ya_p03_ic_hernia" text, "ya_p03_ic_hyperthyroidism" text, "ya_p03_ic_inability_hold_pencil" text, "ya_p03_ic_inability_stand_both_legs" text, "ya_p03_ic_inability_talk_cze" text, "ya_p03_ic_inability_walk" text, "ya_p03_ic_inbody" text, "ya_p03_ic_infectious_resp_diseases" text, "ya_p03_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p03_ic_knee_stability" text, "ya_p03_ic_nutri_qs" text, "ya_p03_ic_over_weight_200_height_195" text, "ya_p03_ic_pacemaker_defibrillator" text, "ya_p03_ic_pneumothorax" text, "ya_p03_ic_pregnancy" text, "ya_p03_ic_recent_eye_abdominal_chest_surgery" text, "ya_p03_ic_recent_myocardial_infarction" text, "ya_p03_ic_spirometry" text, "ya_p03_ic_surgical_metal_body" text, "ya_p03_ic_unstable_angina_pectoris" text, "ya_p03_ic_ya_dl_elspac" text, "ya_p03_ic_ya_med_find" text, "ya_p03_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p03__role, psc_role.psycap_p02_new_ya_p03__role, psc_role.psycap_p02_old_ya_p03__role, psc_role.ya_p03__role, psc_role.ya_p03_digi_ya03v2__role, psc_role.ya_p03_digi_ya04v2__role, psc_role.ya_p03_digi_ya05v2__role, psc_state.psycap_p01_ya_p03__state, psc_state.psycap_p02_new_ya_p03__state, psc_state.psycap_p02_old_ya_p03__state, psc_state.ya_p03__state, psc_state.ya_p03_digi_ya03v2__state, psc_state.ya_p03_digi_ya04v2__state, psc_state.ya_p03_digi_ya05v2__state, psc_activity_state.psycap_p01_ya_p03__activity_state, psc_activity_state.psycap_p02_new_ya_p03__activity_state, psc_activity_state.psycap_p02_old_ya_p03__activity_state, psc_activity_state.ya_p03__activity_state, psc_activity_state.ya_p03_digi_ya03v2__activity_state, psc_activity_state.ya_p03_digi_ya04v2__activity_state, psc_activity_state.ya_p03_digi_ya05v2__activity_state, psc_created_at.psycap_p01_ya_p03__created_at, psc_created_at.psycap_p02_new_ya_p03__created_at, psc_created_at.psycap_p02_old_ya_p03__created_at, psc_created_at.ya_p03__created_at, psc_created_at.ya_p03_digi_ya03v2__created_at, psc_created_at.ya_p03_digi_ya04v2__created_at, psc_created_at.ya_p03_digi_ya05v2__created_at, psc_accepted_at.psycap_p01_ya_p03__accepted_at, psc_accepted_at.psycap_p02_new_ya_p03__accepted_at, psc_accepted_at.psycap_p02_old_ya_p03__accepted_at, psc_accepted_at.ya_p03__accepted_at, psc_accepted_at.ya_p03_digi_ya03v2__accepted_at, psc_accepted_at.ya_p03_digi_ya04v2__accepted_at, psc_accepted_at.ya_p03_digi_ya05v2__accepted_at, psc_cancelled_at.psycap_p01_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_new_ya_p03__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p03__cancelled_at, psc_cancelled_at.ya_p03__cancelled_at, psc_cancelled_at.ya_p03_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p03_digi_ya05v2__cancelled_at, psc_revoked_at.psycap_p01_ya_p03__revoked_at, psc_revoked_at.psycap_p02_new_ya_p03__revoked_at, psc_revoked_at.psycap_p02_old_ya_p03__revoked_at, psc_revoked_at.ya_p03__revoked_at, psc_revoked_at.ya_p03_digi_ya03v2__revoked_at, psc_revoked_at.ya_p03_digi_ya04v2__revoked_at, psc_revoked_at.ya_p03_digi_ya05v2__revoked_at, psc_paused_at.psycap_p01_ya_p03__paused_at, psc_paused_at.psycap_p02_new_ya_p03__paused_at, psc_paused_at.psycap_p02_old_ya_p03__paused_at, psc_paused_at.ya_p03__paused_at, psc_paused_at.ya_p03_digi_ya03v2__paused_at, psc_paused_at.ya_p03_digi_ya04v2__paused_at, psc_paused_at.ya_p03_digi_ya05v2__paused_at, ya_p03_ic_buccal_swab_proband, ya_p03_ic_urine_proband, ya_p03_ic_venous_blood_proband, ya_p03_ic_anam_qs, ya_p03_ic_aneurysm, ya_p03_ic_anthropometry, ya_p03_ic_arch_foot, ya_p03_ic_basic_qs, ya_p03_ic_blood_pressure, ya_p03_ic_braces_piercing_iud, ya_p03_ic_cognition_test, ya_p03_ic_da_health_registry, ya_p03_ic_dexa, ya_p03_ic_enviro_qs, ya_p03_ic_follow_up_studies, ya_p03_ic_fracture_lower_body_last_3m, ya_p03_ic_fracture_upper_body_last_3m, ya_p03_ic_hand_grip, ya_p03_ic_hearing_vision_impairment, ya_p03_ic_heart_disease, ya_p03_ic_hemoptysis_ns, ya_p03_ic_hernia, ya_p03_ic_hyperthyroidism, ya_p03_ic_inability_hold_pencil, ya_p03_ic_inability_stand_both_legs, ya_p03_ic_inability_talk_cze, ya_p03_ic_inability_walk, ya_p03_ic_inbody, ya_p03_ic_infectious_resp_diseases, ya_p03_ic_iodine_barium_radioisotopes_last_7d, ya_p03_ic_knee_stability, ya_p03_ic_nutri_qs, ya_p03_ic_over_weight_200_height_195, ya_p03_ic_pacemaker_defibrillator, ya_p03_ic_pneumothorax, ya_p03_ic_pregnancy, ya_p03_ic_recent_eye_abdominal_chest_surgery, ya_p03_ic_recent_myocardial_infarction, ya_p03_ic_spirometry, ya_p03_ic_surgical_metal_body, ya_p03_ic_unstable_angina_pectoris, ya_p03_ic_ya_dl_elspac, ya_p03_ic_ya_med_find, ya_p03_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 21 -- Pilot ID );
Date: 2025-12-05 05:02:27 Duration: 2s30ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
8 1s589ms 2s857ms 2s402ms 13 31s235ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__20__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p11__role" text, "tng_p11__role" text, "tng_p11_monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p11__state" text, "tng_p11__state" text, "tng_p11_monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as activity ("subject_id" int, "dust_p01_tng_p11__activity_state" text, "tng_p11__activity_state" text, "tng_p11_monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as created_at ("subject_id" int, "dust_p01_tng_p11__created_at" text, "tng_p11__created_at" text, "tng_p11_monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "dust_p01_tng_p11__accepted_at" text, "tng_p11__accepted_at" text, "tng_p11_monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "dust_p01_tng_p11__cancelled_at" text, "tng_p11__cancelled_at" text, "tng_p11_monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "dust_p01_tng_p11__revoked_at" text, "tng_p11__revoked_at" text, "tng_p11_monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as paused_at ("subject_id" int, "dust_p01_tng_p11__paused_at" text, "tng_p11__paused_at" text, "tng_p11_monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "dust_p01_tng_p11_ic_dust_mother" text, "tng_p11_ic_buccal_swab_child" text, "tng_p11_ic_buccal_swab_mother" text, "tng_p11_ic_cord_blood_mother" text, "tng_p11_ic_drop_blood_child" text, "tng_p11_ic_stool_child" text, "tng_p11_ic_urine_mother" text, "tng_p11_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "dust_p01_tng_p11_ic_dl_celpac_studies" text, "dust_p01_tng_p11_ic_survey" text, "tng_p11_ic_celspac_newsletter" text, "tng_p11_ic_dl_celpac_studies" text, "tng_p11_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.dust_p01_tng_p11__role, psc_role.tng_p11__role, psc_role.tng_p11_monitor__role, psc_state.dust_p01_tng_p11__state, psc_state.tng_p11__state, psc_state.tng_p11_monitor__state, psc_activity_state.dust_p01_tng_p11__activity_state, psc_activity_state.tng_p11__activity_state, psc_activity_state.tng_p11_monitor__activity_state, psc_created_at.dust_p01_tng_p11__created_at, psc_created_at.tng_p11__created_at, psc_created_at.tng_p11_monitor__created_at, psc_accepted_at.dust_p01_tng_p11__accepted_at, psc_accepted_at.tng_p11__accepted_at, psc_accepted_at.tng_p11_monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p11__cancelled_at, psc_cancelled_at.tng_p11__cancelled_at, psc_cancelled_at.tng_p11_monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p11__revoked_at, psc_revoked_at.tng_p11__revoked_at, psc_revoked_at.tng_p11_monitor__revoked_at, psc_paused_at.dust_p01_tng_p11__paused_at, psc_paused_at.tng_p11__paused_at, psc_paused_at.tng_p11_monitor__paused_at, dust_p01_tng_p11_ic_dust_mother, tng_p11_ic_buccal_swab_child, tng_p11_ic_buccal_swab_mother, tng_p11_ic_cord_blood_mother, tng_p11_ic_drop_blood_child, tng_p11_ic_stool_child, tng_p11_ic_urine_mother, tng_p11_ic_venous_blood_mother, dust_p01_tng_p11_ic_dl_celpac_studies, dust_p01_tng_p11_ic_survey, tng_p11_ic_celspac_newsletter, tng_p11_ic_dl_celpac_studies, tng_p11_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #8
Day Hour Count Duration Avg duration Nov 30 05 1 1s589ms 1s589ms 17 1 2s642ms 2s642ms Dec 01 05 1 2s660ms 2s660ms 17 1 2s610ms 2s610ms Dec 02 05 1 2s790ms 2s790ms 17 1 2s160ms 2s160ms Dec 03 17 1 2s842ms 2s842ms Dec 04 05 1 2s170ms 2s170ms 17 1 2s270ms 2s270ms Dec 05 05 1 2s615ms 2s615ms 17 1 2s857ms 2s857ms Dec 06 05 1 1s598ms 1s598ms 17 1 2s426ms 2s426ms [ User: tng_migration_user - Total duration: 31s235ms - Times executed: 13 ]
[ Application: dbt - Total duration: 31s235ms - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__20"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__20__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG, Pilot ID: 20 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__role" text, "tng_p11__role" text, "tng_p11_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__state" text, "tng_p11__state" text, "tng_p11_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p11__activity_state" text, "tng_p11__activity_state" text, "tng_p11_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p11__created_at" text, "tng_p11__created_at" text, "tng_p11_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p11__accepted_at" text, "tng_p11__accepted_at" text, "tng_p11_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p11__cancelled_at" text, "tng_p11__cancelled_at" text, "tng_p11_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p11__revoked_at" text, "tng_p11__revoked_at" text, "tng_p11_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p11__paused_at" text, "tng_p11__paused_at" text, "tng_p11_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dust_mother'), ('tng_p11_ic_buccal_swab_child'), ('tng_p11_ic_buccal_swab_mother'), ('tng_p11_ic_cord_blood_mother'), ('tng_p11_ic_drop_blood_child'), ('tng_p11_ic_stool_child'), ('tng_p11_ic_urine_mother'), ('tng_p11_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p11_ic_dust_mother" text, "tng_p11_ic_buccal_swab_child" text, "tng_p11_ic_buccal_swab_mother" text, "tng_p11_ic_cord_blood_mother" text, "tng_p11_ic_drop_blood_child" text, "tng_p11_ic_stool_child" text, "tng_p11_ic_urine_mother" text, "tng_p11_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dl_celpac_studies'), ('dust_p01_tng_p11_ic_survey'), ('tng_p11_ic_celspac_newsletter'), ('tng_p11_ic_dl_celpac_studies'), ('tng_p11_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p11_ic_dl_celpac_studies" text, "dust_p01_tng_p11_ic_survey" text, "tng_p11_ic_celspac_newsletter" text, "tng_p11_ic_dl_celpac_studies" text, "tng_p11_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p11__role, psc_role.tng_p11__role, psc_role.tng_p11_monitor__role, psc_state.dust_p01_tng_p11__state, psc_state.tng_p11__state, psc_state.tng_p11_monitor__state, psc_activity_state.dust_p01_tng_p11__activity_state, psc_activity_state.tng_p11__activity_state, psc_activity_state.tng_p11_monitor__activity_state, psc_created_at.dust_p01_tng_p11__created_at, psc_created_at.tng_p11__created_at, psc_created_at.tng_p11_monitor__created_at, psc_accepted_at.dust_p01_tng_p11__accepted_at, psc_accepted_at.tng_p11__accepted_at, psc_accepted_at.tng_p11_monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p11__cancelled_at, psc_cancelled_at.tng_p11__cancelled_at, psc_cancelled_at.tng_p11_monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p11__revoked_at, psc_revoked_at.tng_p11__revoked_at, psc_revoked_at.tng_p11_monitor__revoked_at, psc_paused_at.dust_p01_tng_p11__paused_at, psc_paused_at.tng_p11__paused_at, psc_paused_at.tng_p11_monitor__paused_at, dust_p01_tng_p11_ic_dust_mother, tng_p11_ic_buccal_swab_child, tng_p11_ic_buccal_swab_mother, tng_p11_ic_cord_blood_mother, tng_p11_ic_drop_blood_child, tng_p11_ic_stool_child, tng_p11_ic_urine_mother, tng_p11_ic_venous_blood_mother, dust_p01_tng_p11_ic_dl_celpac_studies, dust_p01_tng_p11_ic_survey, tng_p11_ic_celspac_newsletter, tng_p11_ic_dl_celpac_studies, tng_p11_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 20 -- Pilot ID );
Date: 2025-12-05 17:02:28 Duration: 2s857ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__20"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__20__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG, Pilot ID: 20 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__role" text, "tng_p11__role" text, "tng_p11_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__state" text, "tng_p11__state" text, "tng_p11_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p11__activity_state" text, "tng_p11__activity_state" text, "tng_p11_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p11__created_at" text, "tng_p11__created_at" text, "tng_p11_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p11__accepted_at" text, "tng_p11__accepted_at" text, "tng_p11_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p11__cancelled_at" text, "tng_p11__cancelled_at" text, "tng_p11_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p11__revoked_at" text, "tng_p11__revoked_at" text, "tng_p11_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p11__paused_at" text, "tng_p11__paused_at" text, "tng_p11_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dust_mother'), ('tng_p11_ic_buccal_swab_child'), ('tng_p11_ic_buccal_swab_mother'), ('tng_p11_ic_cord_blood_mother'), ('tng_p11_ic_drop_blood_child'), ('tng_p11_ic_stool_child'), ('tng_p11_ic_urine_mother'), ('tng_p11_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p11_ic_dust_mother" text, "tng_p11_ic_buccal_swab_child" text, "tng_p11_ic_buccal_swab_mother" text, "tng_p11_ic_cord_blood_mother" text, "tng_p11_ic_drop_blood_child" text, "tng_p11_ic_stool_child" text, "tng_p11_ic_urine_mother" text, "tng_p11_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dl_celpac_studies'), ('dust_p01_tng_p11_ic_survey'), ('tng_p11_ic_celspac_newsletter'), ('tng_p11_ic_dl_celpac_studies'), ('tng_p11_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p11_ic_dl_celpac_studies" text, "dust_p01_tng_p11_ic_survey" text, "tng_p11_ic_celspac_newsletter" text, "tng_p11_ic_dl_celpac_studies" text, "tng_p11_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p11__role, psc_role.tng_p11__role, psc_role.tng_p11_monitor__role, psc_state.dust_p01_tng_p11__state, psc_state.tng_p11__state, psc_state.tng_p11_monitor__state, psc_activity_state.dust_p01_tng_p11__activity_state, psc_activity_state.tng_p11__activity_state, psc_activity_state.tng_p11_monitor__activity_state, psc_created_at.dust_p01_tng_p11__created_at, psc_created_at.tng_p11__created_at, psc_created_at.tng_p11_monitor__created_at, psc_accepted_at.dust_p01_tng_p11__accepted_at, psc_accepted_at.tng_p11__accepted_at, psc_accepted_at.tng_p11_monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p11__cancelled_at, psc_cancelled_at.tng_p11__cancelled_at, psc_cancelled_at.tng_p11_monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p11__revoked_at, psc_revoked_at.tng_p11__revoked_at, psc_revoked_at.tng_p11_monitor__revoked_at, psc_paused_at.dust_p01_tng_p11__paused_at, psc_paused_at.tng_p11__paused_at, psc_paused_at.tng_p11_monitor__paused_at, dust_p01_tng_p11_ic_dust_mother, tng_p11_ic_buccal_swab_child, tng_p11_ic_buccal_swab_mother, tng_p11_ic_cord_blood_mother, tng_p11_ic_drop_blood_child, tng_p11_ic_stool_child, tng_p11_ic_urine_mother, tng_p11_ic_venous_blood_mother, dust_p01_tng_p11_ic_dl_celpac_studies, dust_p01_tng_p11_ic_survey, tng_p11_ic_celspac_newsletter, tng_p11_ic_dl_celpac_studies, tng_p11_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 20 -- Pilot ID );
Date: 2025-12-03 17:02:28 Duration: 2s842ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__20"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__20__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG, Pilot ID: 20 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__role" text, "tng_p11__role" text, "tng_p11_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p11__state" text, "tng_p11__state" text, "tng_p11_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p11__activity_state" text, "tng_p11__activity_state" text, "tng_p11_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p11__created_at" text, "tng_p11__created_at" text, "tng_p11_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p11__accepted_at" text, "tng_p11__accepted_at" text, "tng_p11_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p11__cancelled_at" text, "tng_p11__cancelled_at" text, "tng_p11_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p11__revoked_at" text, "tng_p11__revoked_at" text, "tng_p11_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11'), ('tng_p11'), ('tng_p11_monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p11__paused_at" text, "tng_p11__paused_at" text, "tng_p11_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dust_mother'), ('tng_p11_ic_buccal_swab_child'), ('tng_p11_ic_buccal_swab_mother'), ('tng_p11_ic_cord_blood_mother'), ('tng_p11_ic_drop_blood_child'), ('tng_p11_ic_stool_child'), ('tng_p11_ic_urine_mother'), ('tng_p11_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p11_ic_dust_mother" text, "tng_p11_ic_buccal_swab_child" text, "tng_p11_ic_buccal_swab_mother" text, "tng_p11_ic_cord_blood_mother" text, "tng_p11_ic_drop_blood_child" text, "tng_p11_ic_stool_child" text, "tng_p11_ic_urine_mother" text, "tng_p11_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 20 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p11_ic_dl_celpac_studies'), ('dust_p01_tng_p11_ic_survey'), ('tng_p11_ic_celspac_newsletter'), ('tng_p11_ic_dl_celpac_studies'), ('tng_p11_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p11_ic_dl_celpac_studies" text, "dust_p01_tng_p11_ic_survey" text, "tng_p11_ic_celspac_newsletter" text, "tng_p11_ic_dl_celpac_studies" text, "tng_p11_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p11__role, psc_role.tng_p11__role, psc_role.tng_p11_monitor__role, psc_state.dust_p01_tng_p11__state, psc_state.tng_p11__state, psc_state.tng_p11_monitor__state, psc_activity_state.dust_p01_tng_p11__activity_state, psc_activity_state.tng_p11__activity_state, psc_activity_state.tng_p11_monitor__activity_state, psc_created_at.dust_p01_tng_p11__created_at, psc_created_at.tng_p11__created_at, psc_created_at.tng_p11_monitor__created_at, psc_accepted_at.dust_p01_tng_p11__accepted_at, psc_accepted_at.tng_p11__accepted_at, psc_accepted_at.tng_p11_monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p11__cancelled_at, psc_cancelled_at.tng_p11__cancelled_at, psc_cancelled_at.tng_p11_monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p11__revoked_at, psc_revoked_at.tng_p11__revoked_at, psc_revoked_at.tng_p11_monitor__revoked_at, psc_paused_at.dust_p01_tng_p11__paused_at, psc_paused_at.tng_p11__paused_at, psc_paused_at.tng_p11_monitor__paused_at, dust_p01_tng_p11_ic_dust_mother, tng_p11_ic_buccal_swab_child, tng_p11_ic_buccal_swab_mother, tng_p11_ic_cord_blood_mother, tng_p11_ic_drop_blood_child, tng_p11_ic_stool_child, tng_p11_ic_urine_mother, tng_p11_ic_venous_blood_mother, dust_p01_tng_p11_ic_dl_celpac_studies, dust_p01_tng_p11_ic_survey, tng_p11_ic_celspac_newsletter, tng_p11_ic_dl_celpac_studies, tng_p11_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 20 -- Pilot ID );
Date: 2025-12-02 05:02:26 Duration: 2s790ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
9 1s573ms 2s260ms 1s989ms 13 25s857ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__22__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "tng_p12__role" text, "tng_p12_monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "tng_p12__state" text, "tng_p12_monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as activity ("subject_id" int, "tng_p12__activity_state" text, "tng_p12_monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as created_at ("subject_id" int, "tng_p12__created_at" text, "tng_p12_monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as accepted_at ("subject_id" int, "tng_p12__accepted_at" text, "tng_p12_monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as cancelled_at ("subject_id" int, "tng_p12__cancelled_at" text, "tng_p12_monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as revoked_at ("subject_id" int, "tng_p12__revoked_at" text, "tng_p12_monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as paused_at ("subject_id" int, "tng_p12__paused_at" text, "tng_p12_monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "tng_p12_ic_buccal_swab_child" text, "tng_p12_ic_buccal_swab_mother" text, "tng_p12_ic_cord_blood_mother" text, "tng_p12_ic_drop_blood_child" text, "tng_p12_ic_stool_child" text, "tng_p12_ic_urine_mother" text, "tng_p12_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as extra_state ("subject_id" int, "tng_p12_ic_celspac_newsletter" text, "tng_p12_ic_dl_celpac_studies" text, "tng_p12_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.tng_p12__role, psc_role.tng_p12_monitor__role, psc_state.tng_p12__state, psc_state.tng_p12_monitor__state, psc_activity_state.tng_p12__activity_state, psc_activity_state.tng_p12_monitor__activity_state, psc_created_at.tng_p12__created_at, psc_created_at.tng_p12_monitor__created_at, psc_accepted_at.tng_p12__accepted_at, psc_accepted_at.tng_p12_monitor__accepted_at, psc_cancelled_at.tng_p12__cancelled_at, psc_cancelled_at.tng_p12_monitor__cancelled_at, psc_revoked_at.tng_p12__revoked_at, psc_revoked_at.tng_p12_monitor__revoked_at, psc_paused_at.tng_p12__paused_at, psc_paused_at.tng_p12_monitor__paused_at, tng_p12_ic_buccal_swab_child, tng_p12_ic_buccal_swab_mother, tng_p12_ic_cord_blood_mother, tng_p12_ic_drop_blood_child, tng_p12_ic_stool_child, tng_p12_ic_urine_mother, tng_p12_ic_venous_blood_mother, tng_p12_ic_celspac_newsletter, tng_p12_ic_dl_celpac_studies, tng_p12_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #9
Day Hour Count Duration Avg duration Nov 30 05 1 2s65ms 2s65ms 17 1 2s83ms 2s83ms Dec 01 05 1 1s573ms 1s573ms 17 1 1s997ms 1s997ms Dec 02 05 1 2s31ms 2s31ms 17 1 1s855ms 1s855ms Dec 03 17 1 2s195ms 2s195ms Dec 04 05 1 1s857ms 1s857ms 17 1 1s768ms 1s768ms Dec 05 05 1 2s205ms 2s205ms 17 1 2s260ms 2s260ms Dec 06 05 1 1s823ms 1s823ms 17 1 2s141ms 2s141ms [ User: tng_migration_user - Total duration: 25s857ms - Times executed: 13 ]
[ Application: dbt - Total duration: 25s857ms - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__22"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__22__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG (nabor od 29.4.2022), Pilot ID: 22 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__role" text, "tng_p12_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__state" text, "tng_p12_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS activity ("subject_id" int, "tng_p12__activity_state" text, "tng_p12_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS created_at ("subject_id" int, "tng_p12__created_at" text, "tng_p12_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p12__accepted_at" text, "tng_p12_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p12__cancelled_at" text, "tng_p12_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p12__revoked_at" text, "tng_p12_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p12__paused_at" text, "tng_p12_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_buccal_swab_child'), ('tng_p12_ic_buccal_swab_mother'), ('tng_p12_ic_cord_blood_mother'), ('tng_p12_ic_drop_blood_child'), ('tng_p12_ic_stool_child'), ('tng_p12_ic_urine_mother'), ('tng_p12_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p12_ic_buccal_swab_child" text, "tng_p12_ic_buccal_swab_mother" text, "tng_p12_ic_cord_blood_mother" text, "tng_p12_ic_drop_blood_child" text, "tng_p12_ic_stool_child" text, "tng_p12_ic_urine_mother" text, "tng_p12_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_celspac_newsletter'), ('tng_p12_ic_dl_celpac_studies'), ('tng_p12_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p12_ic_celspac_newsletter" text, "tng_p12_ic_dl_celpac_studies" text, "tng_p12_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p12__role, psc_role.tng_p12_monitor__role, psc_state.tng_p12__state, psc_state.tng_p12_monitor__state, psc_activity_state.tng_p12__activity_state, psc_activity_state.tng_p12_monitor__activity_state, psc_created_at.tng_p12__created_at, psc_created_at.tng_p12_monitor__created_at, psc_accepted_at.tng_p12__accepted_at, psc_accepted_at.tng_p12_monitor__accepted_at, psc_cancelled_at.tng_p12__cancelled_at, psc_cancelled_at.tng_p12_monitor__cancelled_at, psc_revoked_at.tng_p12__revoked_at, psc_revoked_at.tng_p12_monitor__revoked_at, psc_paused_at.tng_p12__paused_at, psc_paused_at.tng_p12_monitor__paused_at, tng_p12_ic_buccal_swab_child, tng_p12_ic_buccal_swab_mother, tng_p12_ic_cord_blood_mother, tng_p12_ic_drop_blood_child, tng_p12_ic_stool_child, tng_p12_ic_urine_mother, tng_p12_ic_venous_blood_mother, tng_p12_ic_celspac_newsletter, tng_p12_ic_dl_celpac_studies, tng_p12_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 22 -- Pilot ID );
Date: 2025-12-05 17:02:29 Duration: 2s260ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__22"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__22__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG (nabor od 29.4.2022), Pilot ID: 22 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__role" text, "tng_p12_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__state" text, "tng_p12_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS activity ("subject_id" int, "tng_p12__activity_state" text, "tng_p12_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS created_at ("subject_id" int, "tng_p12__created_at" text, "tng_p12_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p12__accepted_at" text, "tng_p12_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p12__cancelled_at" text, "tng_p12_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p12__revoked_at" text, "tng_p12_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p12__paused_at" text, "tng_p12_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_buccal_swab_child'), ('tng_p12_ic_buccal_swab_mother'), ('tng_p12_ic_cord_blood_mother'), ('tng_p12_ic_drop_blood_child'), ('tng_p12_ic_stool_child'), ('tng_p12_ic_urine_mother'), ('tng_p12_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p12_ic_buccal_swab_child" text, "tng_p12_ic_buccal_swab_mother" text, "tng_p12_ic_cord_blood_mother" text, "tng_p12_ic_drop_blood_child" text, "tng_p12_ic_stool_child" text, "tng_p12_ic_urine_mother" text, "tng_p12_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_celspac_newsletter'), ('tng_p12_ic_dl_celpac_studies'), ('tng_p12_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p12_ic_celspac_newsletter" text, "tng_p12_ic_dl_celpac_studies" text, "tng_p12_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p12__role, psc_role.tng_p12_monitor__role, psc_state.tng_p12__state, psc_state.tng_p12_monitor__state, psc_activity_state.tng_p12__activity_state, psc_activity_state.tng_p12_monitor__activity_state, psc_created_at.tng_p12__created_at, psc_created_at.tng_p12_monitor__created_at, psc_accepted_at.tng_p12__accepted_at, psc_accepted_at.tng_p12_monitor__accepted_at, psc_cancelled_at.tng_p12__cancelled_at, psc_cancelled_at.tng_p12_monitor__cancelled_at, psc_revoked_at.tng_p12__revoked_at, psc_revoked_at.tng_p12_monitor__revoked_at, psc_paused_at.tng_p12__paused_at, psc_paused_at.tng_p12_monitor__paused_at, tng_p12_ic_buccal_swab_child, tng_p12_ic_buccal_swab_mother, tng_p12_ic_cord_blood_mother, tng_p12_ic_drop_blood_child, tng_p12_ic_stool_child, tng_p12_ic_urine_mother, tng_p12_ic_venous_blood_mother, tng_p12_ic_celspac_newsletter, tng_p12_ic_dl_celpac_studies, tng_p12_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 22 -- Pilot ID );
Date: 2025-12-05 05:02:28 Duration: 2s205ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__22"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__22__dbt_tmp" as ( -- suject (proband) patrici do kohorty CELSPAC: TNG (nabor od 29.4.2022), Pilot ID: 22 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__role" text, "tng_p12_monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS role ("subject_id" int, "tng_p12__state" text, "tng_p12_monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS activity ("subject_id" int, "tng_p12__activity_state" text, "tng_p12_monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS created_at ("subject_id" int, "tng_p12__created_at" text, "tng_p12_monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p12__accepted_at" text, "tng_p12_monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p12__cancelled_at" text, "tng_p12_monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p12__revoked_at" text, "tng_p12_monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12'), ('tng_p12_monitor') $$ ) AS paused_at ("subject_id" int, "tng_p12__paused_at" text, "tng_p12_monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_buccal_swab_child'), ('tng_p12_ic_buccal_swab_mother'), ('tng_p12_ic_cord_blood_mother'), ('tng_p12_ic_drop_blood_child'), ('tng_p12_ic_stool_child'), ('tng_p12_ic_urine_mother'), ('tng_p12_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p12_ic_buccal_swab_child" text, "tng_p12_ic_buccal_swab_mother" text, "tng_p12_ic_cord_blood_mother" text, "tng_p12_ic_drop_blood_child" text, "tng_p12_ic_stool_child" text, "tng_p12_ic_urine_mother" text, "tng_p12_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 22 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p12_ic_celspac_newsletter'), ('tng_p12_ic_dl_celpac_studies'), ('tng_p12_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p12_ic_celspac_newsletter" text, "tng_p12_ic_dl_celpac_studies" text, "tng_p12_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p12__role, psc_role.tng_p12_monitor__role, psc_state.tng_p12__state, psc_state.tng_p12_monitor__state, psc_activity_state.tng_p12__activity_state, psc_activity_state.tng_p12_monitor__activity_state, psc_created_at.tng_p12__created_at, psc_created_at.tng_p12_monitor__created_at, psc_accepted_at.tng_p12__accepted_at, psc_accepted_at.tng_p12_monitor__accepted_at, psc_cancelled_at.tng_p12__cancelled_at, psc_cancelled_at.tng_p12_monitor__cancelled_at, psc_revoked_at.tng_p12__revoked_at, psc_revoked_at.tng_p12_monitor__revoked_at, psc_paused_at.tng_p12__paused_at, psc_paused_at.tng_p12_monitor__paused_at, tng_p12_ic_buccal_swab_child, tng_p12_ic_buccal_swab_mother, tng_p12_ic_cord_blood_mother, tng_p12_ic_drop_blood_child, tng_p12_ic_stool_child, tng_p12_ic_urine_mother, tng_p12_ic_venous_blood_mother, tng_p12_ic_celspac_newsletter, tng_p12_ic_dl_celpac_studies, tng_p12_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 22 -- Pilot ID );
Date: 2025-12-03 17:02:30 Duration: 2s195ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
10 932ms 10s479ms 1s936ms 13 25s171ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__1__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "tng_p08__role" text, "tng_p08_test__role" text, "tng_pilot_8__monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "tng_p08__state" text, "tng_p08_test__state" text, "tng_pilot_8__monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as activity ("subject_id" int, "tng_p08__activity_state" text, "tng_p08_test__activity_state" text, "tng_pilot_8__monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as created_at ("subject_id" int, "tng_p08__created_at" text, "tng_p08_test__created_at" text, "tng_pilot_8__monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "tng_p08__accepted_at" text, "tng_p08_test__accepted_at" text, "tng_pilot_8__monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "tng_p08__cancelled_at" text, "tng_p08_test__cancelled_at" text, "tng_pilot_8__monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "tng_p08__revoked_at" text, "tng_p08_test__revoked_at" text, "tng_pilot_8__monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as paused_at ("subject_id" int, "tng_p08__paused_at" text, "tng_p08_test__paused_at" text, "tng_pilot_8__monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "tng_p08_ic_buccal_swab_child" text, "tng_p08_ic_buccal_swab_mother" text, "tng_p08_ic_cord_blood_mother" text, "tng_p08_ic_drop_blood_child" text, "tng_p08_ic_stool_child" text, "tng_p08_ic_urine_mother" text, "tng_p08_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "tng_p08_ic_follow_up_studies" text, "tng_p08_ic_med_find" text, "tng_p08_test_ic_follow_up_studies" text, "tng_p08_test_ic_med_find" text, "tng_pilot_8__monitor_ic_follow_up_studies" text, "tng_pilot_8__monitor_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.tng_p08__role, psc_role.tng_p08_test__role, psc_role.tng_pilot_8__monitor__role, psc_state.tng_p08__state, psc_state.tng_p08_test__state, psc_state.tng_pilot_8__monitor__state, psc_activity_state.tng_p08__activity_state, psc_activity_state.tng_p08_test__activity_state, psc_activity_state.tng_pilot_8__monitor__activity_state, psc_created_at.tng_p08__created_at, psc_created_at.tng_p08_test__created_at, psc_created_at.tng_pilot_8__monitor__created_at, psc_accepted_at.tng_p08__accepted_at, psc_accepted_at.tng_p08_test__accepted_at, psc_accepted_at.tng_pilot_8__monitor__accepted_at, psc_cancelled_at.tng_p08__cancelled_at, psc_cancelled_at.tng_p08_test__cancelled_at, psc_cancelled_at.tng_pilot_8__monitor__cancelled_at, psc_revoked_at.tng_p08__revoked_at, psc_revoked_at.tng_p08_test__revoked_at, psc_revoked_at.tng_pilot_8__monitor__revoked_at, psc_paused_at.tng_p08__paused_at, psc_paused_at.tng_p08_test__paused_at, psc_paused_at.tng_pilot_8__monitor__paused_at, tng_p08_ic_buccal_swab_child, tng_p08_ic_buccal_swab_mother, tng_p08_ic_cord_blood_mother, tng_p08_ic_drop_blood_child, tng_p08_ic_stool_child, tng_p08_ic_urine_mother, tng_p08_ic_venous_blood_mother, tng_p08_ic_follow_up_studies, tng_p08_ic_med_find, tng_p08_test_ic_follow_up_studies, tng_p08_test_ic_med_find, tng_pilot_8__monitor_ic_follow_up_studies, tng_pilot_8__monitor_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #10
Day Hour Count Duration Avg duration Nov 30 05 1 958ms 958ms 17 1 1s264ms 1s264ms Dec 01 05 1 1s476ms 1s476ms 17 1 1s337ms 1s337ms Dec 02 05 1 1s217ms 1s217ms 17 1 1s145ms 1s145ms Dec 03 17 1 1s319ms 1s319ms Dec 04 05 1 1s134ms 1s134ms 17 1 10s479ms 10s479ms Dec 05 05 1 1s402ms 1s402ms 17 1 1s269ms 1s269ms Dec 06 05 1 932ms 932ms 17 1 1s233ms 1s233ms [ User: tng_migration_user - Total duration: 25s171ms - Times executed: 13 ]
[ Application: dbt - Total duration: 25s171ms - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__1"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__1__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot VIII, Pilot ID: 1 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__role" text, "tng_p08_test__role" text, "tng_pilot_8__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__state" text, "tng_p08_test__state" text, "tng_pilot_8__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS activity ("subject_id" int, "tng_p08__activity_state" text, "tng_p08_test__activity_state" text, "tng_pilot_8__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS created_at ("subject_id" int, "tng_p08__created_at" text, "tng_p08_test__created_at" text, "tng_pilot_8__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p08__accepted_at" text, "tng_p08_test__accepted_at" text, "tng_pilot_8__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p08__cancelled_at" text, "tng_p08_test__cancelled_at" text, "tng_pilot_8__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p08__revoked_at" text, "tng_p08_test__revoked_at" text, "tng_pilot_8__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS paused_at ("subject_id" int, "tng_p08__paused_at" text, "tng_p08_test__paused_at" text, "tng_pilot_8__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_buccal_swab_child'), ('tng_p08_ic_buccal_swab_mother'), ('tng_p08_ic_cord_blood_mother'), ('tng_p08_ic_drop_blood_child'), ('tng_p08_ic_stool_child'), ('tng_p08_ic_urine_mother'), ('tng_p08_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p08_ic_buccal_swab_child" text, "tng_p08_ic_buccal_swab_mother" text, "tng_p08_ic_cord_blood_mother" text, "tng_p08_ic_drop_blood_child" text, "tng_p08_ic_stool_child" text, "tng_p08_ic_urine_mother" text, "tng_p08_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_follow_up_studies'), ('tng_p08_ic_med_find'), ('tng_p08_test_ic_follow_up_studies'), ('tng_p08_test_ic_med_find'), ('tng_pilot_8__monitor_ic_follow_up_studies'), ('tng_pilot_8__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p08_ic_follow_up_studies" text, "tng_p08_ic_med_find" text, "tng_p08_test_ic_follow_up_studies" text, "tng_p08_test_ic_med_find" text, "tng_pilot_8__monitor_ic_follow_up_studies" text, "tng_pilot_8__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p08__role, psc_role.tng_p08_test__role, psc_role.tng_pilot_8__monitor__role, psc_state.tng_p08__state, psc_state.tng_p08_test__state, psc_state.tng_pilot_8__monitor__state, psc_activity_state.tng_p08__activity_state, psc_activity_state.tng_p08_test__activity_state, psc_activity_state.tng_pilot_8__monitor__activity_state, psc_created_at.tng_p08__created_at, psc_created_at.tng_p08_test__created_at, psc_created_at.tng_pilot_8__monitor__created_at, psc_accepted_at.tng_p08__accepted_at, psc_accepted_at.tng_p08_test__accepted_at, psc_accepted_at.tng_pilot_8__monitor__accepted_at, psc_cancelled_at.tng_p08__cancelled_at, psc_cancelled_at.tng_p08_test__cancelled_at, psc_cancelled_at.tng_pilot_8__monitor__cancelled_at, psc_revoked_at.tng_p08__revoked_at, psc_revoked_at.tng_p08_test__revoked_at, psc_revoked_at.tng_pilot_8__monitor__revoked_at, psc_paused_at.tng_p08__paused_at, psc_paused_at.tng_p08_test__paused_at, psc_paused_at.tng_pilot_8__monitor__paused_at, tng_p08_ic_buccal_swab_child, tng_p08_ic_buccal_swab_mother, tng_p08_ic_cord_blood_mother, tng_p08_ic_drop_blood_child, tng_p08_ic_stool_child, tng_p08_ic_urine_mother, tng_p08_ic_venous_blood_mother, tng_p08_ic_follow_up_studies, tng_p08_ic_med_find, tng_p08_test_ic_follow_up_studies, tng_p08_test_ic_med_find, tng_pilot_8__monitor_ic_follow_up_studies, tng_pilot_8__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 1 -- Pilot ID );
Date: 2025-12-04 17:02:31 Duration: 10s479ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__1"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__1__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot VIII, Pilot ID: 1 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__role" text, "tng_p08_test__role" text, "tng_pilot_8__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__state" text, "tng_p08_test__state" text, "tng_pilot_8__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS activity ("subject_id" int, "tng_p08__activity_state" text, "tng_p08_test__activity_state" text, "tng_pilot_8__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS created_at ("subject_id" int, "tng_p08__created_at" text, "tng_p08_test__created_at" text, "tng_pilot_8__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p08__accepted_at" text, "tng_p08_test__accepted_at" text, "tng_pilot_8__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p08__cancelled_at" text, "tng_p08_test__cancelled_at" text, "tng_pilot_8__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p08__revoked_at" text, "tng_p08_test__revoked_at" text, "tng_pilot_8__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS paused_at ("subject_id" int, "tng_p08__paused_at" text, "tng_p08_test__paused_at" text, "tng_pilot_8__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_buccal_swab_child'), ('tng_p08_ic_buccal_swab_mother'), ('tng_p08_ic_cord_blood_mother'), ('tng_p08_ic_drop_blood_child'), ('tng_p08_ic_stool_child'), ('tng_p08_ic_urine_mother'), ('tng_p08_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p08_ic_buccal_swab_child" text, "tng_p08_ic_buccal_swab_mother" text, "tng_p08_ic_cord_blood_mother" text, "tng_p08_ic_drop_blood_child" text, "tng_p08_ic_stool_child" text, "tng_p08_ic_urine_mother" text, "tng_p08_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_follow_up_studies'), ('tng_p08_ic_med_find'), ('tng_p08_test_ic_follow_up_studies'), ('tng_p08_test_ic_med_find'), ('tng_pilot_8__monitor_ic_follow_up_studies'), ('tng_pilot_8__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p08_ic_follow_up_studies" text, "tng_p08_ic_med_find" text, "tng_p08_test_ic_follow_up_studies" text, "tng_p08_test_ic_med_find" text, "tng_pilot_8__monitor_ic_follow_up_studies" text, "tng_pilot_8__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p08__role, psc_role.tng_p08_test__role, psc_role.tng_pilot_8__monitor__role, psc_state.tng_p08__state, psc_state.tng_p08_test__state, psc_state.tng_pilot_8__monitor__state, psc_activity_state.tng_p08__activity_state, psc_activity_state.tng_p08_test__activity_state, psc_activity_state.tng_pilot_8__monitor__activity_state, psc_created_at.tng_p08__created_at, psc_created_at.tng_p08_test__created_at, psc_created_at.tng_pilot_8__monitor__created_at, psc_accepted_at.tng_p08__accepted_at, psc_accepted_at.tng_p08_test__accepted_at, psc_accepted_at.tng_pilot_8__monitor__accepted_at, psc_cancelled_at.tng_p08__cancelled_at, psc_cancelled_at.tng_p08_test__cancelled_at, psc_cancelled_at.tng_pilot_8__monitor__cancelled_at, psc_revoked_at.tng_p08__revoked_at, psc_revoked_at.tng_p08_test__revoked_at, psc_revoked_at.tng_pilot_8__monitor__revoked_at, psc_paused_at.tng_p08__paused_at, psc_paused_at.tng_p08_test__paused_at, psc_paused_at.tng_pilot_8__monitor__paused_at, tng_p08_ic_buccal_swab_child, tng_p08_ic_buccal_swab_mother, tng_p08_ic_cord_blood_mother, tng_p08_ic_drop_blood_child, tng_p08_ic_stool_child, tng_p08_ic_urine_mother, tng_p08_ic_venous_blood_mother, tng_p08_ic_follow_up_studies, tng_p08_ic_med_find, tng_p08_test_ic_follow_up_studies, tng_p08_test_ic_med_find, tng_pilot_8__monitor_ic_follow_up_studies, tng_pilot_8__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 1 -- Pilot ID );
Date: 2025-12-01 05:02:22 Duration: 1s476ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__1"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__1__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot VIII, Pilot ID: 1 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__role" text, "tng_p08_test__role" text, "tng_pilot_8__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS role ("subject_id" int, "tng_p08__state" text, "tng_p08_test__state" text, "tng_pilot_8__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS activity ("subject_id" int, "tng_p08__activity_state" text, "tng_p08_test__activity_state" text, "tng_pilot_8__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS created_at ("subject_id" int, "tng_p08__created_at" text, "tng_p08_test__created_at" text, "tng_pilot_8__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS accepted_at ("subject_id" int, "tng_p08__accepted_at" text, "tng_p08_test__accepted_at" text, "tng_pilot_8__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS cancelled_at ("subject_id" int, "tng_p08__cancelled_at" text, "tng_p08_test__cancelled_at" text, "tng_pilot_8__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS revoked_at ("subject_id" int, "tng_p08__revoked_at" text, "tng_p08_test__revoked_at" text, "tng_pilot_8__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08'), ('tng_p08_test'), ('tng_pilot_8__monitor') $$ ) AS paused_at ("subject_id" int, "tng_p08__paused_at" text, "tng_p08_test__paused_at" text, "tng_pilot_8__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_buccal_swab_child'), ('tng_p08_ic_buccal_swab_mother'), ('tng_p08_ic_cord_blood_mother'), ('tng_p08_ic_drop_blood_child'), ('tng_p08_ic_stool_child'), ('tng_p08_ic_urine_mother'), ('tng_p08_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "tng_p08_ic_buccal_swab_child" text, "tng_p08_ic_buccal_swab_mother" text, "tng_p08_ic_cord_blood_mother" text, "tng_p08_ic_drop_blood_child" text, "tng_p08_ic_stool_child" text, "tng_p08_ic_urine_mother" text, "tng_p08_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 1 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('tng_p08_ic_follow_up_studies'), ('tng_p08_ic_med_find'), ('tng_p08_test_ic_follow_up_studies'), ('tng_p08_test_ic_med_find'), ('tng_pilot_8__monitor_ic_follow_up_studies'), ('tng_pilot_8__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "tng_p08_ic_follow_up_studies" text, "tng_p08_ic_med_find" text, "tng_p08_test_ic_follow_up_studies" text, "tng_p08_test_ic_med_find" text, "tng_pilot_8__monitor_ic_follow_up_studies" text, "tng_pilot_8__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.tng_p08__role, psc_role.tng_p08_test__role, psc_role.tng_pilot_8__monitor__role, psc_state.tng_p08__state, psc_state.tng_p08_test__state, psc_state.tng_pilot_8__monitor__state, psc_activity_state.tng_p08__activity_state, psc_activity_state.tng_p08_test__activity_state, psc_activity_state.tng_pilot_8__monitor__activity_state, psc_created_at.tng_p08__created_at, psc_created_at.tng_p08_test__created_at, psc_created_at.tng_pilot_8__monitor__created_at, psc_accepted_at.tng_p08__accepted_at, psc_accepted_at.tng_p08_test__accepted_at, psc_accepted_at.tng_pilot_8__monitor__accepted_at, psc_cancelled_at.tng_p08__cancelled_at, psc_cancelled_at.tng_p08_test__cancelled_at, psc_cancelled_at.tng_pilot_8__monitor__cancelled_at, psc_revoked_at.tng_p08__revoked_at, psc_revoked_at.tng_p08_test__revoked_at, psc_revoked_at.tng_pilot_8__monitor__revoked_at, psc_paused_at.tng_p08__paused_at, psc_paused_at.tng_p08_test__paused_at, psc_paused_at.tng_pilot_8__monitor__paused_at, tng_p08_ic_buccal_swab_child, tng_p08_ic_buccal_swab_mother, tng_p08_ic_cord_blood_mother, tng_p08_ic_drop_blood_child, tng_p08_ic_stool_child, tng_p08_ic_urine_mother, tng_p08_ic_venous_blood_mother, tng_p08_ic_follow_up_studies, tng_p08_ic_med_find, tng_p08_test_ic_follow_up_studies, tng_p08_test_ic_med_find, tng_pilot_8__monitor_ic_follow_up_studies, tng_pilot_8__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 1 -- Pilot ID );
Date: 2025-12-05 05:02:23 Duration: 1s402ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
11 1s31ms 2s107ms 1s499ms 13 19s497ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__11__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p09__role" text, "tng_p09__role" text, "tng_pilot_9__form_fix_2019_06__role" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__role" text, "tng_pilot_9__monitor__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "dust_p01_tng_p09__state" text, "tng_p09__state" text, "tng_pilot_9__form_fix_2019_06__state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__state" text, "tng_pilot_9__monitor__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "dust_p01_tng_p09__activity_state" text, "tng_p09__activity_state" text, "tng_pilot_9__form_fix_2019_06__activity_state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state" text, "tng_pilot_9__monitor__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "dust_p01_tng_p09__created_at" text, "tng_p09__created_at" text, "tng_pilot_9__form_fix_2019_06__created_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__created_at" text, "tng_pilot_9__monitor__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "dust_p01_tng_p09__accepted_at" text, "tng_p09__accepted_at" text, "tng_pilot_9__form_fix_2019_06__accepted_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at" text, "tng_pilot_9__monitor__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "dust_p01_tng_p09__cancelled_at" text, "tng_p09__cancelled_at" text, "tng_pilot_9__form_fix_2019_06__cancelled_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at" text, "tng_pilot_9__monitor__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "dust_p01_tng_p09__revoked_at" text, "tng_p09__revoked_at" text, "tng_pilot_9__form_fix_2019_06__revoked_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at" text, "tng_pilot_9__monitor__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "dust_p01_tng_p09__paused_at" text, "tng_p09__paused_at" text, "tng_pilot_9__form_fix_2019_06__paused_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at" text, "tng_pilot_9__monitor__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "dust_p01_tng_p09_ic_dust_mother" text, "tng_p09_ic_buccal_swab_child" text, "tng_p09_ic_buccal_swab_mother" text, "tng_p09_ic_cord_blood_mother" text, "tng_p09_ic_drop_blood_child" text, "tng_p09_ic_stool_child" text, "tng_p09_ic_urine_mother" text, "tng_p09_ic_venous_blood_mother" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "dust_p01_tng_p09_ic_dl_celpac_studies" text, "dust_p01_tng_p09_ic_survey" text, "tng_p09_ic_follow_up_studies" text, "tng_p09_ic_med_find" text, "tng_pilot_9__monitor_ic_follow_up_studies" text, "tng_pilot_9__monitor_ic_med_find" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.dust_p01_tng_p09__role, psc_role.tng_p09__role, psc_role.tng_pilot_9__form_fix_2019_06__role, psc_role.tng_pilot_9__form_fix_mm38p01_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p02_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p03_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p04_v2_v2__role, psc_role.tng_pilot_9__monitor__role, psc_state.dust_p01_tng_p09__state, psc_state.tng_p09__state, psc_state.tng_pilot_9__form_fix_2019_06__state, psc_state.tng_pilot_9__form_fix_mm38p01_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p02_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p03_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p04_v2_v2__state, psc_state.tng_pilot_9__monitor__state, psc_activity_state.dust_p01_tng_p09__activity_state, psc_activity_state.tng_p09__activity_state, psc_activity_state.tng_pilot_9__form_fix_2019_06__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state, psc_activity_state.tng_pilot_9__monitor__activity_state, psc_created_at.dust_p01_tng_p09__created_at, psc_created_at.tng_p09__created_at, psc_created_at.tng_pilot_9__form_fix_2019_06__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p01_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p02_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p03_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p04_v2_v2__created_at, psc_created_at.tng_pilot_9__monitor__created_at, psc_accepted_at.dust_p01_tng_p09__accepted_at, psc_accepted_at.tng_p09__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_2019_06__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p09__cancelled_at, psc_cancelled_at.tng_p09__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_2019_06__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p09__revoked_at, psc_revoked_at.tng_p09__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_2019_06__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__monitor__revoked_at, psc_paused_at.dust_p01_tng_p09__paused_at, psc_paused_at.tng_p09__paused_at, psc_paused_at.tng_pilot_9__form_fix_2019_06__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at, psc_paused_at.tng_pilot_9__monitor__paused_at, dust_p01_tng_p09_ic_dust_mother, tng_p09_ic_buccal_swab_child, tng_p09_ic_buccal_swab_mother, tng_p09_ic_cord_blood_mother, tng_p09_ic_drop_blood_child, tng_p09_ic_stool_child, tng_p09_ic_urine_mother, tng_p09_ic_venous_blood_mother, dust_p01_tng_p09_ic_dl_celpac_studies, dust_p01_tng_p09_ic_survey, tng_p09_ic_follow_up_studies, tng_p09_ic_med_find, tng_pilot_9__monitor_ic_follow_up_studies, tng_pilot_9__monitor_ic_med_find from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #11
Day Hour Count Duration Avg duration Nov 30 05 1 1s31ms 1s31ms 17 1 1s687ms 1s687ms Dec 01 05 1 1s536ms 1s536ms 17 1 1s818ms 1s818ms Dec 02 05 1 1s635ms 1s635ms 17 1 1s132ms 1s132ms Dec 03 17 1 2s107ms 2s107ms Dec 04 05 1 1s37ms 1s37ms 17 1 1s103ms 1s103ms Dec 05 05 1 1s804ms 1s804ms 17 1 1s641ms 1s641ms Dec 06 05 1 1s202ms 1s202ms 17 1 1s757ms 1s757ms [ User: tng_migration_user - Total duration: 19s497ms - Times executed: 13 ]
[ Application: dbt - Total duration: 19s497ms - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__11"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__11__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot IX, Pilot ID: 11 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__role" text, "tng_p09__role" text, "tng_pilot_9__form_fix_2019_06__role" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__role" text, "tng_pilot_9__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__state" text, "tng_p09__state" text, "tng_pilot_9__form_fix_2019_06__state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__state" text, "tng_pilot_9__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p09__activity_state" text, "tng_p09__activity_state" text, "tng_pilot_9__form_fix_2019_06__activity_state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state" text, "tng_pilot_9__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p09__created_at" text, "tng_p09__created_at" text, "tng_pilot_9__form_fix_2019_06__created_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__created_at" text, "tng_pilot_9__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p09__accepted_at" text, "tng_p09__accepted_at" text, "tng_pilot_9__form_fix_2019_06__accepted_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at" text, "tng_pilot_9__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p09__cancelled_at" text, "tng_p09__cancelled_at" text, "tng_pilot_9__form_fix_2019_06__cancelled_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at" text, "tng_pilot_9__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p09__revoked_at" text, "tng_p09__revoked_at" text, "tng_pilot_9__form_fix_2019_06__revoked_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at" text, "tng_pilot_9__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p09__paused_at" text, "tng_p09__paused_at" text, "tng_pilot_9__form_fix_2019_06__paused_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at" text, "tng_pilot_9__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dust_mother'), ('tng_p09_ic_buccal_swab_child'), ('tng_p09_ic_buccal_swab_mother'), ('tng_p09_ic_cord_blood_mother'), ('tng_p09_ic_drop_blood_child'), ('tng_p09_ic_stool_child'), ('tng_p09_ic_urine_mother'), ('tng_p09_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p09_ic_dust_mother" text, "tng_p09_ic_buccal_swab_child" text, "tng_p09_ic_buccal_swab_mother" text, "tng_p09_ic_cord_blood_mother" text, "tng_p09_ic_drop_blood_child" text, "tng_p09_ic_stool_child" text, "tng_p09_ic_urine_mother" text, "tng_p09_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dl_celpac_studies'), ('dust_p01_tng_p09_ic_survey'), ('tng_p09_ic_follow_up_studies'), ('tng_p09_ic_med_find'), ('tng_pilot_9__monitor_ic_follow_up_studies'), ('tng_pilot_9__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p09_ic_dl_celpac_studies" text, "dust_p01_tng_p09_ic_survey" text, "tng_p09_ic_follow_up_studies" text, "tng_p09_ic_med_find" text, "tng_pilot_9__monitor_ic_follow_up_studies" text, "tng_pilot_9__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p09__role, psc_role.tng_p09__role, psc_role.tng_pilot_9__form_fix_2019_06__role, psc_role.tng_pilot_9__form_fix_mm38p01_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p02_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p03_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p04_v2_v2__role, psc_role.tng_pilot_9__monitor__role, psc_state.dust_p01_tng_p09__state, psc_state.tng_p09__state, psc_state.tng_pilot_9__form_fix_2019_06__state, psc_state.tng_pilot_9__form_fix_mm38p01_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p02_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p03_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p04_v2_v2__state, psc_state.tng_pilot_9__monitor__state, psc_activity_state.dust_p01_tng_p09__activity_state, psc_activity_state.tng_p09__activity_state, psc_activity_state.tng_pilot_9__form_fix_2019_06__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state, psc_activity_state.tng_pilot_9__monitor__activity_state, psc_created_at.dust_p01_tng_p09__created_at, psc_created_at.tng_p09__created_at, psc_created_at.tng_pilot_9__form_fix_2019_06__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p01_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p02_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p03_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p04_v2_v2__created_at, psc_created_at.tng_pilot_9__monitor__created_at, psc_accepted_at.dust_p01_tng_p09__accepted_at, psc_accepted_at.tng_p09__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_2019_06__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p09__cancelled_at, psc_cancelled_at.tng_p09__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_2019_06__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p09__revoked_at, psc_revoked_at.tng_p09__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_2019_06__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__monitor__revoked_at, psc_paused_at.dust_p01_tng_p09__paused_at, psc_paused_at.tng_p09__paused_at, psc_paused_at.tng_pilot_9__form_fix_2019_06__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at, psc_paused_at.tng_pilot_9__monitor__paused_at, dust_p01_tng_p09_ic_dust_mother, tng_p09_ic_buccal_swab_child, tng_p09_ic_buccal_swab_mother, tng_p09_ic_cord_blood_mother, tng_p09_ic_drop_blood_child, tng_p09_ic_stool_child, tng_p09_ic_urine_mother, tng_p09_ic_venous_blood_mother, dust_p01_tng_p09_ic_dl_celpac_studies, dust_p01_tng_p09_ic_survey, tng_p09_ic_follow_up_studies, tng_p09_ic_med_find, tng_pilot_9__monitor_ic_follow_up_studies, tng_pilot_9__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 11 -- Pilot ID );
Date: 2025-12-03 17:02:24 Duration: 2s107ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__11"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__11__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot IX, Pilot ID: 11 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__role" text, "tng_p09__role" text, "tng_pilot_9__form_fix_2019_06__role" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__role" text, "tng_pilot_9__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__state" text, "tng_p09__state" text, "tng_pilot_9__form_fix_2019_06__state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__state" text, "tng_pilot_9__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p09__activity_state" text, "tng_p09__activity_state" text, "tng_pilot_9__form_fix_2019_06__activity_state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state" text, "tng_pilot_9__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p09__created_at" text, "tng_p09__created_at" text, "tng_pilot_9__form_fix_2019_06__created_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__created_at" text, "tng_pilot_9__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p09__accepted_at" text, "tng_p09__accepted_at" text, "tng_pilot_9__form_fix_2019_06__accepted_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at" text, "tng_pilot_9__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p09__cancelled_at" text, "tng_p09__cancelled_at" text, "tng_pilot_9__form_fix_2019_06__cancelled_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at" text, "tng_pilot_9__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p09__revoked_at" text, "tng_p09__revoked_at" text, "tng_pilot_9__form_fix_2019_06__revoked_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at" text, "tng_pilot_9__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p09__paused_at" text, "tng_p09__paused_at" text, "tng_pilot_9__form_fix_2019_06__paused_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at" text, "tng_pilot_9__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dust_mother'), ('tng_p09_ic_buccal_swab_child'), ('tng_p09_ic_buccal_swab_mother'), ('tng_p09_ic_cord_blood_mother'), ('tng_p09_ic_drop_blood_child'), ('tng_p09_ic_stool_child'), ('tng_p09_ic_urine_mother'), ('tng_p09_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p09_ic_dust_mother" text, "tng_p09_ic_buccal_swab_child" text, "tng_p09_ic_buccal_swab_mother" text, "tng_p09_ic_cord_blood_mother" text, "tng_p09_ic_drop_blood_child" text, "tng_p09_ic_stool_child" text, "tng_p09_ic_urine_mother" text, "tng_p09_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dl_celpac_studies'), ('dust_p01_tng_p09_ic_survey'), ('tng_p09_ic_follow_up_studies'), ('tng_p09_ic_med_find'), ('tng_pilot_9__monitor_ic_follow_up_studies'), ('tng_pilot_9__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p09_ic_dl_celpac_studies" text, "dust_p01_tng_p09_ic_survey" text, "tng_p09_ic_follow_up_studies" text, "tng_p09_ic_med_find" text, "tng_pilot_9__monitor_ic_follow_up_studies" text, "tng_pilot_9__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p09__role, psc_role.tng_p09__role, psc_role.tng_pilot_9__form_fix_2019_06__role, psc_role.tng_pilot_9__form_fix_mm38p01_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p02_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p03_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p04_v2_v2__role, psc_role.tng_pilot_9__monitor__role, psc_state.dust_p01_tng_p09__state, psc_state.tng_p09__state, psc_state.tng_pilot_9__form_fix_2019_06__state, psc_state.tng_pilot_9__form_fix_mm38p01_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p02_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p03_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p04_v2_v2__state, psc_state.tng_pilot_9__monitor__state, psc_activity_state.dust_p01_tng_p09__activity_state, psc_activity_state.tng_p09__activity_state, psc_activity_state.tng_pilot_9__form_fix_2019_06__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state, psc_activity_state.tng_pilot_9__monitor__activity_state, psc_created_at.dust_p01_tng_p09__created_at, psc_created_at.tng_p09__created_at, psc_created_at.tng_pilot_9__form_fix_2019_06__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p01_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p02_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p03_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p04_v2_v2__created_at, psc_created_at.tng_pilot_9__monitor__created_at, psc_accepted_at.dust_p01_tng_p09__accepted_at, psc_accepted_at.tng_p09__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_2019_06__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p09__cancelled_at, psc_cancelled_at.tng_p09__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_2019_06__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p09__revoked_at, psc_revoked_at.tng_p09__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_2019_06__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__monitor__revoked_at, psc_paused_at.dust_p01_tng_p09__paused_at, psc_paused_at.tng_p09__paused_at, psc_paused_at.tng_pilot_9__form_fix_2019_06__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at, psc_paused_at.tng_pilot_9__monitor__paused_at, dust_p01_tng_p09_ic_dust_mother, tng_p09_ic_buccal_swab_child, tng_p09_ic_buccal_swab_mother, tng_p09_ic_cord_blood_mother, tng_p09_ic_drop_blood_child, tng_p09_ic_stool_child, tng_p09_ic_urine_mother, tng_p09_ic_venous_blood_mother, dust_p01_tng_p09_ic_dl_celpac_studies, dust_p01_tng_p09_ic_survey, tng_p09_ic_follow_up_studies, tng_p09_ic_med_find, tng_pilot_9__monitor_ic_follow_up_studies, tng_pilot_9__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 11 -- Pilot ID );
Date: 2025-12-01 17:02:23 Duration: 1s818ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__11"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__11__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot IX, Pilot ID: 11 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__role" text, "tng_p09__role" text, "tng_pilot_9__form_fix_2019_06__role" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__role" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__role" text, "tng_pilot_9__monitor__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS role ("subject_id" int, "dust_p01_tng_p09__state" text, "tng_p09__state" text, "tng_pilot_9__form_fix_2019_06__state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__state" text, "tng_pilot_9__monitor__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p09__activity_state" text, "tng_p09__activity_state" text, "tng_pilot_9__form_fix_2019_06__activity_state" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state" text, "tng_pilot_9__monitor__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p09__created_at" text, "tng_p09__created_at" text, "tng_pilot_9__form_fix_2019_06__created_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__created_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__created_at" text, "tng_pilot_9__monitor__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p09__accepted_at" text, "tng_p09__accepted_at" text, "tng_pilot_9__form_fix_2019_06__accepted_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at" text, "tng_pilot_9__monitor__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p09__cancelled_at" text, "tng_p09__cancelled_at" text, "tng_pilot_9__form_fix_2019_06__cancelled_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at" text, "tng_pilot_9__monitor__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p09__revoked_at" text, "tng_p09__revoked_at" text, "tng_pilot_9__form_fix_2019_06__revoked_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at" text, "tng_pilot_9__monitor__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09'), ('tng_p09'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p09__paused_at" text, "tng_p09__paused_at" text, "tng_pilot_9__form_fix_2019_06__paused_at" text, "tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at" text, "tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at" text, "tng_pilot_9__monitor__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dust_mother'), ('tng_p09_ic_buccal_swab_child'), ('tng_p09_ic_buccal_swab_mother'), ('tng_p09_ic_cord_blood_mother'), ('tng_p09_ic_drop_blood_child'), ('tng_p09_ic_stool_child'), ('tng_p09_ic_urine_mother'), ('tng_p09_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p09_ic_dust_mother" text, "tng_p09_ic_buccal_swab_child" text, "tng_p09_ic_buccal_swab_mother" text, "tng_p09_ic_cord_blood_mother" text, "tng_p09_ic_drop_blood_child" text, "tng_p09_ic_stool_child" text, "tng_p09_ic_urine_mother" text, "tng_p09_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 11 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p09_ic_dl_celpac_studies'), ('dust_p01_tng_p09_ic_survey'), ('tng_p09_ic_follow_up_studies'), ('tng_p09_ic_med_find'), ('tng_pilot_9__monitor_ic_follow_up_studies'), ('tng_pilot_9__monitor_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p09_ic_dl_celpac_studies" text, "dust_p01_tng_p09_ic_survey" text, "tng_p09_ic_follow_up_studies" text, "tng_p09_ic_med_find" text, "tng_pilot_9__monitor_ic_follow_up_studies" text, "tng_pilot_9__monitor_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p09__role, psc_role.tng_p09__role, psc_role.tng_pilot_9__form_fix_2019_06__role, psc_role.tng_pilot_9__form_fix_mm38p01_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p02_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p03_v2_v2__role, psc_role.tng_pilot_9__form_fix_mm38p04_v2_v2__role, psc_role.tng_pilot_9__monitor__role, psc_state.dust_p01_tng_p09__state, psc_state.tng_p09__state, psc_state.tng_pilot_9__form_fix_2019_06__state, psc_state.tng_pilot_9__form_fix_mm38p01_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p02_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p03_v2_v2__state, psc_state.tng_pilot_9__form_fix_mm38p04_v2_v2__state, psc_state.tng_pilot_9__monitor__state, psc_activity_state.dust_p01_tng_p09__activity_state, psc_activity_state.tng_p09__activity_state, psc_activity_state.tng_pilot_9__form_fix_2019_06__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p01_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p02_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p03_v2_v2__activity_state, psc_activity_state.tng_pilot_9__form_fix_mm38p04_v2_v2__activity_state, psc_activity_state.tng_pilot_9__monitor__activity_state, psc_created_at.dust_p01_tng_p09__created_at, psc_created_at.tng_p09__created_at, psc_created_at.tng_pilot_9__form_fix_2019_06__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p01_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p02_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p03_v2_v2__created_at, psc_created_at.tng_pilot_9__form_fix_mm38p04_v2_v2__created_at, psc_created_at.tng_pilot_9__monitor__created_at, psc_accepted_at.dust_p01_tng_p09__accepted_at, psc_accepted_at.tng_p09__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_2019_06__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p01_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p02_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p03_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__form_fix_mm38p04_v2_v2__accepted_at, psc_accepted_at.tng_pilot_9__monitor__accepted_at, psc_cancelled_at.dust_p01_tng_p09__cancelled_at, psc_cancelled_at.tng_p09__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_2019_06__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p01_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p02_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p03_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__form_fix_mm38p04_v2_v2__cancelled_at, psc_cancelled_at.tng_pilot_9__monitor__cancelled_at, psc_revoked_at.dust_p01_tng_p09__revoked_at, psc_revoked_at.tng_p09__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_2019_06__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p01_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p02_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p03_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__form_fix_mm38p04_v2_v2__revoked_at, psc_revoked_at.tng_pilot_9__monitor__revoked_at, psc_paused_at.dust_p01_tng_p09__paused_at, psc_paused_at.tng_p09__paused_at, psc_paused_at.tng_pilot_9__form_fix_2019_06__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p01_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p02_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p03_v2_v2__paused_at, psc_paused_at.tng_pilot_9__form_fix_mm38p04_v2_v2__paused_at, psc_paused_at.tng_pilot_9__monitor__paused_at, dust_p01_tng_p09_ic_dust_mother, tng_p09_ic_buccal_swab_child, tng_p09_ic_buccal_swab_mother, tng_p09_ic_cord_blood_mother, tng_p09_ic_drop_blood_child, tng_p09_ic_stool_child, tng_p09_ic_urine_mother, tng_p09_ic_venous_blood_mother, dust_p01_tng_p09_ic_dl_celpac_studies, dust_p01_tng_p09_ic_survey, tng_p09_ic_follow_up_studies, tng_p09_ic_med_find, tng_pilot_9__monitor_ic_follow_up_studies, tng_pilot_9__monitor_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 11 -- Pilot ID );
Date: 2025-12-05 05:02:24 Duration: 1s804ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
12 662ms 1s911ms 1s468ms 13 19s96ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__15__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p02__role" text, "psycap_p02_old_ya_p02__role" text, "ya_p02__role" text, "ya_p02_digi_ya03v2__role" text, "ya_p02_digi_ya04v2__role" text, "ya_p02_digi_ya05v2__role" text, "ya_p02_test__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as role ("subject_id" int, "psycap_p01_ya_p02__state" text, "psycap_p02_old_ya_p02__state" text, "ya_p02__state" text, "ya_p02_digi_ya03v2__state" text, "ya_p02_digi_ya04v2__state" text, "ya_p02_digi_ya05v2__state" text, "ya_p02_test__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as activity ("subject_id" int, "psycap_p01_ya_p02__activity_state" text, "psycap_p02_old_ya_p02__activity_state" text, "ya_p02__activity_state" text, "ya_p02_digi_ya03v2__activity_state" text, "ya_p02_digi_ya04v2__activity_state" text, "ya_p02_digi_ya05v2__activity_state" text, "ya_p02_test__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as created_at ("subject_id" int, "psycap_p01_ya_p02__created_at" text, "psycap_p02_old_ya_p02__created_at" text, "ya_p02__created_at" text, "ya_p02_digi_ya03v2__created_at" text, "ya_p02_digi_ya04v2__created_at" text, "ya_p02_digi_ya05v2__created_at" text, "ya_p02_test__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "psycap_p01_ya_p02__accepted_at" text, "psycap_p02_old_ya_p02__accepted_at" text, "ya_p02__accepted_at" text, "ya_p02_digi_ya03v2__accepted_at" text, "ya_p02_digi_ya04v2__accepted_at" text, "ya_p02_digi_ya05v2__accepted_at" text, "ya_p02_test__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "psycap_p01_ya_p02__cancelled_at" text, "psycap_p02_old_ya_p02__cancelled_at" text, "ya_p02__cancelled_at" text, "ya_p02_digi_ya03v2__cancelled_at" text, "ya_p02_digi_ya04v2__cancelled_at" text, "ya_p02_digi_ya05v2__cancelled_at" text, "ya_p02_test__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "psycap_p01_ya_p02__revoked_at" text, "psycap_p02_old_ya_p02__revoked_at" text, "ya_p02__revoked_at" text, "ya_p02_digi_ya03v2__revoked_at" text, "ya_p02_digi_ya04v2__revoked_at" text, "ya_p02_digi_ya05v2__revoked_at" text, "ya_p02_test__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?) $$ ) as paused_at ("subject_id" int, "psycap_p01_ya_p02__paused_at" text, "psycap_p02_old_ya_p02__paused_at" text, "ya_p02__paused_at" text, "ya_p02_digi_ya03v2__paused_at" text, "ya_p02_digi_ya04v2__paused_at" text, "ya_p02_digi_ya05v2__paused_at" text, "ya_p02_test__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "ya_p02_ic_buccal_swab_proband" text, "ya_p02_ic_urine_proband" text, "ya_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?), (?) $$ ) as extra_state ("subject_id" int, "ya_p02_ic_anam_qs" text, "ya_p02_ic_aneurysm" text, "ya_p02_ic_anthropometry" text, "ya_p02_ic_arch_foot" text, "ya_p02_ic_basic_qs" text, "ya_p02_ic_blood_pressure" text, "ya_p02_ic_braces_piercing_iud" text, "ya_p02_ic_cognition_test" text, "ya_p02_ic_da_health_registry" text, "ya_p02_ic_dexa" text, "ya_p02_ic_enviro_qs" text, "ya_p02_ic_follow_up_studies" text, "ya_p02_ic_fracture_lower_body_last_3m" text, "ya_p02_ic_fracture_upper_body_last_3m" text, "ya_p02_ic_hand_grip" text, "ya_p02_ic_hearing_vision_impairment" text, "ya_p02_ic_heart_disease" text, "ya_p02_ic_hemoptysis_ns" text, "ya_p02_ic_hernia" text, "ya_p02_ic_hyperthyroidism" text, "ya_p02_ic_inability_hold_pencil" text, "ya_p02_ic_inability_stand_both_legs" text, "ya_p02_ic_inability_talk_cze" text, "ya_p02_ic_inability_walk" text, "ya_p02_ic_inbody" text, "ya_p02_ic_infectious_resp_diseases" text, "ya_p02_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p02_ic_knee_stability" text, "ya_p02_ic_nutri_qs" text, "ya_p02_ic_over_weight_200_height_195" text, "ya_p02_ic_pacemaker_defibrillator" text, "ya_p02_ic_pneumothorax" text, "ya_p02_ic_pregnancy" text, "ya_p02_ic_recent_eye_abdominal_chest_surgery" text, "ya_p02_ic_recent_myocardial_infarction" text, "ya_p02_ic_spirometry" text, "ya_p02_ic_surgical_metal_body" text, "ya_p02_ic_unstable_angina_pectoris" text, "ya_p02_ic_ya_dl_elspac" text, "ya_p02_ic_ya_med_find" text, "ya_p02_ic_ya_newsletter" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.psycap_p01_ya_p02__role, psc_role.psycap_p02_old_ya_p02__role, psc_role.ya_p02__role, psc_role.ya_p02_digi_ya03v2__role, psc_role.ya_p02_digi_ya04v2__role, psc_role.ya_p02_digi_ya05v2__role, psc_role.ya_p02_test__role, psc_state.psycap_p01_ya_p02__state, psc_state.psycap_p02_old_ya_p02__state, psc_state.ya_p02__state, psc_state.ya_p02_digi_ya03v2__state, psc_state.ya_p02_digi_ya04v2__state, psc_state.ya_p02_digi_ya05v2__state, psc_state.ya_p02_test__state, psc_activity_state.psycap_p01_ya_p02__activity_state, psc_activity_state.psycap_p02_old_ya_p02__activity_state, psc_activity_state.ya_p02__activity_state, psc_activity_state.ya_p02_digi_ya03v2__activity_state, psc_activity_state.ya_p02_digi_ya04v2__activity_state, psc_activity_state.ya_p02_digi_ya05v2__activity_state, psc_activity_state.ya_p02_test__activity_state, psc_created_at.psycap_p01_ya_p02__created_at, psc_created_at.psycap_p02_old_ya_p02__created_at, psc_created_at.ya_p02__created_at, psc_created_at.ya_p02_digi_ya03v2__created_at, psc_created_at.ya_p02_digi_ya04v2__created_at, psc_created_at.ya_p02_digi_ya05v2__created_at, psc_created_at.ya_p02_test__created_at, psc_accepted_at.psycap_p01_ya_p02__accepted_at, psc_accepted_at.psycap_p02_old_ya_p02__accepted_at, psc_accepted_at.ya_p02__accepted_at, psc_accepted_at.ya_p02_digi_ya03v2__accepted_at, psc_accepted_at.ya_p02_digi_ya04v2__accepted_at, psc_accepted_at.ya_p02_digi_ya05v2__accepted_at, psc_accepted_at.ya_p02_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p02__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p02__cancelled_at, psc_cancelled_at.ya_p02__cancelled_at, psc_cancelled_at.ya_p02_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p02_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p02__revoked_at, psc_revoked_at.psycap_p02_old_ya_p02__revoked_at, psc_revoked_at.ya_p02__revoked_at, psc_revoked_at.ya_p02_digi_ya03v2__revoked_at, psc_revoked_at.ya_p02_digi_ya04v2__revoked_at, psc_revoked_at.ya_p02_digi_ya05v2__revoked_at, psc_revoked_at.ya_p02_test__revoked_at, psc_paused_at.psycap_p01_ya_p02__paused_at, psc_paused_at.psycap_p02_old_ya_p02__paused_at, psc_paused_at.ya_p02__paused_at, psc_paused_at.ya_p02_digi_ya03v2__paused_at, psc_paused_at.ya_p02_digi_ya04v2__paused_at, psc_paused_at.ya_p02_digi_ya05v2__paused_at, psc_paused_at.ya_p02_test__paused_at, ya_p02_ic_buccal_swab_proband, ya_p02_ic_urine_proband, ya_p02_ic_venous_blood_proband, ya_p02_ic_anam_qs, ya_p02_ic_aneurysm, ya_p02_ic_anthropometry, ya_p02_ic_arch_foot, ya_p02_ic_basic_qs, ya_p02_ic_blood_pressure, ya_p02_ic_braces_piercing_iud, ya_p02_ic_cognition_test, ya_p02_ic_da_health_registry, ya_p02_ic_dexa, ya_p02_ic_enviro_qs, ya_p02_ic_follow_up_studies, ya_p02_ic_fracture_lower_body_last_3m, ya_p02_ic_fracture_upper_body_last_3m, ya_p02_ic_hand_grip, ya_p02_ic_hearing_vision_impairment, ya_p02_ic_heart_disease, ya_p02_ic_hemoptysis_ns, ya_p02_ic_hernia, ya_p02_ic_hyperthyroidism, ya_p02_ic_inability_hold_pencil, ya_p02_ic_inability_stand_both_legs, ya_p02_ic_inability_talk_cze, ya_p02_ic_inability_walk, ya_p02_ic_inbody, ya_p02_ic_infectious_resp_diseases, ya_p02_ic_iodine_barium_radioisotopes_last_7d, ya_p02_ic_knee_stability, ya_p02_ic_nutri_qs, ya_p02_ic_over_weight_200_height_195, ya_p02_ic_pacemaker_defibrillator, ya_p02_ic_pneumothorax, ya_p02_ic_pregnancy, ya_p02_ic_recent_eye_abdominal_chest_surgery, ya_p02_ic_recent_myocardial_infarction, ya_p02_ic_spirometry, ya_p02_ic_surgical_metal_body, ya_p02_ic_unstable_angina_pectoris, ya_p02_ic_ya_dl_elspac, ya_p02_ic_ya_med_find, ya_p02_ic_ya_newsletter from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #12
Day Hour Count Duration Avg duration Nov 30 05 1 1s50ms 1s50ms 17 1 1s768ms 1s768ms Dec 01 05 1 1s892ms 1s892ms 17 1 1s774ms 1s774ms Dec 02 05 1 1s615ms 1s615ms 17 1 1s82ms 1s82ms Dec 03 17 1 1s911ms 1s911ms Dec 04 05 1 662ms 662ms 17 1 1s196ms 1s196ms Dec 05 05 1 1s779ms 1s779ms 17 1 1s729ms 1s729ms Dec 06 05 1 981ms 981ms 17 1 1s650ms 1s650ms [ User: tng_migration_user - Total duration: 19s96ms - Times executed: 13 ]
[ Application: dbt - Total duration: 19s96ms - Times executed: 13 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__15"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__15__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA, Pilot ID: 15 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__role" text, "psycap_p02_old_ya_p02__role" text, "ya_p02__role" text, "ya_p02_digi_ya03v2__role" text, "ya_p02_digi_ya04v2__role" text, "ya_p02_digi_ya05v2__role" text, "ya_p02_test__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__state" text, "psycap_p02_old_ya_p02__state" text, "ya_p02__state" text, "ya_p02_digi_ya03v2__state" text, "ya_p02_digi_ya04v2__state" text, "ya_p02_digi_ya05v2__state" text, "ya_p02_test__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p02__activity_state" text, "psycap_p02_old_ya_p02__activity_state" text, "ya_p02__activity_state" text, "ya_p02_digi_ya03v2__activity_state" text, "ya_p02_digi_ya04v2__activity_state" text, "ya_p02_digi_ya05v2__activity_state" text, "ya_p02_test__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p02__created_at" text, "psycap_p02_old_ya_p02__created_at" text, "ya_p02__created_at" text, "ya_p02_digi_ya03v2__created_at" text, "ya_p02_digi_ya04v2__created_at" text, "ya_p02_digi_ya05v2__created_at" text, "ya_p02_test__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p02__accepted_at" text, "psycap_p02_old_ya_p02__accepted_at" text, "ya_p02__accepted_at" text, "ya_p02_digi_ya03v2__accepted_at" text, "ya_p02_digi_ya04v2__accepted_at" text, "ya_p02_digi_ya05v2__accepted_at" text, "ya_p02_test__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p02__cancelled_at" text, "psycap_p02_old_ya_p02__cancelled_at" text, "ya_p02__cancelled_at" text, "ya_p02_digi_ya03v2__cancelled_at" text, "ya_p02_digi_ya04v2__cancelled_at" text, "ya_p02_digi_ya05v2__cancelled_at" text, "ya_p02_test__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p02__revoked_at" text, "psycap_p02_old_ya_p02__revoked_at" text, "ya_p02__revoked_at" text, "ya_p02_digi_ya03v2__revoked_at" text, "ya_p02_digi_ya04v2__revoked_at" text, "ya_p02_digi_ya05v2__revoked_at" text, "ya_p02_test__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p02__paused_at" text, "psycap_p02_old_ya_p02__paused_at" text, "ya_p02__paused_at" text, "ya_p02_digi_ya03v2__paused_at" text, "ya_p02_digi_ya04v2__paused_at" text, "ya_p02_digi_ya05v2__paused_at" text, "ya_p02_test__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_buccal_swab_proband'), ('ya_p02_ic_urine_proband'), ('ya_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p02_ic_buccal_swab_proband" text, "ya_p02_ic_urine_proband" text, "ya_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_anam_qs'), ('ya_p02_ic_aneurysm'), ('ya_p02_ic_anthropometry'), ('ya_p02_ic_arch_foot'), ('ya_p02_ic_basic_qs'), ('ya_p02_ic_blood_pressure'), ('ya_p02_ic_braces_piercing_iud'), ('ya_p02_ic_cognition_test'), ('ya_p02_ic_da_health_registry'), ('ya_p02_ic_dexa'), ('ya_p02_ic_enviro_qs'), ('ya_p02_ic_follow_up_studies'), ('ya_p02_ic_fracture_lower_body_last_3m'), ('ya_p02_ic_fracture_upper_body_last_3m'), ('ya_p02_ic_hand_grip'), ('ya_p02_ic_hearing_vision_impairment'), ('ya_p02_ic_heart_disease'), ('ya_p02_ic_hemoptysis_ns'), ('ya_p02_ic_hernia'), ('ya_p02_ic_hyperthyroidism'), ('ya_p02_ic_inability_hold_pencil'), ('ya_p02_ic_inability_stand_both_legs'), ('ya_p02_ic_inability_talk_cze'), ('ya_p02_ic_inability_walk'), ('ya_p02_ic_inbody'), ('ya_p02_ic_infectious_resp_diseases'), ('ya_p02_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p02_ic_knee_stability'), ('ya_p02_ic_nutri_qs'), ('ya_p02_ic_over_weight_200_height_195'), ('ya_p02_ic_pacemaker_defibrillator'), ('ya_p02_ic_pneumothorax'), ('ya_p02_ic_pregnancy'), ('ya_p02_ic_recent_eye_abdominal_chest_surgery'), ('ya_p02_ic_recent_myocardial_infarction'), ('ya_p02_ic_spirometry'), ('ya_p02_ic_surgical_metal_body'), ('ya_p02_ic_unstable_angina_pectoris'), ('ya_p02_ic_ya_dl_elspac'), ('ya_p02_ic_ya_med_find'), ('ya_p02_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p02_ic_anam_qs" text, "ya_p02_ic_aneurysm" text, "ya_p02_ic_anthropometry" text, "ya_p02_ic_arch_foot" text, "ya_p02_ic_basic_qs" text, "ya_p02_ic_blood_pressure" text, "ya_p02_ic_braces_piercing_iud" text, "ya_p02_ic_cognition_test" text, "ya_p02_ic_da_health_registry" text, "ya_p02_ic_dexa" text, "ya_p02_ic_enviro_qs" text, "ya_p02_ic_follow_up_studies" text, "ya_p02_ic_fracture_lower_body_last_3m" text, "ya_p02_ic_fracture_upper_body_last_3m" text, "ya_p02_ic_hand_grip" text, "ya_p02_ic_hearing_vision_impairment" text, "ya_p02_ic_heart_disease" text, "ya_p02_ic_hemoptysis_ns" text, "ya_p02_ic_hernia" text, "ya_p02_ic_hyperthyroidism" text, "ya_p02_ic_inability_hold_pencil" text, "ya_p02_ic_inability_stand_both_legs" text, "ya_p02_ic_inability_talk_cze" text, "ya_p02_ic_inability_walk" text, "ya_p02_ic_inbody" text, "ya_p02_ic_infectious_resp_diseases" text, "ya_p02_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p02_ic_knee_stability" text, "ya_p02_ic_nutri_qs" text, "ya_p02_ic_over_weight_200_height_195" text, "ya_p02_ic_pacemaker_defibrillator" text, "ya_p02_ic_pneumothorax" text, "ya_p02_ic_pregnancy" text, "ya_p02_ic_recent_eye_abdominal_chest_surgery" text, "ya_p02_ic_recent_myocardial_infarction" text, "ya_p02_ic_spirometry" text, "ya_p02_ic_surgical_metal_body" text, "ya_p02_ic_unstable_angina_pectoris" text, "ya_p02_ic_ya_dl_elspac" text, "ya_p02_ic_ya_med_find" text, "ya_p02_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p02__role, psc_role.psycap_p02_old_ya_p02__role, psc_role.ya_p02__role, psc_role.ya_p02_digi_ya03v2__role, psc_role.ya_p02_digi_ya04v2__role, psc_role.ya_p02_digi_ya05v2__role, psc_role.ya_p02_test__role, psc_state.psycap_p01_ya_p02__state, psc_state.psycap_p02_old_ya_p02__state, psc_state.ya_p02__state, psc_state.ya_p02_digi_ya03v2__state, psc_state.ya_p02_digi_ya04v2__state, psc_state.ya_p02_digi_ya05v2__state, psc_state.ya_p02_test__state, psc_activity_state.psycap_p01_ya_p02__activity_state, psc_activity_state.psycap_p02_old_ya_p02__activity_state, psc_activity_state.ya_p02__activity_state, psc_activity_state.ya_p02_digi_ya03v2__activity_state, psc_activity_state.ya_p02_digi_ya04v2__activity_state, psc_activity_state.ya_p02_digi_ya05v2__activity_state, psc_activity_state.ya_p02_test__activity_state, psc_created_at.psycap_p01_ya_p02__created_at, psc_created_at.psycap_p02_old_ya_p02__created_at, psc_created_at.ya_p02__created_at, psc_created_at.ya_p02_digi_ya03v2__created_at, psc_created_at.ya_p02_digi_ya04v2__created_at, psc_created_at.ya_p02_digi_ya05v2__created_at, psc_created_at.ya_p02_test__created_at, psc_accepted_at.psycap_p01_ya_p02__accepted_at, psc_accepted_at.psycap_p02_old_ya_p02__accepted_at, psc_accepted_at.ya_p02__accepted_at, psc_accepted_at.ya_p02_digi_ya03v2__accepted_at, psc_accepted_at.ya_p02_digi_ya04v2__accepted_at, psc_accepted_at.ya_p02_digi_ya05v2__accepted_at, psc_accepted_at.ya_p02_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p02__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p02__cancelled_at, psc_cancelled_at.ya_p02__cancelled_at, psc_cancelled_at.ya_p02_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p02_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p02__revoked_at, psc_revoked_at.psycap_p02_old_ya_p02__revoked_at, psc_revoked_at.ya_p02__revoked_at, psc_revoked_at.ya_p02_digi_ya03v2__revoked_at, psc_revoked_at.ya_p02_digi_ya04v2__revoked_at, psc_revoked_at.ya_p02_digi_ya05v2__revoked_at, psc_revoked_at.ya_p02_test__revoked_at, psc_paused_at.psycap_p01_ya_p02__paused_at, psc_paused_at.psycap_p02_old_ya_p02__paused_at, psc_paused_at.ya_p02__paused_at, psc_paused_at.ya_p02_digi_ya03v2__paused_at, psc_paused_at.ya_p02_digi_ya04v2__paused_at, psc_paused_at.ya_p02_digi_ya05v2__paused_at, psc_paused_at.ya_p02_test__paused_at, ya_p02_ic_buccal_swab_proband, ya_p02_ic_urine_proband, ya_p02_ic_venous_blood_proband, ya_p02_ic_anam_qs, ya_p02_ic_aneurysm, ya_p02_ic_anthropometry, ya_p02_ic_arch_foot, ya_p02_ic_basic_qs, ya_p02_ic_blood_pressure, ya_p02_ic_braces_piercing_iud, ya_p02_ic_cognition_test, ya_p02_ic_da_health_registry, ya_p02_ic_dexa, ya_p02_ic_enviro_qs, ya_p02_ic_follow_up_studies, ya_p02_ic_fracture_lower_body_last_3m, ya_p02_ic_fracture_upper_body_last_3m, ya_p02_ic_hand_grip, ya_p02_ic_hearing_vision_impairment, ya_p02_ic_heart_disease, ya_p02_ic_hemoptysis_ns, ya_p02_ic_hernia, ya_p02_ic_hyperthyroidism, ya_p02_ic_inability_hold_pencil, ya_p02_ic_inability_stand_both_legs, ya_p02_ic_inability_talk_cze, ya_p02_ic_inability_walk, ya_p02_ic_inbody, ya_p02_ic_infectious_resp_diseases, ya_p02_ic_iodine_barium_radioisotopes_last_7d, ya_p02_ic_knee_stability, ya_p02_ic_nutri_qs, ya_p02_ic_over_weight_200_height_195, ya_p02_ic_pacemaker_defibrillator, ya_p02_ic_pneumothorax, ya_p02_ic_pregnancy, ya_p02_ic_recent_eye_abdominal_chest_surgery, ya_p02_ic_recent_myocardial_infarction, ya_p02_ic_spirometry, ya_p02_ic_surgical_metal_body, ya_p02_ic_unstable_angina_pectoris, ya_p02_ic_ya_dl_elspac, ya_p02_ic_ya_med_find, ya_p02_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 15 -- Pilot ID );
Date: 2025-12-03 17:02:26 Duration: 1s911ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__15"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__15__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA, Pilot ID: 15 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__role" text, "psycap_p02_old_ya_p02__role" text, "ya_p02__role" text, "ya_p02_digi_ya03v2__role" text, "ya_p02_digi_ya04v2__role" text, "ya_p02_digi_ya05v2__role" text, "ya_p02_test__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__state" text, "psycap_p02_old_ya_p02__state" text, "ya_p02__state" text, "ya_p02_digi_ya03v2__state" text, "ya_p02_digi_ya04v2__state" text, "ya_p02_digi_ya05v2__state" text, "ya_p02_test__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p02__activity_state" text, "psycap_p02_old_ya_p02__activity_state" text, "ya_p02__activity_state" text, "ya_p02_digi_ya03v2__activity_state" text, "ya_p02_digi_ya04v2__activity_state" text, "ya_p02_digi_ya05v2__activity_state" text, "ya_p02_test__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p02__created_at" text, "psycap_p02_old_ya_p02__created_at" text, "ya_p02__created_at" text, "ya_p02_digi_ya03v2__created_at" text, "ya_p02_digi_ya04v2__created_at" text, "ya_p02_digi_ya05v2__created_at" text, "ya_p02_test__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p02__accepted_at" text, "psycap_p02_old_ya_p02__accepted_at" text, "ya_p02__accepted_at" text, "ya_p02_digi_ya03v2__accepted_at" text, "ya_p02_digi_ya04v2__accepted_at" text, "ya_p02_digi_ya05v2__accepted_at" text, "ya_p02_test__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p02__cancelled_at" text, "psycap_p02_old_ya_p02__cancelled_at" text, "ya_p02__cancelled_at" text, "ya_p02_digi_ya03v2__cancelled_at" text, "ya_p02_digi_ya04v2__cancelled_at" text, "ya_p02_digi_ya05v2__cancelled_at" text, "ya_p02_test__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p02__revoked_at" text, "psycap_p02_old_ya_p02__revoked_at" text, "ya_p02__revoked_at" text, "ya_p02_digi_ya03v2__revoked_at" text, "ya_p02_digi_ya04v2__revoked_at" text, "ya_p02_digi_ya05v2__revoked_at" text, "ya_p02_test__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p02__paused_at" text, "psycap_p02_old_ya_p02__paused_at" text, "ya_p02__paused_at" text, "ya_p02_digi_ya03v2__paused_at" text, "ya_p02_digi_ya04v2__paused_at" text, "ya_p02_digi_ya05v2__paused_at" text, "ya_p02_test__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_buccal_swab_proband'), ('ya_p02_ic_urine_proband'), ('ya_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p02_ic_buccal_swab_proband" text, "ya_p02_ic_urine_proband" text, "ya_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_anam_qs'), ('ya_p02_ic_aneurysm'), ('ya_p02_ic_anthropometry'), ('ya_p02_ic_arch_foot'), ('ya_p02_ic_basic_qs'), ('ya_p02_ic_blood_pressure'), ('ya_p02_ic_braces_piercing_iud'), ('ya_p02_ic_cognition_test'), ('ya_p02_ic_da_health_registry'), ('ya_p02_ic_dexa'), ('ya_p02_ic_enviro_qs'), ('ya_p02_ic_follow_up_studies'), ('ya_p02_ic_fracture_lower_body_last_3m'), ('ya_p02_ic_fracture_upper_body_last_3m'), ('ya_p02_ic_hand_grip'), ('ya_p02_ic_hearing_vision_impairment'), ('ya_p02_ic_heart_disease'), ('ya_p02_ic_hemoptysis_ns'), ('ya_p02_ic_hernia'), ('ya_p02_ic_hyperthyroidism'), ('ya_p02_ic_inability_hold_pencil'), ('ya_p02_ic_inability_stand_both_legs'), ('ya_p02_ic_inability_talk_cze'), ('ya_p02_ic_inability_walk'), ('ya_p02_ic_inbody'), ('ya_p02_ic_infectious_resp_diseases'), ('ya_p02_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p02_ic_knee_stability'), ('ya_p02_ic_nutri_qs'), ('ya_p02_ic_over_weight_200_height_195'), ('ya_p02_ic_pacemaker_defibrillator'), ('ya_p02_ic_pneumothorax'), ('ya_p02_ic_pregnancy'), ('ya_p02_ic_recent_eye_abdominal_chest_surgery'), ('ya_p02_ic_recent_myocardial_infarction'), ('ya_p02_ic_spirometry'), ('ya_p02_ic_surgical_metal_body'), ('ya_p02_ic_unstable_angina_pectoris'), ('ya_p02_ic_ya_dl_elspac'), ('ya_p02_ic_ya_med_find'), ('ya_p02_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p02_ic_anam_qs" text, "ya_p02_ic_aneurysm" text, "ya_p02_ic_anthropometry" text, "ya_p02_ic_arch_foot" text, "ya_p02_ic_basic_qs" text, "ya_p02_ic_blood_pressure" text, "ya_p02_ic_braces_piercing_iud" text, "ya_p02_ic_cognition_test" text, "ya_p02_ic_da_health_registry" text, "ya_p02_ic_dexa" text, "ya_p02_ic_enviro_qs" text, "ya_p02_ic_follow_up_studies" text, "ya_p02_ic_fracture_lower_body_last_3m" text, "ya_p02_ic_fracture_upper_body_last_3m" text, "ya_p02_ic_hand_grip" text, "ya_p02_ic_hearing_vision_impairment" text, "ya_p02_ic_heart_disease" text, "ya_p02_ic_hemoptysis_ns" text, "ya_p02_ic_hernia" text, "ya_p02_ic_hyperthyroidism" text, "ya_p02_ic_inability_hold_pencil" text, "ya_p02_ic_inability_stand_both_legs" text, "ya_p02_ic_inability_talk_cze" text, "ya_p02_ic_inability_walk" text, "ya_p02_ic_inbody" text, "ya_p02_ic_infectious_resp_diseases" text, "ya_p02_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p02_ic_knee_stability" text, "ya_p02_ic_nutri_qs" text, "ya_p02_ic_over_weight_200_height_195" text, "ya_p02_ic_pacemaker_defibrillator" text, "ya_p02_ic_pneumothorax" text, "ya_p02_ic_pregnancy" text, "ya_p02_ic_recent_eye_abdominal_chest_surgery" text, "ya_p02_ic_recent_myocardial_infarction" text, "ya_p02_ic_spirometry" text, "ya_p02_ic_surgical_metal_body" text, "ya_p02_ic_unstable_angina_pectoris" text, "ya_p02_ic_ya_dl_elspac" text, "ya_p02_ic_ya_med_find" text, "ya_p02_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p02__role, psc_role.psycap_p02_old_ya_p02__role, psc_role.ya_p02__role, psc_role.ya_p02_digi_ya03v2__role, psc_role.ya_p02_digi_ya04v2__role, psc_role.ya_p02_digi_ya05v2__role, psc_role.ya_p02_test__role, psc_state.psycap_p01_ya_p02__state, psc_state.psycap_p02_old_ya_p02__state, psc_state.ya_p02__state, psc_state.ya_p02_digi_ya03v2__state, psc_state.ya_p02_digi_ya04v2__state, psc_state.ya_p02_digi_ya05v2__state, psc_state.ya_p02_test__state, psc_activity_state.psycap_p01_ya_p02__activity_state, psc_activity_state.psycap_p02_old_ya_p02__activity_state, psc_activity_state.ya_p02__activity_state, psc_activity_state.ya_p02_digi_ya03v2__activity_state, psc_activity_state.ya_p02_digi_ya04v2__activity_state, psc_activity_state.ya_p02_digi_ya05v2__activity_state, psc_activity_state.ya_p02_test__activity_state, psc_created_at.psycap_p01_ya_p02__created_at, psc_created_at.psycap_p02_old_ya_p02__created_at, psc_created_at.ya_p02__created_at, psc_created_at.ya_p02_digi_ya03v2__created_at, psc_created_at.ya_p02_digi_ya04v2__created_at, psc_created_at.ya_p02_digi_ya05v2__created_at, psc_created_at.ya_p02_test__created_at, psc_accepted_at.psycap_p01_ya_p02__accepted_at, psc_accepted_at.psycap_p02_old_ya_p02__accepted_at, psc_accepted_at.ya_p02__accepted_at, psc_accepted_at.ya_p02_digi_ya03v2__accepted_at, psc_accepted_at.ya_p02_digi_ya04v2__accepted_at, psc_accepted_at.ya_p02_digi_ya05v2__accepted_at, psc_accepted_at.ya_p02_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p02__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p02__cancelled_at, psc_cancelled_at.ya_p02__cancelled_at, psc_cancelled_at.ya_p02_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p02_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p02__revoked_at, psc_revoked_at.psycap_p02_old_ya_p02__revoked_at, psc_revoked_at.ya_p02__revoked_at, psc_revoked_at.ya_p02_digi_ya03v2__revoked_at, psc_revoked_at.ya_p02_digi_ya04v2__revoked_at, psc_revoked_at.ya_p02_digi_ya05v2__revoked_at, psc_revoked_at.ya_p02_test__revoked_at, psc_paused_at.psycap_p01_ya_p02__paused_at, psc_paused_at.psycap_p02_old_ya_p02__paused_at, psc_paused_at.ya_p02__paused_at, psc_paused_at.ya_p02_digi_ya03v2__paused_at, psc_paused_at.ya_p02_digi_ya04v2__paused_at, psc_paused_at.ya_p02_digi_ya05v2__paused_at, psc_paused_at.ya_p02_test__paused_at, ya_p02_ic_buccal_swab_proband, ya_p02_ic_urine_proband, ya_p02_ic_venous_blood_proband, ya_p02_ic_anam_qs, ya_p02_ic_aneurysm, ya_p02_ic_anthropometry, ya_p02_ic_arch_foot, ya_p02_ic_basic_qs, ya_p02_ic_blood_pressure, ya_p02_ic_braces_piercing_iud, ya_p02_ic_cognition_test, ya_p02_ic_da_health_registry, ya_p02_ic_dexa, ya_p02_ic_enviro_qs, ya_p02_ic_follow_up_studies, ya_p02_ic_fracture_lower_body_last_3m, ya_p02_ic_fracture_upper_body_last_3m, ya_p02_ic_hand_grip, ya_p02_ic_hearing_vision_impairment, ya_p02_ic_heart_disease, ya_p02_ic_hemoptysis_ns, ya_p02_ic_hernia, ya_p02_ic_hyperthyroidism, ya_p02_ic_inability_hold_pencil, ya_p02_ic_inability_stand_both_legs, ya_p02_ic_inability_talk_cze, ya_p02_ic_inability_walk, ya_p02_ic_inbody, ya_p02_ic_infectious_resp_diseases, ya_p02_ic_iodine_barium_radioisotopes_last_7d, ya_p02_ic_knee_stability, ya_p02_ic_nutri_qs, ya_p02_ic_over_weight_200_height_195, ya_p02_ic_pacemaker_defibrillator, ya_p02_ic_pneumothorax, ya_p02_ic_pregnancy, ya_p02_ic_recent_eye_abdominal_chest_surgery, ya_p02_ic_recent_myocardial_infarction, ya_p02_ic_spirometry, ya_p02_ic_surgical_metal_body, ya_p02_ic_unstable_angina_pectoris, ya_p02_ic_ya_dl_elspac, ya_p02_ic_ya_med_find, ya_p02_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 15 -- Pilot ID );
Date: 2025-12-01 05:02:25 Duration: 1s892ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__15"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__15__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA, Pilot ID: 15 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__role" text, "psycap_p02_old_ya_p02__role" text, "ya_p02__role" text, "ya_p02_digi_ya03v2__role" text, "ya_p02_digi_ya04v2__role" text, "ya_p02_digi_ya05v2__role" text, "ya_p02_test__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p02__state" text, "psycap_p02_old_ya_p02__state" text, "ya_p02__state" text, "ya_p02_digi_ya03v2__state" text, "ya_p02_digi_ya04v2__state" text, "ya_p02_digi_ya05v2__state" text, "ya_p02_test__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p02__activity_state" text, "psycap_p02_old_ya_p02__activity_state" text, "ya_p02__activity_state" text, "ya_p02_digi_ya03v2__activity_state" text, "ya_p02_digi_ya04v2__activity_state" text, "ya_p02_digi_ya05v2__activity_state" text, "ya_p02_test__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p02__created_at" text, "psycap_p02_old_ya_p02__created_at" text, "ya_p02__created_at" text, "ya_p02_digi_ya03v2__created_at" text, "ya_p02_digi_ya04v2__created_at" text, "ya_p02_digi_ya05v2__created_at" text, "ya_p02_test__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p02__accepted_at" text, "psycap_p02_old_ya_p02__accepted_at" text, "ya_p02__accepted_at" text, "ya_p02_digi_ya03v2__accepted_at" text, "ya_p02_digi_ya04v2__accepted_at" text, "ya_p02_digi_ya05v2__accepted_at" text, "ya_p02_test__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p02__cancelled_at" text, "psycap_p02_old_ya_p02__cancelled_at" text, "ya_p02__cancelled_at" text, "ya_p02_digi_ya03v2__cancelled_at" text, "ya_p02_digi_ya04v2__cancelled_at" text, "ya_p02_digi_ya05v2__cancelled_at" text, "ya_p02_test__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p02__revoked_at" text, "psycap_p02_old_ya_p02__revoked_at" text, "ya_p02__revoked_at" text, "ya_p02_digi_ya03v2__revoked_at" text, "ya_p02_digi_ya04v2__revoked_at" text, "ya_p02_digi_ya05v2__revoked_at" text, "ya_p02_test__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p02'), ('psycap_p02_old_ya_p02'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p02__paused_at" text, "psycap_p02_old_ya_p02__paused_at" text, "ya_p02__paused_at" text, "ya_p02_digi_ya03v2__paused_at" text, "ya_p02_digi_ya04v2__paused_at" text, "ya_p02_digi_ya05v2__paused_at" text, "ya_p02_test__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_buccal_swab_proband'), ('ya_p02_ic_urine_proband'), ('ya_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p02_ic_buccal_swab_proband" text, "ya_p02_ic_urine_proband" text, "ya_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 15 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p02_ic_anam_qs'), ('ya_p02_ic_aneurysm'), ('ya_p02_ic_anthropometry'), ('ya_p02_ic_arch_foot'), ('ya_p02_ic_basic_qs'), ('ya_p02_ic_blood_pressure'), ('ya_p02_ic_braces_piercing_iud'), ('ya_p02_ic_cognition_test'), ('ya_p02_ic_da_health_registry'), ('ya_p02_ic_dexa'), ('ya_p02_ic_enviro_qs'), ('ya_p02_ic_follow_up_studies'), ('ya_p02_ic_fracture_lower_body_last_3m'), ('ya_p02_ic_fracture_upper_body_last_3m'), ('ya_p02_ic_hand_grip'), ('ya_p02_ic_hearing_vision_impairment'), ('ya_p02_ic_heart_disease'), ('ya_p02_ic_hemoptysis_ns'), ('ya_p02_ic_hernia'), ('ya_p02_ic_hyperthyroidism'), ('ya_p02_ic_inability_hold_pencil'), ('ya_p02_ic_inability_stand_both_legs'), ('ya_p02_ic_inability_talk_cze'), ('ya_p02_ic_inability_walk'), ('ya_p02_ic_inbody'), ('ya_p02_ic_infectious_resp_diseases'), ('ya_p02_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p02_ic_knee_stability'), ('ya_p02_ic_nutri_qs'), ('ya_p02_ic_over_weight_200_height_195'), ('ya_p02_ic_pacemaker_defibrillator'), ('ya_p02_ic_pneumothorax'), ('ya_p02_ic_pregnancy'), ('ya_p02_ic_recent_eye_abdominal_chest_surgery'), ('ya_p02_ic_recent_myocardial_infarction'), ('ya_p02_ic_spirometry'), ('ya_p02_ic_surgical_metal_body'), ('ya_p02_ic_unstable_angina_pectoris'), ('ya_p02_ic_ya_dl_elspac'), ('ya_p02_ic_ya_med_find'), ('ya_p02_ic_ya_newsletter') $$ ) AS extra_state ("subject_id" int, "ya_p02_ic_anam_qs" text, "ya_p02_ic_aneurysm" text, "ya_p02_ic_anthropometry" text, "ya_p02_ic_arch_foot" text, "ya_p02_ic_basic_qs" text, "ya_p02_ic_blood_pressure" text, "ya_p02_ic_braces_piercing_iud" text, "ya_p02_ic_cognition_test" text, "ya_p02_ic_da_health_registry" text, "ya_p02_ic_dexa" text, "ya_p02_ic_enviro_qs" text, "ya_p02_ic_follow_up_studies" text, "ya_p02_ic_fracture_lower_body_last_3m" text, "ya_p02_ic_fracture_upper_body_last_3m" text, "ya_p02_ic_hand_grip" text, "ya_p02_ic_hearing_vision_impairment" text, "ya_p02_ic_heart_disease" text, "ya_p02_ic_hemoptysis_ns" text, "ya_p02_ic_hernia" text, "ya_p02_ic_hyperthyroidism" text, "ya_p02_ic_inability_hold_pencil" text, "ya_p02_ic_inability_stand_both_legs" text, "ya_p02_ic_inability_talk_cze" text, "ya_p02_ic_inability_walk" text, "ya_p02_ic_inbody" text, "ya_p02_ic_infectious_resp_diseases" text, "ya_p02_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p02_ic_knee_stability" text, "ya_p02_ic_nutri_qs" text, "ya_p02_ic_over_weight_200_height_195" text, "ya_p02_ic_pacemaker_defibrillator" text, "ya_p02_ic_pneumothorax" text, "ya_p02_ic_pregnancy" text, "ya_p02_ic_recent_eye_abdominal_chest_surgery" text, "ya_p02_ic_recent_myocardial_infarction" text, "ya_p02_ic_spirometry" text, "ya_p02_ic_surgical_metal_body" text, "ya_p02_ic_unstable_angina_pectoris" text, "ya_p02_ic_ya_dl_elspac" text, "ya_p02_ic_ya_med_find" text, "ya_p02_ic_ya_newsletter" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.psycap_p01_ya_p02__role, psc_role.psycap_p02_old_ya_p02__role, psc_role.ya_p02__role, psc_role.ya_p02_digi_ya03v2__role, psc_role.ya_p02_digi_ya04v2__role, psc_role.ya_p02_digi_ya05v2__role, psc_role.ya_p02_test__role, psc_state.psycap_p01_ya_p02__state, psc_state.psycap_p02_old_ya_p02__state, psc_state.ya_p02__state, psc_state.ya_p02_digi_ya03v2__state, psc_state.ya_p02_digi_ya04v2__state, psc_state.ya_p02_digi_ya05v2__state, psc_state.ya_p02_test__state, psc_activity_state.psycap_p01_ya_p02__activity_state, psc_activity_state.psycap_p02_old_ya_p02__activity_state, psc_activity_state.ya_p02__activity_state, psc_activity_state.ya_p02_digi_ya03v2__activity_state, psc_activity_state.ya_p02_digi_ya04v2__activity_state, psc_activity_state.ya_p02_digi_ya05v2__activity_state, psc_activity_state.ya_p02_test__activity_state, psc_created_at.psycap_p01_ya_p02__created_at, psc_created_at.psycap_p02_old_ya_p02__created_at, psc_created_at.ya_p02__created_at, psc_created_at.ya_p02_digi_ya03v2__created_at, psc_created_at.ya_p02_digi_ya04v2__created_at, psc_created_at.ya_p02_digi_ya05v2__created_at, psc_created_at.ya_p02_test__created_at, psc_accepted_at.psycap_p01_ya_p02__accepted_at, psc_accepted_at.psycap_p02_old_ya_p02__accepted_at, psc_accepted_at.ya_p02__accepted_at, psc_accepted_at.ya_p02_digi_ya03v2__accepted_at, psc_accepted_at.ya_p02_digi_ya04v2__accepted_at, psc_accepted_at.ya_p02_digi_ya05v2__accepted_at, psc_accepted_at.ya_p02_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p02__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p02__cancelled_at, psc_cancelled_at.ya_p02__cancelled_at, psc_cancelled_at.ya_p02_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p02_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p02_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p02__revoked_at, psc_revoked_at.psycap_p02_old_ya_p02__revoked_at, psc_revoked_at.ya_p02__revoked_at, psc_revoked_at.ya_p02_digi_ya03v2__revoked_at, psc_revoked_at.ya_p02_digi_ya04v2__revoked_at, psc_revoked_at.ya_p02_digi_ya05v2__revoked_at, psc_revoked_at.ya_p02_test__revoked_at, psc_paused_at.psycap_p01_ya_p02__paused_at, psc_paused_at.psycap_p02_old_ya_p02__paused_at, psc_paused_at.ya_p02__paused_at, psc_paused_at.ya_p02_digi_ya03v2__paused_at, psc_paused_at.ya_p02_digi_ya04v2__paused_at, psc_paused_at.ya_p02_digi_ya05v2__paused_at, psc_paused_at.ya_p02_test__paused_at, ya_p02_ic_buccal_swab_proband, ya_p02_ic_urine_proband, ya_p02_ic_venous_blood_proband, ya_p02_ic_anam_qs, ya_p02_ic_aneurysm, ya_p02_ic_anthropometry, ya_p02_ic_arch_foot, ya_p02_ic_basic_qs, ya_p02_ic_blood_pressure, ya_p02_ic_braces_piercing_iud, ya_p02_ic_cognition_test, ya_p02_ic_da_health_registry, ya_p02_ic_dexa, ya_p02_ic_enviro_qs, ya_p02_ic_follow_up_studies, ya_p02_ic_fracture_lower_body_last_3m, ya_p02_ic_fracture_upper_body_last_3m, ya_p02_ic_hand_grip, ya_p02_ic_hearing_vision_impairment, ya_p02_ic_heart_disease, ya_p02_ic_hemoptysis_ns, ya_p02_ic_hernia, ya_p02_ic_hyperthyroidism, ya_p02_ic_inability_hold_pencil, ya_p02_ic_inability_stand_both_legs, ya_p02_ic_inability_talk_cze, ya_p02_ic_inability_walk, ya_p02_ic_inbody, ya_p02_ic_infectious_resp_diseases, ya_p02_ic_iodine_barium_radioisotopes_last_7d, ya_p02_ic_knee_stability, ya_p02_ic_nutri_qs, ya_p02_ic_over_weight_200_height_195, ya_p02_ic_pacemaker_defibrillator, ya_p02_ic_pneumothorax, ya_p02_ic_pregnancy, ya_p02_ic_recent_eye_abdominal_chest_surgery, ya_p02_ic_recent_myocardial_infarction, ya_p02_ic_spirometry, ya_p02_ic_surgical_metal_body, ya_p02_ic_unstable_angina_pectoris, ya_p02_ic_ya_dl_elspac, ya_p02_ic_ya_med_find, ya_p02_ic_ya_newsletter FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 15 -- Pilot ID );
Date: 2025-12-05 05:02:24 Duration: 1s779ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
13 1s122ms 2s845ms 1s274ms 1,322 28m5s refresh materialized view core.mv_subject_form with data;Times Reported Time consuming queries #13
Day Hour Count Duration Avg duration Nov 30 05 10 12s248ms 1s224ms 06 10 12s168ms 1s216ms 07 10 12s340ms 1s234ms 08 10 12s951ms 1s295ms 09 10 12s504ms 1s250ms 10 10 12s434ms 1s243ms 11 10 12s654ms 1s265ms 12 10 12s843ms 1s284ms 13 10 12s741ms 1s274ms 14 10 11s926ms 1s192ms 15 10 12s588ms 1s258ms 16 10 12s364ms 1s236ms 17 9 12s226ms 1s358ms 18 10 12s286ms 1s228ms 19 10 12s322ms 1s232ms 20 10 12s665ms 1s266ms 21 10 12s493ms 1s249ms 22 10 12s371ms 1s237ms 23 10 15s540ms 1s554ms Dec 01 05 9 11s748ms 1s305ms 06 10 12s444ms 1s244ms 07 10 12s714ms 1s271ms 08 10 12s737ms 1s273ms 09 10 12s267ms 1s226ms 10 10 12s781ms 1s278ms 11 10 12s444ms 1s244ms 12 10 12s310ms 1s231ms 13 10 12s192ms 1s219ms 14 10 12s577ms 1s257ms 15 10 12s773ms 1s277ms 16 10 13s482ms 1s348ms 17 9 11s583ms 1s287ms 18 10 12s672ms 1s267ms 19 10 12s474ms 1s247ms 20 10 12s717ms 1s271ms 21 10 12s594ms 1s259ms 22 10 12s228ms 1s222ms 23 10 12s737ms 1s273ms Dec 02 05 9 11s487ms 1s276ms 06 10 13s11ms 1s301ms 07 10 12s577ms 1s257ms 08 10 12s888ms 1s288ms 09 10 12s458ms 1s245ms 10 10 13s208ms 1s320ms 11 10 12s651ms 1s265ms 12 10 12s421ms 1s242ms 13 10 12s878ms 1s287ms 14 10 12s818ms 1s281ms 15 10 12s393ms 1s239ms 16 10 12s792ms 1s279ms 17 10 12s594ms 1s259ms 18 10 12s322ms 1s232ms 19 10 12s261ms 1s226ms 20 10 12s281ms 1s228ms 21 10 12s743ms 1s274ms 22 10 12s774ms 1s277ms 23 10 13s239ms 1s323ms Dec 03 05 10 12s992ms 1s299ms 06 10 12s908ms 1s290ms 07 10 12s655ms 1s265ms 08 10 14s61ms 1s406ms 09 10 12s557ms 1s255ms 10 10 12s890ms 1s289ms 11 10 12s953ms 1s295ms 12 10 12s966ms 1s296ms 13 10 13s64ms 1s306ms 14 10 12s528ms 1s252ms 15 10 12s485ms 1s248ms 16 10 12s582ms 1s258ms 17 9 11s918ms 1s324ms 18 10 13s793ms 1s379ms 19 10 12s631ms 1s263ms 20 10 12s627ms 1s262ms 21 10 12s471ms 1s247ms 22 10 12s635ms 1s263ms 23 10 12s710ms 1s271ms Dec 04 05 10 12s602ms 1s260ms 06 10 13s271ms 1s327ms 07 10 12s217ms 1s221ms 08 10 12s774ms 1s277ms 09 10 14s274ms 1s427ms 10 10 12s838ms 1s283ms 11 10 12s917ms 1s291ms 12 10 13s492ms 1s349ms 13 10 13s359ms 1s335ms 14 10 12s593ms 1s259ms 15 10 12s205ms 1s220ms 16 10 13s441ms 1s344ms 17 10 13s1ms 1s300ms 18 10 12s344ms 1s234ms 19 10 12s626ms 1s262ms 20 10 12s698ms 1s269ms 21 10 14s210ms 1s421ms 22 10 12s639ms 1s263ms 23 10 13s219ms 1s321ms Dec 05 05 9 11s788ms 1s309ms 06 10 12s346ms 1s234ms 07 10 13s22ms 1s302ms 08 10 13s382ms 1s338ms 09 10 13s509ms 1s350ms 10 10 13s263ms 1s326ms 11 10 13s221ms 1s322ms 12 10 13s566ms 1s356ms 13 10 12s711ms 1s271ms 14 10 12s738ms 1s273ms 15 10 12s80ms 1s208ms 16 10 12s752ms 1s275ms 17 9 10s898ms 1s210ms 18 10 12s376ms 1s237ms 19 10 12s367ms 1s236ms 20 10 12s389ms 1s238ms 21 10 12s388ms 1s238ms 22 10 13s423ms 1s342ms 23 10 12s480ms 1s248ms Dec 06 05 10 12s577ms 1s257ms 06 10 13s181ms 1s318ms 07 10 12s582ms 1s258ms 08 10 12s923ms 1s292ms 09 10 12s281ms 1s228ms 10 10 12s358ms 1s235ms 11 10 12s293ms 1s229ms 12 10 12s724ms 1s272ms 13 10 12s176ms 1s217ms 14 10 12s237ms 1s223ms 15 10 13s506ms 1s350ms 16 10 13s128ms 1s312ms 17 9 11s140ms 1s237ms 18 10 12s110ms 1s211ms 19 10 12s219ms 1s221ms 20 10 12s15ms 1s201ms 21 10 12s546ms 1s254ms 22 10 12s784ms 1s278ms 23 10 12s621ms 1s262ms [ User: tng_migration_user - Total duration: 28m5s - Times executed: 1322 ]
[ Application: [unknown] - Total duration: 28m5s - Times executed: 1322 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-30 23:48:04 Duration: 2s845ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-12-04 21:42:04 Duration: 2s331ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-12-05 11:30:04 Duration: 2s326ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
14 1s188ms 1s619ms 1s274ms 14 17s841ms create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( with ranked_table_con as ( select *, row_number() over (partition by subject_id, type_code order by priority desc ) as ranked_row from "celspac"."core"."contact" where value -> ? = ?), ranked_table_contact as ( select *, row_number() over (partition by subject_id, type_code order by priority desc ) as ranked_row from "celspac"."core"."contact"), max_prio_perm as ( select * from ranked_table_con where ranked_row = ?), contact_table_max_prio as ( select * from ranked_table_contact where ranked_row = ?), contact_d as ( select distinct subject_id, replace((value -> ?)::text, ?, ? ) AS city, replace((value -> ?)::text, ?, ? ) as postal_code, replace((value -> ?)::text, ?, ? ) AS country, replace((value -> ?)::text, ?, ? ) as street, replace((value -> ?)::text, ?, ? ) AS street_number, replace((value -> ?)::text, ?, ? ) as permanent from max_prio_perm con where con.type_code = ?), contact_d_c as ( select distinct subject_id, replace((value -> ?)::text, ?, ? ) AS city, replace((value -> ?)::text, ?, ? ) as postal_code, replace((value -> ?)::text, ?, ? ) AS country, replace((value -> ?)::text, ?, ? ) as street, replace((value -> ?)::text, ?, ? ) AS street_number, replace((value -> ?)::text, ?, ? ) as permanent from contact_table_max_prio con where con.type_code = ?), con_email as ( select subject_id, replace(value::text, ?, ? ) AS email FROM contact_table_max_prio con WHERE con.type_code = ?), con_ph AS ( SELECT subject_id, replace(value::text, ?, ? ) as phone_number from contact_table_max_prio where type_code = ? ) select s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number as street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street as street_contact, con_d_c.street_number as street_number_contact, con_d_c.city as city_contact, con_d_c.postal_code as postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* from "celspac"."core"."subject" s left join "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se on se.subject_id = s.id left join "celspac"."core"."subject_dead" s_dead on s.id = s_dead.subject_id left join contact_d con_d on con_d.subject_id = s.id left join contact_d_c con_d_c on con_d_c.subject_id = s.id left join con_email c_e on c_e.subject_id = s.id left join con_ph c_p on c_p.subject_id = s.id );Times Reported Time consuming queries #14
Day Hour Count Duration Avg duration Nov 30 05 1 1s209ms 1s209ms 17 1 1s233ms 1s233ms Dec 01 05 1 1s269ms 1s269ms 17 1 1s223ms 1s223ms Dec 02 05 1 1s232ms 1s232ms 17 1 1s221ms 1s221ms Dec 03 05 1 1s382ms 1s382ms 17 1 1s210ms 1s210ms Dec 04 05 1 1s299ms 1s299ms 17 1 1s261ms 1s261ms Dec 05 05 1 1s619ms 1s619ms 17 1 1s188ms 1s188ms Dec 06 05 1 1s270ms 1s270ms 17 1 1s219ms 1s219ms [ User: tng_migration_user - Total duration: 17s841ms - Times executed: 14 ]
[ Application: dbt - Total duration: 17s841ms - Times executed: 14 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );
Date: 2025-12-05 05:02:20 Duration: 1s619ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );
Date: 2025-12-03 05:02:20 Duration: 1s382ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );
Date: 2025-12-04 05:02:19 Duration: 1s299ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
15 113ms 694ms 138ms 891 2m3s refresh materialized view core.mv_subject_event with data;Times Reported Time consuming queries #15
Day Hour Count Duration Avg duration Nov 30 06 7 1s113ms 159ms 07 7 1s317ms 188ms 08 7 917ms 131ms 09 7 979ms 139ms 10 7 881ms 125ms 11 7 1s162ms 166ms 12 7 966ms 138ms 13 7 959ms 137ms 14 7 944ms 134ms 15 7 979ms 139ms 16 7 962ms 137ms 17 7 1s 142ms 18 7 977ms 139ms 19 7 920ms 131ms 20 7 980ms 140ms 21 7 1s263ms 180ms 22 7 931ms 133ms 23 7 992ms 141ms Dec 01 06 7 945ms 135ms 07 7 911ms 130ms 08 7 913ms 130ms 09 7 943ms 134ms 10 7 929ms 132ms 11 7 906ms 129ms 12 7 970ms 138ms 13 7 1s232ms 176ms 14 7 997ms 142ms 15 7 983ms 140ms 16 7 1s285ms 183ms 17 7 985ms 140ms 18 7 926ms 132ms 19 7 937ms 133ms 20 7 909ms 129ms 21 7 930ms 132ms 22 7 949ms 135ms 23 7 928ms 132ms Dec 02 06 7 932ms 133ms 07 7 894ms 127ms 08 7 949ms 135ms 09 7 938ms 134ms 10 8 1s39ms 129ms 11 7 894ms 127ms 12 7 989ms 141ms 13 7 1s55ms 150ms 14 7 969ms 138ms 15 7 991ms 141ms 16 7 990ms 141ms 17 7 897ms 128ms 18 7 893ms 127ms 19 7 884ms 126ms 20 7 1s18ms 145ms 21 7 921ms 131ms 22 7 929ms 132ms 23 7 970ms 138ms Dec 03 06 7 875ms 125ms 07 7 951ms 135ms 08 7 982ms 140ms 09 9 1s257ms 139ms 10 7 939ms 134ms 11 8 1s 125ms 12 7 932ms 133ms 13 7 952ms 136ms 14 7 959ms 137ms 15 8 1s132ms 141ms 16 8 1s17ms 127ms 17 7 890ms 127ms 18 7 1s86ms 155ms 19 7 1s1ms 143ms 20 7 1s35ms 147ms 21 7 911ms 130ms 22 7 889ms 127ms 23 7 907ms 129ms Dec 04 06 7 1s26ms 146ms 07 7 914ms 130ms 08 7 987ms 141ms 09 7 947ms 135ms 10 7 940ms 134ms 11 7 1s67ms 152ms 12 7 943ms 134ms 13 8 1s23ms 127ms 14 7 989ms 141ms 15 7 904ms 129ms 16 7 1s112ms 158ms 17 7 939ms 134ms 18 7 954ms 136ms 19 7 1s520ms 217ms 20 7 895ms 127ms 21 7 866ms 123ms 22 7 959ms 137ms 23 7 946ms 135ms Dec 05 06 7 1s248ms 178ms 07 8 1s73ms 134ms 08 7 953ms 136ms 09 7 1s78ms 154ms 10 7 1s284ms 183ms 11 7 1s118ms 159ms 12 7 959ms 137ms 13 8 1s56ms 132ms 14 7 956ms 136ms 15 7 945ms 135ms 16 7 918ms 131ms 17 7 849ms 121ms 18 7 881ms 125ms 19 7 897ms 128ms 20 7 922ms 131ms 21 7 968ms 138ms 22 7 945ms 135ms 23 7 950ms 135ms Dec 06 06 7 887ms 126ms 07 7 889ms 127ms 08 7 942ms 134ms 09 7 939ms 134ms 10 7 880ms 125ms 11 7 902ms 128ms 12 7 960ms 137ms 13 7 878ms 125ms 14 7 918ms 131ms 15 7 942ms 134ms 16 7 1s174ms 167ms 17 7 922ms 131ms 18 7 874ms 124ms 19 7 874ms 124ms 20 7 911ms 130ms 21 7 890ms 127ms 22 7 886ms 126ms 23 7 993ms 141ms [ User: tng_migration_user - Total duration: 2m3s - Times executed: 891 ]
[ Application: [unknown] - Total duration: 2m3s - Times executed: 891 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-12-04 19:32:02 Duration: 694ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-30 07:14:02 Duration: 495ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-30 21:05:02 Duration: 477ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
16 30ms 275ms 81ms 1,040 1m24s with values as ( select label as value from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? group by label order by ? ) select value from values;Times Reported Time consuming queries #16
Day Hour Count Duration Avg duration Nov 30 05 80 6s723ms 84ms 17 80 6s824ms 85ms Dec 01 05 80 6s608ms 82ms 17 80 6s445ms 80ms Dec 02 05 80 6s520ms 81ms 17 80 6s856ms 85ms Dec 03 17 80 6s376ms 79ms Dec 04 05 80 6s408ms 80ms 17 80 6s137ms 76ms Dec 05 05 80 6s672ms 83ms 17 80 6s595ms 82ms Dec 06 05 80 6s356ms 79ms 17 80 6s234ms 77ms [ User: tng_migration_user - Total duration: 1m24s - Times executed: 1040 ]
[ Application: dbt - Total duration: 1m24s - Times executed: 1040 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-12-02 05:02:23 Duration: 275ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-12-02 17:02:23 Duration: 263ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-12-05 17:02:24 Duration: 256ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
17 30ms 272ms 76ms 1,014 1m17s with values as ( select label as value from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? group by label order by ? ) select value from values;Times Reported Time consuming queries #17
Day Hour Count Duration Avg duration Nov 30 05 78 5s536ms 70ms 17 78 6s311ms 80ms Dec 01 05 78 5s968ms 76ms 17 78 6s172ms 79ms Dec 02 05 78 6s1ms 76ms 17 78 6s187ms 79ms Dec 03 17 78 6s73ms 77ms Dec 04 05 78 5s668ms 72ms 17 78 5s589ms 71ms Dec 05 05 78 6s29ms 77ms 17 78 5s860ms 75ms Dec 06 05 78 5s973ms 76ms 17 78 5s844ms 74ms [ User: tng_migration_user - Total duration: 1m17s - Times executed: 1014 ]
[ Application: dbt - Total duration: 1m17s - Times executed: 1014 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-11-30 17:02:23 Duration: 272ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__21"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 21 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-12-01 17:02:25 Duration: 217ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__15"} */ WITH values AS ( SELECT label as value FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 15 GROUP BY label ORDER BY 1 ) SELECT value FROM values;
Date: 2025-12-04 05:02:21 Duration: 203ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
18 0ms 1s205ms 1ms 23,512 38s73ms commit;Times Reported Time consuming queries #18
Day Hour Count Duration Avg duration Nov 30 00 103 237ms 2ms 05 650 1s364ms 2ms 06 343 346ms 1ms 07 118 101ms 0ms 08 106 91ms 0ms 09 107 117ms 1ms 10 107 149ms 1ms 11 114 245ms 2ms 12 108 158ms 1ms 13 120 179ms 1ms 14 119 200ms 1ms 15 137 192ms 1ms 16 104 159ms 1ms 17 142 1s152ms 8ms 18 113 128ms 1ms 19 108 95ms 0ms 20 104 105ms 1ms 21 106 146ms 1ms 22 119 109ms 0ms 23 104 125ms 1ms Dec 01 00 100 200ms 2ms 05 470 991ms 2ms 06 381 343ms 0ms 07 122 125ms 1ms 08 137 143ms 1ms 09 284 315ms 1ms 10 167 178ms 1ms 11 115 136ms 1ms 12 126 122ms 0ms 13 141 139ms 0ms 14 164 229ms 1ms 15 117 117ms 1ms 16 147 175ms 1ms 17 142 781ms 5ms 18 333 306ms 0ms 19 136 172ms 1ms 20 138 198ms 1ms 21 122 123ms 1ms 22 111 126ms 1ms 23 128 145ms 1ms Dec 02 00 100 184ms 1ms 02 1 0ms 0ms 03 4 3ms 0ms 05 613 1s819ms 2ms 06 384 354ms 0ms 07 130 135ms 1ms 08 164 159ms 0ms 09 173 180ms 1ms 10 157 174ms 1ms 11 123 122ms 0ms 12 145 149ms 1ms 13 132 163ms 1ms 14 130 151ms 1ms 15 132 138ms 1ms 16 128 142ms 1ms 17 168 561ms 3ms 18 123 126ms 1ms 19 104 101ms 0ms 20 104 121ms 1ms 21 116 139ms 1ms 22 104 123ms 1ms 23 110 125ms 1ms Dec 03 00 100 152ms 1ms 02 7 11ms 1ms 05 548 980ms 1ms 06 362 315ms 0ms 07 203 199ms 0ms 08 168 191ms 1ms 09 323 339ms 1ms 10 227 218ms 0ms 11 176 190ms 1ms 12 174 186ms 1ms 13 168 167ms 0ms 14 163 194ms 1ms 15 143 135ms 0ms 16 131 154ms 1ms 17 153 1s933ms 12ms 18 114 133ms 1ms 19 115 128ms 1ms 20 119 139ms 1ms 21 104 128ms 1ms 22 124 125ms 1ms 23 132 132ms 1ms Dec 04 00 100 224ms 2ms 05 639 1s205ms 1ms 06 395 376ms 0ms 07 106 100ms 0ms 08 223 235ms 1ms 09 172 198ms 1ms 10 170 250ms 1ms 11 136 191ms 1ms 12 144 181ms 1ms 13 149 176ms 1ms 14 148 172ms 1ms 15 125 134ms 1ms 16 148 205ms 1ms 17 147 1s845ms 12ms 18 111 118ms 1ms 19 104 121ms 1ms 20 104 127ms 1ms 21 111 135ms 1ms 22 104 135ms 1ms 23 121 124ms 1ms Dec 05 00 103 197ms 1ms 05 619 1s158ms 1ms 06 388 351ms 0ms 07 134 157ms 1ms 08 118 125ms 1ms 09 125 179ms 1ms 10 185 545ms 2ms 11 154 168ms 1ms 12 140 171ms 1ms 13 125 117ms 0ms 14 111 119ms 1ms 15 111 112ms 1ms 16 104 120ms 1ms 17 149 825ms 5ms 18 120 127ms 1ms 19 122 125ms 1ms 20 110 118ms 1ms 21 104 144ms 1ms 22 104 126ms 1ms 23 112 117ms 1ms Dec 06 00 103 259ms 2ms 05 648 1s13ms 1ms 06 413 381ms 0ms 07 104 97ms 0ms 08 115 104ms 0ms 09 110 102ms 0ms 10 107 97ms 0ms 11 107 95ms 0ms 12 113 111ms 0ms 13 111 98ms 0ms 14 114 113ms 0ms 15 104 190ms 1ms 16 104 315ms 3ms 17 152 1s177ms 7ms 18 130 135ms 1ms 19 112 108ms 0ms 20 113 112ms 0ms 21 111 119ms 1ms 22 111 113ms 1ms 23 123 130ms 1ms [ User: tng_migration_user - Total duration: 38s73ms - Times executed: 23512 ]
[ Application: [unknown] - Total duration: 27s948ms - Times executed: 22888 ]
[ Application: dbt - Total duration: 10s125ms - Times executed: 624 ]
-
COMMIT;
Date: 2025-12-04 17:02:21 Duration: 1s205ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
COMMIT;
Date: 2025-12-06 17:02:28 Duration: 704ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
-
COMMIT;
Date: 2025-12-02 05:02:23 Duration: 630ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
19 0ms 54ms 1ms 18,421 25s568ms select string_agg(s0_.name::text, ?) as sclr_0 from core.subject_inform_consent s1_ left join core.subcohort_inform_consent s2_ on s1_.subcohort_inform_consent_id = s2_.id left join core.subcohort s0_ on s2_.subcohort_id = s0_.id left join core.pilot p3_ on s0_.pilot_id = p3_.id left join core.cohort c4_ on p3_.cohort_id = c4_.id where s1_.subject_about_id = ? and p3_.default_subcohort_id = s2_.subcohort_id and s0_.inform_consent_id = s2_.info_consent_id group by s1_.subject_about_id;Times Reported Time consuming queries #19
Day Hour Count Duration Avg duration Nov 30 15 100 128ms 1ms Dec 01 06 100 125ms 1ms 07 298 600ms 2ms 08 412 564ms 1ms 09 634 866ms 1ms 10 733 1s31ms 1ms 11 1,247 1s666ms 1ms 12 857 1s240ms 1ms 13 103 130ms 1ms 14 124 173ms 1ms 15 101 141ms 1ms 23 305 383ms 1ms Dec 02 06 205 280ms 1ms 07 839 1s132ms 1ms 08 977 1s341ms 1ms 09 228 313ms 1ms 10 259 342ms 1ms 11 317 435ms 1ms 12 550 786ms 1ms 13 342 468ms 1ms 14 103 146ms 1ms 15 101 126ms 1ms Dec 03 06 102 133ms 1ms 07 113 148ms 1ms 08 1,061 1s440ms 1ms 09 1,041 1s400ms 1ms 10 200 254ms 1ms 11 1,565 2s83ms 1ms 12 369 516ms 1ms 13 102 128ms 1ms 14 212 285ms 1ms 15 4 6ms 1ms Dec 04 07 121 186ms 1ms 08 335 453ms 1ms 09 573 797ms 1ms 10 342 453ms 1ms 11 11 20ms 1ms 12 202 267ms 1ms 13 303 398ms 1ms 14 100 127ms 1ms 15 208 282ms 1ms 16 117 177ms 1ms Dec 05 07 365 668ms 1ms 08 220 357ms 1ms 09 223 323ms 1ms 10 333 488ms 1ms 11 302 403ms 1ms 12 100 132ms 1ms 13 680 956ms 1ms 14 182 249ms 1ms [ User: tng_migration_user - Total duration: 25s568ms - Times executed: 18421 ]
[ Application: [unknown] - Total duration: 25s568ms - Times executed: 18421 ]
-
SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = '48865' AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;
Date: 2025-12-05 07:20:35 Duration: 54ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = '43359' AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;
Date: 2025-12-05 08:08:23 Duration: 48ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = '2603' AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;
Date: 2025-12-04 15:39:14 Duration: 8ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
20 0ms 4ms 0ms 154,674 1m26s select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.subject_subcohort_id as subject_subcohort_id_11, m0_.form_structure_variant_id as form_structure_variant_id_12, m0_.form_id as form_id_13, m0_.form_state_code as form_state_code_14 from core.mv_subject_form m0_ where m0_.form_structure_variant_id in (...) and m0_.form_id is null and m0_.result_date <= ? and m0_.use_alternative <> ?;Times Reported Time consuming queries #20
Day Hour Count Duration Avg duration Nov 30 05 1,170 636ms 0ms 06 1,170 642ms 0ms 07 1,170 658ms 0ms 08 1,170 668ms 0ms 09 1,170 654ms 0ms 10 1,170 646ms 0ms 11 1,170 670ms 0ms 12 1,170 680ms 0ms 13 1,170 651ms 0ms 14 1,170 627ms 0ms 15 1,170 644ms 0ms 16 1,170 655ms 0ms 17 1,053 587ms 0ms 18 1,170 648ms 0ms 19 1,170 634ms 0ms 20 1,170 644ms 0ms 21 1,170 627ms 0ms 22 1,170 651ms 0ms 23 1,170 623ms 0ms Dec 01 05 1,053 578ms 0ms 06 1,170 660ms 0ms 07 1,170 687ms 0ms 08 1,170 674ms 0ms 09 1,170 658ms 0ms 10 1,170 645ms 0ms 11 1,170 671ms 0ms 12 1,170 644ms 0ms 13 1,170 649ms 0ms 14 1,170 666ms 0ms 15 1,170 660ms 0ms 16 1,170 661ms 0ms 17 1,053 608ms 0ms 18 1,170 655ms 0ms 19 1,170 658ms 0ms 20 1,170 658ms 0ms 21 1,170 663ms 0ms 22 1,170 664ms 0ms 23 1,170 661ms 0ms Dec 02 05 1,053 573ms 0ms 06 1,170 635ms 0ms 07 1,170 641ms 0ms 08 1,170 679ms 0ms 09 1,170 665ms 0ms 10 1,170 696ms 0ms 11 1,170 668ms 0ms 12 1,170 651ms 0ms 13 1,170 654ms 0ms 14 1,170 640ms 0ms 15 1,170 643ms 0ms 16 1,170 704ms 0ms 17 1,170 647ms 0ms 18 1,170 651ms 0ms 19 1,170 640ms 0ms 20 1,170 625ms 0ms 21 1,170 635ms 0ms 22 1,170 664ms 0ms 23 1,170 685ms 0ms Dec 03 05 1,170 652ms 0ms 06 1,170 669ms 0ms 07 1,170 652ms 0ms 08 1,170 667ms 0ms 09 1,170 632ms 0ms 10 1,170 667ms 0ms 11 1,170 668ms 0ms 12 1,170 690ms 0ms 13 1,170 651ms 0ms 14 1,170 646ms 0ms 15 1,170 640ms 0ms 16 1,170 681ms 0ms 17 1,053 583ms 0ms 18 1,170 674ms 0ms 19 1,170 625ms 0ms 20 1,170 639ms 0ms 21 1,170 629ms 0ms 22 1,170 646ms 0ms 23 1,170 657ms 0ms Dec 04 05 1,170 632ms 0ms 06 1,170 698ms 0ms 07 1,170 665ms 0ms 08 1,170 650ms 0ms 09 1,170 668ms 0ms 10 1,170 657ms 0ms 11 1,170 673ms 0ms 12 1,170 679ms 0ms 13 1,170 658ms 0ms 14 1,170 674ms 0ms 15 1,170 680ms 0ms 16 1,170 689ms 0ms 17 1,170 636ms 0ms 18 1,170 649ms 0ms 19 1,170 638ms 0ms 20 1,170 667ms 0ms 21 1,170 652ms 0ms 22 1,170 666ms 0ms 23 1,170 689ms 0ms Dec 05 05 1,053 600ms 0ms 06 1,170 659ms 0ms 07 1,170 642ms 0ms 08 1,170 661ms 0ms 09 1,170 638ms 0ms 10 1,170 647ms 0ms 11 1,170 645ms 0ms 12 1,170 651ms 0ms 13 1,170 638ms 0ms 14 1,170 645ms 0ms 15 1,170 663ms 0ms 16 1,170 655ms 0ms 17 1,053 585ms 0ms 18 1,170 664ms 0ms 19 1,170 667ms 0ms 20 1,170 652ms 0ms 21 1,170 670ms 0ms 22 1,170 663ms 0ms 23 1,170 652ms 0ms Dec 06 05 1,170 642ms 0ms 06 1,170 643ms 0ms 07 1,170 642ms 0ms 08 1,170 646ms 0ms 09 1,170 647ms 0ms 10 1,170 680ms 0ms 11 1,170 655ms 0ms 12 1,170 650ms 0ms 13 1,170 641ms 0ms 14 1,170 653ms 0ms 15 1,170 647ms 0ms 16 1,170 637ms 0ms 17 1,053 584ms 0ms 18 1,170 659ms 0ms 19 1,170 661ms 0ms 20 1,170 647ms 0ms 21 1,170 679ms 0ms 22 1,170 658ms 0ms 23 1,170 655ms 0ms [ User: tng_migration_user - Total duration: 1m26s - Times executed: 154674 ]
[ Application: [unknown] - Total duration: 1m26s - Times executed: 154674 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('82') AND m0_.form_id IS NULL AND m0_.result_date <= '2021-12-17 09:00:01' AND m0_.use_alternative <> 't';
Date: 2025-12-01 09:00:03 Duration: 4ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('83') AND m0_.form_id IS NULL AND m0_.result_date <= '2020-12-20 14:54:01' AND m0_.use_alternative <> 't';
Date: 2025-12-04 14:54:03 Duration: 4ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('86') AND m0_.form_id IS NULL AND m0_.result_date <= '2021-12-20 16:06:01' AND m0_.use_alternative <> 't';
Date: 2025-12-04 16:06:03 Duration: 4ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
Time consuming prepare
Rank Total duration Times executed Min duration Max duration Avg duration Query 1 1m41s 134,962 0ms 85ms 0ms SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;Times Reported Time consuming prepare #1
Day Hour Count Duration Avg duration Dec 06 04 313 264ms 0ms 05 360 296ms 0ms 06 360 297ms 0ms 07 360 282ms 0ms 08 360 282ms 0ms 09 360 284ms 0ms 10 360 286ms 0ms 11 360 291ms 0ms 12 360 293ms 0ms 13 360 302ms 0ms 14 360 292ms 0ms 15 360 302ms 0ms 16 360 287ms 0ms 17 360 287ms 0ms 18 360 291ms 0ms 19 360 278ms 0ms 20 360 279ms 0ms 21 360 284ms 0ms 22 360 290ms 0ms 23 360 287ms 0ms Dec 06 00 360 313ms 0ms 01 360 293ms 0ms 02 360 302ms 0ms 03 360 303ms 0ms 04 702 611ms 0ms 05 720 603ms 0ms 06 720 602ms 0ms 07 720 614ms 0ms 08 720 617ms 0ms 09 720 598ms 0ms 10 720 612ms 0ms 11 720 614ms 0ms 12 720 616ms 0ms 13 720 597ms 0ms 14 720 605ms 0ms 15 720 627ms 0ms 16 720 608ms 0ms 17 720 585ms 0ms 18 720 601ms 0ms 19 720 599ms 0ms 20 720 611ms 0ms 21 720 602ms 0ms 22 720 604ms 0ms 23 676 559ms 0ms Dec 06 00 360 317ms 0ms 01 360 315ms 0ms 02 360 316ms 0ms 03 360 311ms 0ms 04 688 575ms 0ms 05 720 640ms 0ms 06 720 617ms 0ms 07 720 619ms 0ms 08 720 609ms 0ms 09 720 609ms 0ms 10 720 617ms 0ms 11 718 632ms 0ms 12 720 630ms 0ms 13 720 623ms 0ms 14 720 605ms 0ms 15 720 627ms 0ms 16 720 637ms 0ms 17 720 612ms 0ms 18 720 597ms 0ms 19 720 616ms 0ms 20 720 610ms 0ms 21 720 619ms 0ms 22 720 613ms 0ms 23 720 604ms 0ms Dec 06 00 360 305ms 0ms 01 360 306ms 0ms 02 360 307ms 0ms 03 360 299ms 0ms 04 683 576ms 0ms 05 720 598ms 0ms 06 720 638ms 0ms 07 720 618ms 0ms 08 720 656ms 0ms 09 720 637ms 0ms 10 720 625ms 0ms 11 720 622ms 0ms 12 720 624ms 0ms 13 720 614ms 0ms 14 720 622ms 0ms 15 720 618ms 0ms 16 720 635ms 0ms 17 720 640ms 0ms 18 720 651ms 0ms 19 720 629ms 0ms 20 720 665ms 0ms 21 720 641ms 0ms 22 720 644ms 0ms 23 720 621ms 0ms Dec 06 00 360 319ms 0ms 01 360 322ms 0ms 02 360 328ms 0ms 03 360 312ms 0ms 04 678 583ms 0ms 05 720 655ms 0ms 06 720 655ms 0ms 07 720 643ms 0ms 08 720 642ms 0ms 09 720 654ms 0ms 10 720 637ms 0ms 11 720 619ms 0ms 12 720 635ms 0ms 13 720 653ms 0ms 14 720 656ms 0ms 15 720 661ms 0ms 16 720 643ms 0ms 17 720 620ms 0ms 18 720 826ms 1ms 19 720 538ms 0ms 20 720 566ms 0ms 21 720 558ms 0ms 22 720 558ms 0ms 23 720 555ms 0ms Dec 06 00 360 283ms 0ms 01 360 280ms 0ms 02 360 284ms 0ms 03 360 284ms 0ms 04 673 550ms 0ms 05 720 559ms 0ms 06 718 511ms 0ms 07 720 451ms 0ms 08 720 453ms 0ms 09 720 452ms 0ms 10 720 432ms 0ms 11 720 441ms 0ms 12 720 464ms 0ms 13 720 428ms 0ms 14 720 456ms 0ms 15 720 455ms 0ms 16 720 450ms 0ms 17 720 462ms 0ms 18 720 454ms 0ms 19 720 459ms 0ms 20 720 468ms 0ms 21 720 478ms 0ms 22 720 457ms 0ms 23 720 474ms 0ms Dec 06 00 360 238ms 0ms 01 360 236ms 0ms 02 360 231ms 0ms 03 360 231ms 0ms 04 984 662ms 0ms 05 1,080 669ms 0ms 06 1,080 700ms 0ms 07 1,080 681ms 0ms 08 1,080 690ms 0ms 09 1,080 693ms 0ms 10 1,080 656ms 0ms 11 1,080 681ms 0ms 12 1,080 698ms 0ms 13 1,080 705ms 0ms 14 1,080 688ms 0ms 15 1,080 664ms 0ms 16 1,080 687ms 0ms 17 1,080 671ms 0ms 18 1,080 695ms 0ms 19 1,080 688ms 0ms 20 1,080 678ms 0ms 21 1,080 715ms 0ms 22 1,080 704ms 0ms 23 1,080 691ms 0ms Dec 06 00 720 471ms 0ms 01 720 467ms 0ms 02 720 468ms 0ms 03 720 457ms 0ms 04 1,032 694ms 0ms 05 1,080 676ms 0ms 06 1,080 695ms 0ms 07 1,080 672ms 0ms 08 1,080 692ms 0ms 09 1,080 665ms 0ms 10 1,080 677ms 0ms 11 1,080 651ms 0ms 12 1,080 716ms 0ms 13 1,080 679ms 0ms 14 1,080 665ms 0ms 15 1,080 680ms 0ms 16 1,080 691ms 0ms 17 1,080 673ms 0ms 18 1,080 690ms 0ms 19 1,080 673ms 0ms 20 1,080 706ms 0ms 21 1,080 710ms 0ms 22 1,080 700ms 0ms 23 1,080 694ms 0ms Dec 06 00 359 230ms 0ms 01 360 234ms 0ms 02 360 233ms 0ms 03 360 227ms 0ms 04 18 10ms 0ms [ User: tng_migration_user - Total duration: 16s372ms - Times executed: 134962 ]
[ Application: [unknown] - Total duration: 16s372ms - Times executed: 134962 ]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-12-03 18:53:25 Duration: 85ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-12-03 18:53:42 Duration: 18ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-30 00:01:42 Duration: 13ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
2 1m5s 148,153 0ms 32ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = $1 LIMIT 1;Times Reported Time consuming prepare #2
Day Hour Count Duration Avg duration 03 313 152ms 0ms 04 360 169ms 0ms 05 578 190ms 0ms 06 390 168ms 0ms 07 390 172ms 0ms 08 390 170ms 0ms 09 390 173ms 0ms 10 390 178ms 0ms 11 390 177ms 0ms 12 390 182ms 0ms 13 390 178ms 0ms 14 390 183ms 0ms 15 390 174ms 0ms 16 386 176ms 0ms 17 390 177ms 0ms 18 390 171ms 0ms 19 390 170ms 0ms 20 390 174ms 0ms 21 390 180ms 0ms 22 390 180ms 0ms 23 360 168ms 0ms 00 360 164ms 0ms 01 360 168ms 0ms 02 360 167ms 0ms 03 702 345ms 0ms 04 720 338ms 0ms 05 1,228 375ms 0ms 06 780 363ms 0ms 07 780 362ms 0ms 08 780 353ms 0ms 09 780 365ms 0ms 10 780 363ms 0ms 11 780 360ms 0ms 12 780 353ms 0ms 13 780 357ms 0ms 14 780 366ms 0ms 15 780 360ms 0ms 16 772 347ms 0ms 17 780 358ms 0ms 18 780 351ms 0ms 19 780 366ms 0ms 20 780 364ms 0ms 21 780 356ms 0ms 22 736 333ms 0ms 23 360 175ms 0ms 00 360 177ms 0ms 01 360 175ms 0ms 02 360 170ms 0ms 03 688 320ms 0ms 04 720 367ms 0ms 05 1,104 378ms 0ms 06 780 363ms 0ms 07 780 352ms 0ms 08 780 357ms 0ms 09 780 366ms 0ms 10 778 369ms 0ms 11 780 363ms 0ms 12 780 367ms 0ms 13 780 355ms 0ms 14 780 367ms 0ms 15 780 375ms 0ms 16 772 367ms 0ms 17 972 374ms 0ms 18 780 371ms 0ms 19 780 375ms 0ms 20 780 384ms 0ms 21 780 379ms 0ms 22 780 374ms 0ms 23 360 177ms 0ms 00 360 175ms 0ms 01 360 176ms 0ms 02 360 172ms 0ms 03 683 327ms 0ms 04 720 330ms 0ms 05 1,276 402ms 0ms 06 780 362ms 0ms 07 784 382ms 0ms 08 780 367ms 0ms 09 780 361ms 0ms 10 780 364ms 0ms 11 780 361ms 0ms 12 780 358ms 0ms 13 780 362ms 0ms 14 780 361ms 0ms 15 780 371ms 0ms 16 774 370ms 0ms 17 792 376ms 0ms 18 780 364ms 0ms 19 780 387ms 0ms 20 780 370ms 0ms 21 780 378ms 0ms 22 780 366ms 0ms 23 360 174ms 0ms 00 360 175ms 0ms 01 360 181ms 0ms 02 360 170ms 0ms 03 678 322ms 0ms 04 720 358ms 0ms 05 1,224 398ms 0ms 06 784 365ms 0ms 07 780 373ms 0ms 08 782 379ms 0ms 09 784 368ms 0ms 10 780 354ms 0ms 11 780 370ms 0ms 12 784 369ms 0ms 13 780 376ms 0ms 14 780 375ms 0ms 15 780 366ms 0ms 16 772 367ms 0ms 17 784 472ms 0ms 18 780 341ms 0ms 19 780 353ms 0ms 20 780 355ms 0ms 21 780 352ms 0ms 22 780 357ms 0ms 23 360 167ms 0ms 00 360 165ms 0ms 01 360 168ms 0ms 02 360 167ms 0ms 03 673 324ms 0ms 04 720 353ms 0ms 05 1,310 393ms 0ms 06 780 341ms 0ms 07 780 345ms 0ms 08 780 345ms 0ms 09 784 325ms 0ms 10 780 335ms 0ms 11 780 349ms 0ms 12 780 320ms 0ms 13 780 342ms 0ms 14 780 345ms 0ms 15 780 336ms 0ms 16 774 334ms 0ms 17 780 328ms 0ms 18 780 334ms 0ms 19 780 341ms 0ms 20 780 348ms 0ms 21 780 338ms 0ms 22 780 350ms 0ms 23 360 164ms 0ms 00 360 162ms 0ms 01 360 157ms 0ms 02 360 156ms 0ms 03 984 450ms 0ms 04 1,080 455ms 0ms 05 1,806 531ms 0ms 06 1,173 494ms 0ms 07 1,170 511ms 0ms 08 1,170 506ms 0ms 09 1,176 480ms 0ms 10 1,170 494ms 0ms 11 1,170 507ms 0ms 12 1,170 517ms 0ms 13 1,170 503ms 0ms 14 1,170 486ms 0ms 15 1,170 498ms 0ms 16 1,158 487ms 0ms 17 1,170 505ms 0ms 18 1,170 497ms 0ms 19 1,170 497ms 0ms 20 1,170 522ms 0ms 21 1,170 508ms 0ms 22 1,170 510ms 0ms 23 720 319ms 0ms 00 720 314ms 0ms 01 720 316ms 0ms 02 720 314ms 0ms 03 1,032 475ms 0ms 04 1,080 460ms 0ms 05 1,938 546ms 0ms 06 1,170 487ms 0ms 07 1,170 504ms 0ms 08 1,170 491ms 0ms 09 1,170 495ms 0ms 10 1,170 474ms 0ms 11 1,170 519ms 0ms 12 1,170 488ms 0ms 13 1,170 481ms 0ms 14 1,170 490ms 0ms 15 1,170 504ms 0ms 16 1,158 487ms 0ms 17 1,170 508ms 0ms 18 1,170 493ms 0ms 19 1,170 515ms 0ms 20 1,170 520ms 0ms 21 1,170 516ms 0ms 22 1,170 519ms 0ms 23 359 158ms 0ms 00 360 160ms 0ms 01 360 159ms 0ms 02 360 157ms 0ms 03 18 7ms 0ms [ User: tng_migration_user - Total duration: 1s837ms - Times executed: 148153 ]
[ Application: [unknown] - Total duration: 1s837ms - Times executed: 148153 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-12-03 18:52:25 Duration: 32ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-12-03 18:53:42 Duration: 19ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-12-01 05:02:25 Duration: 14ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
3 51s743ms 1,008,966 0ms 7ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = $1;Times Reported Time consuming prepare #3
Day Hour Count Duration Avg duration 03 2,191 114ms 0ms 04 2,527 129ms 0ms 05 2,737 142ms 0ms 06 2,730 135ms 0ms 07 2,730 137ms 0ms 08 2,730 134ms 0ms 09 2,730 136ms 0ms 10 2,730 138ms 0ms 11 2,730 137ms 0ms 12 2,730 140ms 0ms 13 2,730 137ms 0ms 14 2,730 139ms 0ms 15 2,730 137ms 0ms 16 2,702 137ms 0ms 17 2,730 138ms 0ms 18 2,730 136ms 0ms 19 2,730 135ms 0ms 20 2,730 136ms 0ms 21 2,730 139ms 0ms 22 2,730 140ms 0ms 23 2,520 129ms 0ms 00 2,520 128ms 0ms 01 2,520 129ms 0ms 02 2,520 129ms 0ms 03 4,914 258ms 0ms 04 5,054 262ms 0ms 05 5,474 279ms 0ms 06 5,460 284ms 0ms 07 5,460 281ms 0ms 08 5,460 276ms 0ms 09 5,460 282ms 0ms 10 5,460 280ms 0ms 11 5,460 281ms 0ms 12 5,460 278ms 0ms 13 5,460 283ms 0ms 14 5,460 280ms 0ms 15 5,460 281ms 0ms 16 5,404 272ms 0ms 17 5,460 276ms 0ms 18 5,460 274ms 0ms 19 5,460 283ms 0ms 20 5,460 279ms 0ms 21 5,460 279ms 0ms 22 5,152 260ms 0ms 23 2,520 130ms 0ms 00 2,520 131ms 0ms 01 2,520 131ms 0ms 02 2,520 129ms 0ms 03 4,816 245ms 0ms 04 5,054 256ms 0ms 05 5,474 280ms 0ms 06 5,460 278ms 0ms 07 5,460 274ms 0ms 08 5,460 277ms 0ms 09 5,460 280ms 0ms 10 5,446 280ms 0ms 11 5,460 280ms 0ms 12 5,460 281ms 0ms 13 5,460 274ms 0ms 14 5,460 280ms 0ms 15 5,460 284ms 0ms 16 5,404 277ms 0ms 17 5,474 275ms 0ms 18 5,460 277ms 0ms 19 5,460 280ms 0ms 20 5,460 282ms 0ms 21 5,460 281ms 0ms 22 5,460 279ms 0ms 23 2,520 129ms 0ms 00 2,520 129ms 0ms 01 2,520 128ms 0ms 02 2,520 127ms 0ms 03 4,781 245ms 0ms 04 5,054 256ms 0ms 05 5,474 286ms 0ms 06 5,460 279ms 0ms 07 5,474 286ms 0ms 08 5,460 282ms 0ms 09 5,460 283ms 0ms 10 5,460 283ms 0ms 11 5,460 279ms 0ms 12 5,460 280ms 0ms 13 5,460 282ms 0ms 14 5,460 280ms 0ms 15 5,460 285ms 0ms 16 5,418 281ms 0ms 17 5,474 288ms 0ms 18 5,460 285ms 0ms 19 5,460 289ms 0ms 20 5,460 292ms 0ms 21 5,460 289ms 0ms 22 5,460 280ms 0ms 23 2,520 131ms 0ms 00 2,520 132ms 0ms 01 2,520 134ms 0ms 02 2,520 131ms 0ms 03 4,746 247ms 0ms 04 5,054 278ms 0ms 05 5,474 306ms 0ms 06 5,474 295ms 0ms 07 5,460 300ms 0ms 08 5,474 304ms 0ms 09 5,474 300ms 0ms 10 5,460 293ms 0ms 11 5,460 302ms 0ms 12 5,474 299ms 0ms 13 5,460 301ms 0ms 14 5,460 298ms 0ms 15 5,460 296ms 0ms 16 5,404 296ms 0ms 17 5,474 318ms 0ms 18 5,460 274ms 0ms 19 5,460 280ms 0ms 20 5,460 281ms 0ms 21 5,460 278ms 0ms 22 5,460 279ms 0ms 23 2,520 128ms 0ms 00 2,520 128ms 0ms 01 2,520 130ms 0ms 02 2,520 129ms 0ms 03 4,711 248ms 0ms 04 5,054 273ms 0ms 05 5,460 297ms 0ms 06 5,460 273ms 0ms 07 5,460 280ms 0ms 08 5,460 279ms 0ms 09 5,474 271ms 0ms 10 5,460 273ms 0ms 11 5,460 279ms 0ms 12 5,460 270ms 0ms 13 5,474 281ms 0ms 14 5,460 277ms 0ms 15 5,460 274ms 0ms 16 5,418 274ms 0ms 17 5,460 271ms 0ms 18 5,460 274ms 0ms 19 5,460 280ms 0ms 20 5,460 279ms 0ms 21 5,460 277ms 0ms 22 5,460 279ms 0ms 23 2,520 129ms 0ms 00 2,520 129ms 0ms 01 2,520 126ms 0ms 02 2,520 126ms 0ms 03 6,888 358ms 0ms 04 7,581 376ms 0ms 05 8,211 410ms 0ms 06 8,211 411ms 0ms 07 8,190 411ms 0ms 08 8,190 413ms 0ms 09 8,211 402ms 0ms 10 8,190 409ms 0ms 11 8,190 412ms 0ms 12 8,190 412ms 0ms 13 8,190 409ms 0ms 14 8,190 406ms 0ms 15 8,190 408ms 0ms 16 8,106 407ms 0ms 17 8,190 414ms 0ms 18 8,190 410ms 0ms 19 8,190 413ms 0ms 20 8,190 422ms 0ms 21 8,190 417ms 0ms 22 8,190 417ms 0ms 23 5,040 257ms 0ms 00 5,040 253ms 0ms 01 5,040 255ms 0ms 02 5,040 255ms 0ms 03 7,224 381ms 0ms 04 7,581 379ms 0ms 05 8,211 416ms 0ms 06 8,190 408ms 0ms 07 8,190 415ms 0ms 08 8,190 411ms 0ms 09 8,190 405ms 0ms 10 8,190 403ms 0ms 11 8,190 423ms 0ms 12 8,190 403ms 0ms 13 8,190 404ms 0ms 14 8,190 406ms 0ms 15 8,190 417ms 0ms 16 8,106 406ms 0ms 17 8,190 409ms 0ms 18 8,190 408ms 0ms 19 8,190 417ms 0ms 20 8,190 420ms 0ms 21 8,190 422ms 0ms 22 8,190 417ms 0ms 23 2,513 128ms 0ms 00 2,520 127ms 0ms 01 2,520 127ms 0ms 02 2,520 128ms 0ms 03 126 6ms 0ms [ User: tng_migration_user - Total duration: 19s312ms - Times executed: 1008966 ]
[ Application: [unknown] - Total duration: 19s312ms - Times executed: 1008966 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = $1;
Date: 2025-12-04 06:43:01 Duration: 7ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = $1;
Date: 2025-12-03 18:52:25 Duration: 7ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = $1;
Date: 2025-12-03 18:53:42 Duration: 3ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
4 28s549ms 134,962 0ms 21ms 0ms SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;Times Reported Time consuming prepare #4
Day Hour Count Duration Avg duration 03 313 70ms 0ms 04 360 79ms 0ms 05 360 79ms 0ms 06 360 74ms 0ms 07 360 74ms 0ms 08 360 73ms 0ms 09 360 75ms 0ms 10 360 77ms 0ms 11 360 77ms 0ms 12 360 79ms 0ms 13 360 77ms 0ms 14 360 79ms 0ms 15 360 76ms 0ms 16 360 78ms 0ms 17 360 77ms 0ms 18 360 73ms 0ms 19 360 73ms 0ms 20 360 76ms 0ms 21 360 77ms 0ms 22 360 77ms 0ms 23 360 76ms 0ms 00 360 78ms 0ms 01 360 78ms 0ms 02 360 77ms 0ms 03 702 158ms 0ms 04 720 158ms 0ms 05 720 153ms 0ms 06 720 160ms 0ms 07 720 161ms 0ms 08 720 155ms 0ms 09 720 157ms 0ms 10 720 160ms 0ms 11 720 156ms 0ms 12 720 153ms 0ms 13 720 153ms 0ms 14 720 161ms 0ms 15 720 158ms 0ms 16 720 148ms 0ms 17 720 156ms 0ms 18 720 154ms 0ms 19 720 158ms 0ms 20 720 153ms 0ms 21 720 155ms 0ms 22 676 143ms 0ms 23 360 80ms 0ms 00 360 81ms 0ms 01 360 80ms 0ms 02 360 80ms 0ms 03 688 150ms 0ms 04 720 207ms 0ms 05 720 159ms 0ms 06 720 161ms 0ms 07 720 157ms 0ms 08 720 158ms 0ms 09 720 160ms 0ms 10 718 162ms 0ms 11 720 161ms 0ms 12 720 162ms 0ms 13 720 158ms 0ms 14 720 162ms 0ms 15 720 167ms 0ms 16 720 162ms 0ms 17 720 159ms 0ms 18 720 161ms 0ms 19 720 161ms 0ms 20 720 163ms 0ms 21 720 166ms 0ms 22 720 161ms 0ms 23 360 80ms 0ms 00 360 80ms 0ms 01 360 80ms 0ms 02 360 79ms 0ms 03 683 152ms 0ms 04 720 163ms 0ms 05 720 172ms 0ms 06 720 167ms 0ms 07 720 179ms 0ms 08 720 166ms 0ms 09 720 164ms 0ms 10 720 167ms 0ms 11 720 164ms 0ms 12 720 163ms 0ms 13 720 163ms 0ms 14 720 163ms 0ms 15 720 168ms 0ms 16 720 166ms 0ms 17 720 170ms 0ms 18 720 164ms 0ms 19 720 172ms 0ms 20 720 169ms 0ms 21 720 170ms 0ms 22 720 163ms 0ms 23 360 83ms 0ms 00 360 85ms 0ms 01 360 85ms 0ms 02 360 81ms 0ms 03 678 157ms 0ms 04 720 175ms 0ms 05 720 174ms 0ms 06 720 168ms 0ms 07 720 170ms 0ms 08 720 177ms 0ms 09 720 168ms 0ms 10 720 162ms 0ms 11 720 167ms 0ms 12 720 170ms 0ms 13 720 172ms 0ms 14 720 173ms 0ms 15 720 168ms 0ms 16 720 172ms 0ms 17 720 224ms 0ms 18 720 145ms 0ms 19 720 153ms 0ms 20 720 151ms 0ms 21 720 151ms 0ms 22 720 151ms 0ms 23 360 75ms 0ms 00 360 77ms 0ms 01 360 77ms 0ms 02 360 76ms 0ms 03 673 147ms 0ms 04 720 172ms 0ms 05 718 155ms 0ms 06 720 134ms 0ms 07 720 136ms 0ms 08 720 136ms 0ms 09 720 129ms 0ms 10 720 134ms 0ms 11 720 141ms 0ms 12 720 132ms 0ms 13 720 136ms 0ms 14 720 138ms 0ms 15 720 136ms 0ms 16 720 143ms 0ms 17 720 136ms 0ms 18 720 140ms 0ms 19 720 144ms 0ms 20 720 145ms 0ms 21 720 138ms 0ms 22 720 144ms 0ms 23 360 72ms 0ms 00 360 72ms 0ms 01 360 70ms 0ms 02 360 69ms 0ms 03 984 203ms 0ms 04 1,080 204ms 0ms 05 1,080 208ms 0ms 06 1,080 209ms 0ms 07 1,080 214ms 0ms 08 1,080 208ms 0ms 09 1,080 200ms 0ms 10 1,080 205ms 0ms 11 1,080 210ms 0ms 12 1,080 215ms 0ms 13 1,080 208ms 0ms 14 1,080 201ms 0ms 15 1,080 207ms 0ms 16 1,080 208ms 0ms 17 1,080 206ms 0ms 18 1,080 205ms 0ms 19 1,080 208ms 0ms 20 1,080 217ms 0ms 21 1,080 215ms 0ms 22 1,080 211ms 0ms 23 720 142ms 0ms 00 720 143ms 0ms 01 720 143ms 0ms 02 720 141ms 0ms 03 1,032 215ms 0ms 04 1,080 211ms 0ms 05 1,080 213ms 0ms 06 1,080 204ms 0ms 07 1,080 210ms 0ms 08 1,080 204ms 0ms 09 1,080 205ms 0ms 10 1,080 199ms 0ms 11 1,080 221ms 0ms 12 1,080 206ms 0ms 13 1,080 201ms 0ms 14 1,080 205ms 0ms 15 1,080 211ms 0ms 16 1,080 207ms 0ms 17 1,080 214ms 0ms 18 1,080 203ms 0ms 19 1,080 214ms 0ms 20 1,080 220ms 0ms 21 1,080 212ms 0ms 22 1,080 213ms 0ms 23 359 70ms 0ms 00 360 71ms 0ms 01 360 71ms 0ms 02 360 70ms 0ms 03 18 3ms 0ms [ User: tng_migration_user - Total duration: 25s737ms - Times executed: 134962 ]
[ Application: [unknown] - Total duration: 25s737ms - Times executed: 134962 ]
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;
Date: 2025-12-01 05:02:25 Duration: 21ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;
Date: 2025-12-03 18:52:25 Duration: 16ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;
Date: 2025-12-03 18:53:42 Duration: 10ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
5 27s510ms 532,252 0ms 7ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = $1;Times Reported Time consuming prepare #5
Day Hour Count Duration Avg duration 04 1,386 67ms 0ms 05 1,613 80ms 0ms 06 1,540 77ms 0ms 07 1,540 73ms 0ms 08 1,540 78ms 0ms 09 1,540 75ms 0ms 10 1,790 92ms 0ms 11 1,568 77ms 0ms 12 1,568 77ms 0ms 13 1,760 88ms 0ms 14 1,540 75ms 0ms 15 1,639 83ms 0ms 16 1,488 75ms 0ms 17 1,733 87ms 0ms 18 1,786 94ms 0ms 19 1,617 79ms 0ms 20 1,543 76ms 0ms 21 1,603 80ms 0ms 22 1,597 80ms 0ms 23 28 1ms 0ms 04 3,080 151ms 0ms 05 3,082 155ms 0ms 06 3,252 166ms 0ms 07 3,084 152ms 0ms 08 3,082 160ms 0ms 09 3,112 159ms 0ms 10 3,196 164ms 0ms 11 3,084 157ms 0ms 12 3,230 165ms 0ms 13 3,094 154ms 0ms 14 3,458 189ms 0ms 15 3,080 152ms 0ms 16 2,772 140ms 0ms 17 3,154 154ms 0ms 18 3,082 149ms 0ms 19 3,080 158ms 0ms 20 3,188 163ms 0ms 21 3,732 186ms 0ms 22 3,080 159ms 0ms 04 2,772 145ms 0ms 05 3,080 156ms 0ms 06 3,254 174ms 0ms 07 3,252 169ms 0ms 08 4,468 259ms 0ms 09 3,904 209ms 0ms 10 3,170 159ms 0ms 11 3,242 171ms 0ms 12 3,110 156ms 0ms 13 3,140 160ms 0ms 14 3,212 157ms 0ms 15 3,670 198ms 0ms 16 2,772 156ms 0ms 17 6,740 349ms 0ms 18 4,302 219ms 0ms 19 4,724 241ms 0ms 20 3,864 200ms 0ms 21 3,442 170ms 0ms 22 3,488 178ms 0ms 01 1 0ms 0ms 02 1 0ms 0ms 04 2,772 138ms 0ms 05 3,080 157ms 0ms 06 3,186 181ms 0ms 07 3,420 176ms 0ms 08 3,754 199ms 0ms 09 3,984 217ms 0ms 10 3,316 172ms 0ms 11 3,662 195ms 0ms 12 3,744 195ms 0ms 13 3,650 196ms 0ms 14 3,316 175ms 0ms 15 3,302 182ms 0ms 16 3,452 176ms 0ms 17 3,230 170ms 0ms 18 3,080 155ms 0ms 19 3,080 156ms 0ms 20 3,198 172ms 0ms 21 3,080 153ms 0ms 22 3,244 164ms 0ms 01 56 3ms 0ms 04 3,080 160ms 0ms 05 3,174 174ms 0ms 06 3,716 194ms 0ms 07 3,750 207ms 0ms 08 3,886 216ms 0ms 09 3,432 183ms 0ms 10 3,562 187ms 0ms 11 3,932 213ms 0ms 12 3,184 168ms 0ms 13 3,358 167ms 0ms 14 3,498 178ms 0ms 15 3,372 182ms 0ms 16 3,048 153ms 0ms 17 3,136 169ms 0ms 18 3,418 166ms 0ms 19 3,298 171ms 0ms 20 3,080 154ms 0ms 21 3,710 193ms 0ms 22 3,486 180ms 0ms 04 3,080 157ms 0ms 05 3,152 185ms 0ms 06 3,140 154ms 0ms 07 3,228 165ms 0ms 08 3,538 190ms 0ms 09 3,124 156ms 0ms 10 3,268 172ms 0ms 11 3,398 178ms 0ms 12 3,238 161ms 0ms 13 3,848 205ms 0ms 14 3,178 160ms 0ms 15 3,186 169ms 0ms 16 3,080 153ms 0ms 17 3,120 158ms 0ms 18 3,080 157ms 0ms 19 3,080 157ms 0ms 20 3,304 176ms 0ms 21 3,080 154ms 0ms 22 3,242 167ms 0ms 23 27 1ms 0ms 04 4,332 224ms 0ms 05 4,890 247ms 0ms 06 4,992 266ms 0ms 07 5,367 288ms 0ms 08 5,229 275ms 0ms 09 4,716 238ms 0ms 10 4,980 265ms 0ms 11 5,373 278ms 0ms 12 5,106 273ms 0ms 13 4,701 240ms 0ms 14 4,620 234ms 0ms 15 4,620 233ms 0ms 16 4,236 204ms 0ms 17 4,788 243ms 0ms 18 5,139 267ms 0ms 19 4,776 251ms 0ms 20 4,620 232ms 0ms 21 4,620 255ms 0ms 22 4,791 243ms 0ms 23 56 3ms 0ms 04 4,620 223ms 0ms 05 4,620 240ms 0ms 06 4,620 247ms 0ms 07 4,746 241ms 0ms 08 4,788 240ms 0ms 09 4,620 232ms 0ms 10 4,638 226ms 0ms 11 4,887 244ms 0ms 12 4,629 251ms 0ms 13 4,794 240ms 0ms 14 4,620 224ms 0ms 15 4,620 226ms 0ms 16 4,758 232ms 0ms 17 5,358 279ms 0ms 18 4,704 231ms 0ms 19 4,833 239ms 0ms 20 4,752 242ms 0ms 21 4,698 247ms 0ms 22 4,929 269ms 0ms [ User: tng_migration_user - Total duration: 16s94ms - Times executed: 532252 ]
[ Application: [unknown] - Total duration: 16s94ms - Times executed: 532252 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = $1;
Date: 2025-12-04 06:48:02 Duration: 7ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = $1;
Date: 2025-12-03 18:54:02 Duration: 5ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = $1;
Date: 2025-12-06 19:30:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
6 25s446ms 157,190 0ms 39ms 0ms SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;Times Reported Time consuming prepare #6
Day Hour Count Duration Avg duration 03 365 63ms 0ms 04 410 65ms 0ms 05 420 74ms 0ms 06 420 71ms 0ms 07 420 74ms 0ms 08 420 72ms 0ms 09 420 72ms 0ms 10 420 73ms 0ms 11 420 72ms 0ms 12 420 75ms 0ms 13 420 71ms 0ms 14 420 73ms 0ms 15 420 73ms 0ms 16 411 62ms 0ms 17 420 69ms 0ms 18 420 69ms 0ms 19 420 68ms 0ms 20 420 69ms 0ms 21 420 71ms 0ms 22 420 73ms 0ms 23 420 73ms 0ms 00 420 71ms 0ms 01 420 74ms 0ms 02 420 73ms 0ms 03 818 148ms 0ms 04 826 131ms 0ms 05 840 140ms 0ms 06 840 146ms 0ms 07 840 146ms 0ms 08 840 143ms 0ms 09 840 148ms 0ms 10 840 146ms 0ms 11 840 152ms 0ms 12 840 148ms 0ms 13 840 141ms 0ms 14 840 145ms 0ms 15 840 149ms 0ms 16 822 132ms 0ms 17 840 145ms 0ms 18 840 147ms 0ms 19 840 157ms 0ms 20 840 152ms 0ms 21 840 145ms 0ms 22 796 150ms 0ms 23 420 77ms 0ms 00 420 79ms 0ms 01 420 75ms 0ms 02 420 76ms 0ms 03 802 145ms 0ms 04 822 138ms 0ms 05 840 151ms 0ms 06 840 152ms 0ms 07 840 147ms 0ms 08 840 154ms 0ms 09 840 161ms 0ms 10 838 155ms 0ms 11 840 150ms 0ms 12 840 151ms 0ms 13 840 152ms 0ms 14 840 156ms 0ms 15 840 157ms 0ms 16 822 132ms 0ms 17 840 151ms 0ms 18 840 150ms 0ms 19 840 155ms 0ms 20 840 153ms 0ms 21 840 152ms 0ms 22 840 147ms 0ms 23 420 78ms 0ms 00 420 75ms 0ms 01 420 76ms 0ms 02 420 74ms 0ms 03 796 143ms 0ms 04 820 129ms 0ms 05 840 160ms 0ms 06 840 155ms 0ms 07 840 157ms 0ms 08 840 154ms 0ms 09 840 151ms 0ms 10 840 155ms 0ms 11 840 156ms 0ms 12 840 153ms 0ms 13 840 159ms 0ms 14 840 161ms 0ms 15 840 165ms 0ms 16 828 140ms 0ms 17 840 152ms 0ms 18 840 150ms 0ms 19 840 151ms 0ms 20 840 151ms 0ms 21 840 154ms 0ms 22 840 150ms 0ms 23 420 75ms 0ms 00 420 78ms 0ms 01 420 78ms 0ms 02 420 77ms 0ms 03 790 139ms 0ms 04 838 160ms 0ms 05 840 158ms 0ms 06 840 154ms 0ms 07 840 156ms 0ms 08 840 167ms 0ms 09 840 155ms 0ms 10 840 153ms 0ms 11 840 158ms 0ms 12 840 156ms 0ms 13 840 164ms 0ms 14 840 154ms 0ms 15 840 157ms 0ms 16 822 137ms 0ms 17 840 154ms 0ms 18 840 141ms 0ms 19 840 146ms 0ms 20 840 142ms 0ms 21 840 141ms 0ms 22 840 141ms 0ms 23 420 71ms 0ms 00 420 71ms 0ms 01 420 71ms 0ms 02 420 69ms 0ms 03 785 139ms 0ms 04 826 127ms 0ms 05 838 203ms 0ms 06 840 116ms 0ms 07 840 119ms 0ms 08 840 118ms 0ms 09 840 116ms 0ms 10 840 121ms 0ms 11 840 123ms 0ms 12 840 115ms 0ms 13 840 120ms 0ms 14 840 119ms 0ms 15 840 117ms 0ms 16 828 112ms 0ms 17 840 119ms 0ms 18 840 122ms 0ms 19 840 119ms 0ms 20 840 123ms 0ms 21 840 119ms 0ms 22 840 126ms 0ms 23 420 61ms 0ms 00 420 62ms 0ms 01 420 61ms 0ms 02 420 60ms 0ms 03 1,148 174ms 0ms 04 1,230 161ms 0ms 05 1,260 188ms 0ms 06 1,260 180ms 0ms 07 1,260 184ms 0ms 08 1,260 180ms 0ms 09 1,260 174ms 0ms 10 1,260 174ms 0ms 11 1,260 179ms 0ms 12 1,260 184ms 0ms 13 1,260 182ms 0ms 14 1,260 172ms 0ms 15 1,260 178ms 0ms 16 1,233 151ms 0ms 17 1,260 171ms 0ms 18 1,260 175ms 0ms 19 1,260 171ms 0ms 20 1,260 180ms 0ms 21 1,260 177ms 0ms 22 1,260 179ms 0ms 23 840 120ms 0ms 00 840 115ms 0ms 01 840 118ms 0ms 02 840 115ms 0ms 03 1,203 180ms 0ms 04 1,239 159ms 0ms 05 1,260 178ms 0ms 06 1,260 178ms 0ms 07 1,260 175ms 0ms 08 1,260 172ms 0ms 09 1,260 172ms 0ms 10 1,260 166ms 0ms 11 1,260 174ms 0ms 12 1,260 170ms 0ms 13 1,260 169ms 0ms 14 1,260 170ms 0ms 15 1,260 172ms 0ms 16 1,233 161ms 0ms 17 1,260 181ms 0ms 18 1,260 179ms 0ms 19 1,260 182ms 0ms 20 1,260 186ms 0ms 21 1,260 184ms 0ms 22 1,260 189ms 0ms 23 419 60ms 0ms 00 420 61ms 0ms 01 420 61ms 0ms 02 420 60ms 0ms 03 22 3ms 0ms [ User: tng_migration_user - Total duration: 5s409ms - Times executed: 157190 ]
[ Application: [unknown] - Total duration: 5s409ms - Times executed: 157190 ]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;
Date: 2025-12-04 06:43:01 Duration: 39ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;
Date: 2025-12-02 16:01:01 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;
Date: 2025-11-30 04:16:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
7 22s881ms 134,962 0ms 29ms 0ms SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = $1 AND s0_.last_return_code <> $2;Times Reported Time consuming prepare #7
Day Hour Count Duration Avg duration 03 313 60ms 0ms 04 360 66ms 0ms 05 360 68ms 0ms 06 360 63ms 0ms 07 360 63ms 0ms 08 360 63ms 0ms 09 360 64ms 0ms 10 360 65ms 0ms 11 360 65ms 0ms 12 360 67ms 0ms 13 360 65ms 0ms 14 360 68ms 0ms 15 360 64ms 0ms 16 360 64ms 0ms 17 360 66ms 0ms 18 360 63ms 0ms 19 360 62ms 0ms 20 360 63ms 0ms 21 360 65ms 0ms 22 360 65ms 0ms 23 360 65ms 0ms 00 360 65ms 0ms 01 360 66ms 0ms 02 360 67ms 0ms 03 702 139ms 0ms 04 720 133ms 0ms 05 720 131ms 0ms 06 720 135ms 0ms 07 720 134ms 0ms 08 720 131ms 0ms 09 720 133ms 0ms 10 720 132ms 0ms 11 720 132ms 0ms 12 720 128ms 0ms 13 720 132ms 0ms 14 720 134ms 0ms 15 720 132ms 0ms 16 720 127ms 0ms 17 720 132ms 0ms 18 720 131ms 0ms 19 720 134ms 0ms 20 720 133ms 0ms 21 720 132ms 0ms 22 676 121ms 0ms 23 360 68ms 0ms 00 360 68ms 0ms 01 360 67ms 0ms 02 360 68ms 0ms 03 688 128ms 0ms 04 720 151ms 0ms 05 720 137ms 0ms 06 720 137ms 0ms 07 720 134ms 0ms 08 720 135ms 0ms 09 720 137ms 0ms 10 718 140ms 0ms 11 720 139ms 0ms 12 720 137ms 0ms 13 720 133ms 0ms 14 720 138ms 0ms 15 720 143ms 0ms 16 720 134ms 0ms 17 720 131ms 0ms 18 720 134ms 0ms 19 720 133ms 0ms 20 720 138ms 0ms 21 720 134ms 0ms 22 720 134ms 0ms 23 360 68ms 0ms 00 360 67ms 0ms 01 360 66ms 0ms 02 360 66ms 0ms 03 683 127ms 0ms 04 720 136ms 0ms 05 720 140ms 0ms 06 720 136ms 0ms 07 720 147ms 0ms 08 720 140ms 0ms 09 720 137ms 0ms 10 720 137ms 0ms 11 720 139ms 0ms 12 720 134ms 0ms 13 720 137ms 0ms 14 720 137ms 0ms 15 720 142ms 0ms 16 720 137ms 0ms 17 720 137ms 0ms 18 720 132ms 0ms 19 720 140ms 0ms 20 720 138ms 0ms 21 720 136ms 0ms 22 720 135ms 0ms 23 360 68ms 0ms 00 360 68ms 0ms 01 360 69ms 0ms 02 360 67ms 0ms 03 678 129ms 0ms 04 720 139ms 0ms 05 720 139ms 0ms 06 720 132ms 0ms 07 720 135ms 0ms 08 720 139ms 0ms 09 720 135ms 0ms 10 720 130ms 0ms 11 720 133ms 0ms 12 720 136ms 0ms 13 720 141ms 0ms 14 720 139ms 0ms 15 720 136ms 0ms 16 720 133ms 0ms 17 720 192ms 0ms 18 720 119ms 0ms 19 720 126ms 0ms 20 720 125ms 0ms 21 720 125ms 0ms 22 720 125ms 0ms 23 360 63ms 0ms 00 360 62ms 0ms 01 360 63ms 0ms 02 360 63ms 0ms 03 673 122ms 0ms 04 720 131ms 0ms 05 718 117ms 0ms 06 720 106ms 0ms 07 720 107ms 0ms 08 720 107ms 0ms 09 720 102ms 0ms 10 720 106ms 0ms 11 720 111ms 0ms 12 720 101ms 0ms 13 720 109ms 0ms 14 720 109ms 0ms 15 720 105ms 0ms 16 720 108ms 0ms 17 720 105ms 0ms 18 720 106ms 0ms 19 720 106ms 0ms 20 720 110ms 0ms 21 720 106ms 0ms 22 720 108ms 0ms 23 360 54ms 0ms 00 360 54ms 0ms 01 360 53ms 0ms 02 360 52ms 0ms 03 984 156ms 0ms 04 1,080 155ms 0ms 05 1,080 159ms 0ms 06 1,080 156ms 0ms 07 1,080 155ms 0ms 08 1,080 157ms 0ms 09 1,080 149ms 0ms 10 1,080 155ms 0ms 11 1,080 158ms 0ms 12 1,080 162ms 0ms 13 1,080 156ms 0ms 14 1,080 152ms 0ms 15 1,080 157ms 0ms 16 1,080 155ms 0ms 17 1,080 158ms 0ms 18 1,080 159ms 0ms 19 1,080 155ms 0ms 20 1,080 164ms 0ms 21 1,080 165ms 0ms 22 1,080 160ms 0ms 23 720 108ms 0ms 00 720 106ms 0ms 01 720 107ms 0ms 02 720 106ms 0ms 03 1,032 164ms 0ms 04 1,080 157ms 0ms 05 1,080 158ms 0ms 06 1,080 155ms 0ms 07 1,080 160ms 0ms 08 1,080 154ms 0ms 09 1,080 156ms 0ms 10 1,080 150ms 0ms 11 1,080 168ms 0ms 12 1,080 155ms 0ms 13 1,080 154ms 0ms 14 1,080 155ms 0ms 15 1,080 158ms 0ms 16 1,080 157ms 0ms 17 1,080 159ms 0ms 18 1,080 154ms 0ms 19 1,080 163ms 0ms 20 1,080 168ms 0ms 21 1,080 161ms 0ms 22 1,080 161ms 0ms 23 359 53ms 0ms 00 360 54ms 0ms 01 360 54ms 0ms 02 360 53ms 0ms 03 18 2ms 0ms [ User: tng_migration_user - Total duration: 2s355ms - Times executed: 134962 ]
[ Application: [unknown] - Total duration: 2s355ms - Times executed: 134962 ]
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = $1 AND s0_.last_return_code <> $2;
Date: 2025-12-03 18:53:42 Duration: 29ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = $1 AND s0_.last_return_code <> $2;
Date: 2025-12-01 05:02:25 Duration: 6ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = $1 AND s0_.last_return_code <> $2;
Date: 2025-12-04 05:25:42 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
8 21s999ms 576,552 0ms 0ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;Times Reported Time consuming prepare #8
Day Hour Count Duration Avg duration 03 1,252 47ms 0ms 04 1,444 55ms 0ms 05 1,564 59ms 0ms 06 1,560 57ms 0ms 07 1,560 58ms 0ms 08 1,560 57ms 0ms 09 1,560 57ms 0ms 10 1,560 58ms 0ms 11 1,560 58ms 0ms 12 1,560 59ms 0ms 13 1,560 58ms 0ms 14 1,560 59ms 0ms 15 1,560 58ms 0ms 16 1,544 58ms 0ms 17 1,560 58ms 0ms 18 1,560 57ms 0ms 19 1,560 58ms 0ms 20 1,560 59ms 0ms 21 1,560 59ms 0ms 22 1,560 59ms 0ms 23 1,440 55ms 0ms 00 1,440 55ms 0ms 01 1,440 55ms 0ms 02 1,440 55ms 0ms 03 2,808 110ms 0ms 04 2,888 111ms 0ms 05 3,128 119ms 0ms 06 3,120 120ms 0ms 07 3,120 121ms 0ms 08 3,120 118ms 0ms 09 3,120 120ms 0ms 10 3,120 118ms 0ms 11 3,120 119ms 0ms 12 3,120 119ms 0ms 13 3,120 119ms 0ms 14 3,120 119ms 0ms 15 3,120 118ms 0ms 16 3,088 115ms 0ms 17 3,120 117ms 0ms 18 3,120 116ms 0ms 19 3,120 118ms 0ms 20 3,120 119ms 0ms 21 3,120 118ms 0ms 22 2,944 111ms 0ms 23 1,440 54ms 0ms 00 1,440 55ms 0ms 01 1,440 55ms 0ms 02 1,440 54ms 0ms 03 2,752 105ms 0ms 04 2,888 110ms 0ms 05 3,128 119ms 0ms 06 3,120 119ms 0ms 07 3,120 116ms 0ms 08 3,120 118ms 0ms 09 3,120 117ms 0ms 10 3,112 119ms 0ms 11 3,120 118ms 0ms 12 3,120 119ms 0ms 13 3,120 117ms 0ms 14 3,120 120ms 0ms 15 3,120 120ms 0ms 16 3,088 119ms 0ms 17 3,128 118ms 0ms 18 3,120 118ms 0ms 19 3,120 118ms 0ms 20 3,120 120ms 0ms 21 3,120 119ms 0ms 22 3,120 119ms 0ms 23 1,440 54ms 0ms 00 1,440 55ms 0ms 01 1,440 54ms 0ms 02 1,440 54ms 0ms 03 2,732 104ms 0ms 04 2,888 109ms 0ms 05 3,128 120ms 0ms 06 3,120 119ms 0ms 07 3,128 120ms 0ms 08 3,120 118ms 0ms 09 3,120 120ms 0ms 10 3,120 118ms 0ms 11 3,120 118ms 0ms 12 3,120 118ms 0ms 13 3,120 119ms 0ms 14 3,120 118ms 0ms 15 3,120 121ms 0ms 16 3,096 119ms 0ms 17 3,128 122ms 0ms 18 3,120 121ms 0ms 19 3,120 122ms 0ms 20 3,120 122ms 0ms 21 3,120 121ms 0ms 22 3,120 119ms 0ms 23 1,440 56ms 0ms 00 1,440 56ms 0ms 01 1,440 56ms 0ms 02 1,440 55ms 0ms 03 2,712 105ms 0ms 04 2,888 111ms 0ms 05 3,128 121ms 0ms 06 3,128 119ms 0ms 07 3,120 120ms 0ms 08 3,128 121ms 0ms 09 3,128 120ms 0ms 10 3,120 118ms 0ms 11 3,120 121ms 0ms 12 3,128 119ms 0ms 13 3,120 120ms 0ms 14 3,120 120ms 0ms 15 3,120 119ms 0ms 16 3,088 118ms 0ms 17 3,128 121ms 0ms 18 3,120 117ms 0ms 19 3,120 120ms 0ms 20 3,120 120ms 0ms 21 3,120 118ms 0ms 22 3,120 119ms 0ms 23 1,440 55ms 0ms 00 1,440 55ms 0ms 01 1,440 55ms 0ms 02 1,440 55ms 0ms 03 2,692 104ms 0ms 04 2,888 111ms 0ms 05 3,120 119ms 0ms 06 3,120 118ms 0ms 07 3,120 120ms 0ms 08 3,120 119ms 0ms 09 3,128 116ms 0ms 10 3,120 117ms 0ms 11 3,120 119ms 0ms 12 3,120 116ms 0ms 13 3,128 119ms 0ms 14 3,120 118ms 0ms 15 3,120 118ms 0ms 16 3,096 116ms 0ms 17 3,120 119ms 0ms 18 3,120 118ms 0ms 19 3,120 119ms 0ms 20 3,120 120ms 0ms 21 3,120 119ms 0ms 22 3,120 120ms 0ms 23 1,440 55ms 0ms 00 1,440 55ms 0ms 01 1,440 55ms 0ms 02 1,440 54ms 0ms 03 3,936 154ms 0ms 04 4,332 163ms 0ms 05 4,692 178ms 0ms 06 4,692 177ms 0ms 07 4,680 176ms 0ms 08 4,680 176ms 0ms 09 4,692 174ms 0ms 10 4,680 174ms 0ms 11 4,680 177ms 0ms 12 4,680 177ms 0ms 13 4,680 175ms 0ms 14 4,680 174ms 0ms 15 4,680 179ms 0ms 16 4,632 174ms 0ms 17 4,680 177ms 0ms 18 4,680 177ms 0ms 19 4,680 177ms 0ms 20 4,680 180ms 0ms 21 4,680 178ms 0ms 22 4,680 179ms 0ms 23 2,880 110ms 0ms 00 2,880 109ms 0ms 01 2,880 110ms 0ms 02 2,880 110ms 0ms 03 4,128 162ms 0ms 04 4,332 164ms 0ms 05 4,692 179ms 0ms 06 4,680 175ms 0ms 07 4,680 176ms 0ms 08 4,680 177ms 0ms 09 4,680 175ms 0ms 10 4,680 173ms 0ms 11 4,680 180ms 0ms 12 4,680 174ms 0ms 13 4,680 175ms 0ms 14 4,680 175ms 0ms 15 4,680 179ms 0ms 16 4,632 175ms 0ms 17 4,680 177ms 0ms 18 4,680 177ms 0ms 19 4,680 176ms 0ms 20 4,680 178ms 0ms 21 4,680 180ms 0ms 22 4,680 179ms 0ms 23 1,436 55ms 0ms 00 1,440 55ms 0ms 01 1,440 54ms 0ms 02 1,440 55ms 0ms 03 72 2ms 0ms [ User: tng_migration_user - Total duration: 9s857ms - Times executed: 576552 ]
[ Application: [unknown] - Total duration: 9s857ms - Times executed: 576552 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-12-04 12:13:42 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-12-04 08:09:25 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-11-30 00:06:17 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
9 18s581ms 375,453 0ms 1ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;Times Reported Time consuming prepare #9
Day Hour Count Duration Avg duration 04 1,053 49ms 0ms 05 1,170 55ms 0ms 06 1,170 54ms 0ms 07 1,170 55ms 0ms 08 1,170 56ms 0ms 09 1,170 57ms 0ms 10 1,170 55ms 0ms 11 1,170 57ms 0ms 12 1,170 57ms 0ms 13 1,170 57ms 0ms 14 1,170 57ms 0ms 15 1,170 58ms 0ms 16 1,053 51ms 0ms 17 1,170 56ms 0ms 18 1,170 58ms 0ms 19 1,170 57ms 0ms 20 1,170 56ms 0ms 21 1,170 58ms 0ms 22 1,170 56ms 0ms 04 2,340 115ms 0ms 05 2,340 113ms 0ms 06 2,340 116ms 0ms 07 2,340 115ms 0ms 08 2,340 114ms 0ms 09 2,340 115ms 0ms 10 2,340 118ms 0ms 11 2,340 118ms 0ms 12 2,340 114ms 0ms 13 2,340 111ms 0ms 14 2,340 113ms 0ms 15 2,340 114ms 0ms 16 2,106 105ms 0ms 17 2,340 115ms 0ms 18 2,340 110ms 0ms 19 2,340 112ms 0ms 20 2,340 113ms 0ms 21 2,340 114ms 0ms 22 2,340 114ms 0ms 04 2,106 100ms 0ms 05 2,340 114ms 0ms 06 2,340 118ms 0ms 07 2,340 119ms 0ms 08 2,340 113ms 0ms 09 2,340 115ms 0ms 10 2,340 117ms 0ms 11 2,340 113ms 0ms 12 2,340 113ms 0ms 13 2,340 116ms 0ms 14 2,340 114ms 0ms 15 2,340 115ms 0ms 16 2,106 104ms 0ms 17 2,340 113ms 0ms 18 2,340 117ms 0ms 19 2,340 116ms 0ms 20 2,340 114ms 0ms 21 2,340 115ms 0ms 22 2,340 116ms 0ms 04 2,106 102ms 0ms 05 2,340 113ms 0ms 06 2,340 112ms 0ms 07 2,340 115ms 0ms 08 2,340 117ms 0ms 09 2,340 120ms 0ms 10 2,340 115ms 0ms 11 2,340 115ms 0ms 12 2,340 115ms 0ms 13 2,340 114ms 0ms 14 2,340 113ms 0ms 15 2,340 119ms 0ms 16 2,340 113ms 0ms 17 2,340 115ms 0ms 18 2,340 114ms 0ms 19 2,340 111ms 0ms 20 2,340 113ms 0ms 21 2,340 116ms 0ms 22 2,340 116ms 0ms 04 2,340 114ms 0ms 05 2,340 116ms 0ms 06 2,340 115ms 0ms 07 2,340 120ms 0ms 08 2,340 112ms 0ms 09 2,340 119ms 0ms 10 2,340 114ms 0ms 11 2,340 120ms 0ms 12 2,340 113ms 0ms 13 2,340 115ms 0ms 14 2,340 114ms 0ms 15 2,340 121ms 0ms 16 2,106 102ms 0ms 17 2,340 119ms 0ms 18 2,340 112ms 0ms 19 2,340 116ms 0ms 20 2,340 113ms 0ms 21 2,340 112ms 0ms 22 2,340 115ms 0ms 04 2,340 112ms 0ms 05 2,340 117ms 0ms 06 2,340 115ms 0ms 07 2,340 115ms 0ms 08 2,340 119ms 0ms 09 2,340 116ms 0ms 10 2,340 117ms 0ms 11 2,340 116ms 0ms 12 2,340 116ms 0ms 13 2,340 118ms 0ms 14 2,340 120ms 0ms 15 2,340 118ms 0ms 16 2,340 113ms 0ms 17 2,340 115ms 0ms 18 2,340 114ms 0ms 19 2,340 117ms 0ms 20 2,340 116ms 0ms 21 2,340 116ms 0ms 22 2,340 119ms 0ms 04 3,159 163ms 0ms 05 3,510 178ms 0ms 06 3,510 173ms 0ms 07 3,510 176ms 0ms 08 3,510 172ms 0ms 09 3,510 174ms 0ms 10 3,510 175ms 0ms 11 3,510 171ms 0ms 12 3,510 170ms 0ms 13 3,510 172ms 0ms 14 3,510 174ms 0ms 15 3,510 175ms 0ms 16 3,159 154ms 0ms 17 3,510 175ms 0ms 18 3,510 182ms 0ms 19 3,510 175ms 0ms 20 3,510 175ms 0ms 21 3,510 179ms 0ms 22 3,510 173ms 0ms 04 3,510 171ms 0ms 05 3,510 174ms 0ms 06 3,510 172ms 0ms 07 3,510 170ms 0ms 08 3,510 172ms 0ms 09 3,510 180ms 0ms 10 3,510 173ms 0ms 11 3,510 174ms 0ms 12 3,510 169ms 0ms 13 3,510 174ms 0ms 14 3,510 178ms 0ms 15 3,510 173ms 0ms 16 3,159 158ms 0ms 17 3,510 172ms 0ms 18 3,510 175ms 0ms 19 3,510 171ms 0ms 20 3,510 177ms 0ms 21 3,510 179ms 0ms 22 3,510 173ms 0ms [ User: tng_migration_user - Total duration: 3m30s - Times executed: 375453 ]
[ Application: [unknown] - Total duration: 3m30s - Times executed: 375453 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;
Date: 2025-12-06 10:12:03 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;
Date: 2025-12-02 10:24:03 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;
Date: 2025-12-06 22:30:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
10 15s218ms 191,666 0ms 0ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;Times Reported Time consuming prepare #10
Day Hour Count Duration Avg duration 04 430 30ms 0ms 05 565 43ms 0ms 06 510 36ms 0ms 07 510 37ms 0ms 08 510 36ms 0ms 09 510 37ms 0ms 10 530 39ms 0ms 11 514 38ms 0ms 12 510 36ms 0ms 13 523 41ms 0ms 14 508 39ms 0ms 15 514 37ms 0ms 16 517 39ms 0ms 17 514 37ms 0ms 18 543 46ms 0ms 19 509 38ms 0ms 20 507 37ms 0ms 21 509 39ms 0ms 22 509 38ms 0ms 23 2 0ms 0ms 04 838 59ms 0ms 05 1,110 89ms 0ms 06 1,046 82ms 0ms 07 1,038 80ms 0ms 08 1,032 76ms 0ms 09 1,034 77ms 0ms 10 1,042 80ms 0ms 11 1,036 79ms 0ms 12 1,048 84ms 0ms 13 1,044 80ms 0ms 14 1,062 87ms 0ms 15 1,022 78ms 0ms 16 1,022 73ms 0ms 17 1,026 77ms 0ms 18 1,024 72ms 0ms 19 1,022 79ms 0ms 20 1,026 72ms 0ms 21 1,050 81ms 0ms 22 1,022 76ms 0ms 04 762 58ms 0ms 05 1,016 77ms 0ms 06 1,018 91ms 0ms 07 1,478 115ms 0ms 08 4,196 365ms 0ms 09 2,386 203ms 0ms 10 1,184 96ms 0ms 11 1,212 103ms 0ms 12 936 72ms 0ms 13 1,534 125ms 0ms 14 948 75ms 0ms 15 1,288 108ms 0ms 16 926 68ms 0ms 17 1,188 95ms 0ms 18 956 70ms 0ms 19 976 83ms 0ms 20 956 76ms 0ms 21 938 73ms 0ms 22 1,176 96ms 0ms 01 1 0ms 0ms 02 1 0ms 0ms 04 780 59ms 0ms 05 1,062 83ms 0ms 06 1,220 98ms 0ms 07 2,842 225ms 0ms 08 4,496 360ms 0ms 09 1,064 99ms 0ms 10 2,110 166ms 0ms 11 1,046 86ms 0ms 12 1,348 113ms 0ms 13 1,364 106ms 0ms 14 1,316 106ms 0ms 15 1,008 84ms 0ms 16 994 79ms 0ms 17 988 79ms 0ms 18 970 68ms 0ms 19 970 72ms 0ms 20 986 74ms 0ms 21 970 74ms 0ms 22 978 78ms 0ms 01 4 0ms 0ms 04 778 58ms 0ms 05 1,104 87ms 0ms 06 1,110 96ms 0ms 07 1,970 194ms 0ms 08 1,404 136ms 0ms 09 1,664 135ms 0ms 10 1,118 99ms 0ms 11 1,554 135ms 0ms 12 1,646 136ms 0ms 13 1,048 86ms 0ms 14 1,314 103ms 0ms 15 1,440 115ms 0ms 16 1,022 80ms 0ms 17 1,018 78ms 0ms 18 1,024 80ms 0ms 19 1,028 81ms 0ms 20 1,004 70ms 0ms 21 1,040 83ms 0ms 22 1,032 81ms 0ms 04 830 59ms 0ms 05 1,158 92ms 0ms 06 1,096 87ms 0ms 07 1,134 97ms 0ms 08 2,050 184ms 0ms 09 1,518 124ms 0ms 10 1,096 87ms 0ms 11 1,312 112ms 0ms 12 2,614 192ms 0ms 13 1,114 97ms 0ms 14 1,494 120ms 0ms 15 1,114 88ms 0ms 16 1,054 80ms 0ms 17 1,060 80ms 0ms 18 1,054 77ms 0ms 19 1,054 79ms 0ms 20 1,062 76ms 0ms 21 1,054 80ms 0ms 22 1,054 80ms 0ms 23 2 0ms 0ms 04 1,314 97ms 0ms 05 1,617 129ms 0ms 06 1,914 153ms 0ms 07 1,617 139ms 0ms 08 2,559 210ms 0ms 09 1,851 154ms 0ms 10 3,507 271ms 0ms 11 1,863 159ms 0ms 12 1,632 143ms 0ms 13 1,524 121ms 0ms 14 1,464 114ms 0ms 15 1,464 107ms 0ms 16 1,473 104ms 0ms 17 1,494 118ms 0ms 18 1,503 115ms 0ms 19 1,470 111ms 0ms 20 1,458 111ms 0ms 21 1,458 115ms 0ms 22 1,473 110ms 0ms 23 4 0ms 0ms 04 1,299 91ms 0ms 05 1,689 127ms 0ms 06 1,545 109ms 0ms 07 1,572 122ms 0ms 08 1,551 120ms 0ms 09 1,533 119ms 0ms 10 1,983 145ms 0ms 11 1,545 119ms 0ms 12 2,748 209ms 0ms 13 1,554 117ms 0ms 14 1,527 107ms 0ms 15 1,527 111ms 0ms 16 1,542 112ms 0ms 17 1,572 134ms 0ms 18 1,536 118ms 0ms 19 1,536 112ms 0ms 20 1,536 129ms 0ms 21 1,536 125ms 0ms 22 1,554 140ms 0ms [ User: tng_migration_user - Total duration: 3s896ms - Times executed: 191666 ]
[ Application: [unknown] - Total duration: 3s896ms - Times executed: 191666 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-11-29 19:16:50 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-12-03 08:19:15 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-11-29 17:05:50 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
11 8s745ms 13,185 0ms 1ms 0ms SELECT t0.ID AS id_1, t0.LOGIN AS login_2, t0.EMAIL AS email_3, t0.NAME AS name_4, t0.ACTIVE AS active_5, t0.AUTH_CODE AS auth_code_6, t0.IS_EMAIL_TWO_FACTOR_AUTHENTICATION AS is_email_two_factor_authentication_7, t0.TITLE_BEFORE AS title_before_8, t0.TITLE_AFTER AS title_after_9, t0.PHONE AS phone_10, t0.SALT AS salt_11, t0.PASSWORD AS password_12, t0.PASSWORD_HASH_ALGORITHM AS password_hash_algorithm_13, t0.PASSWORD_HASH_COST AS password_hash_cost_14, t0.INFO AS info_15, t0.INFO_PUBLIC AS info_public_16, t0.datecreated AS datecreated_17, t0.datechanged AS datechanged_18, t0.PASSWORD_EXPIRE AS password_expire_19, t0.PASSWORD_RESET_HASH AS password_reset_hash_20, t0.PASSWORD_RESET_HASH_VALIDITY AS password_reset_hash_validity_21, t0.CREDENTIALS_SENT_LAST_ON AS credentials_sent_last_on_22, t0.SEND_CREDENTIALS_IMMEDIATELY AS send_credentials_immediately_23, t0.DEACTIVATED_LAST_ON AS deactivated_last_on_24, t0.PASSWORD_CHANGED_LAST_ON AS password_changed_last_on_25, t0.EXPIRATION_EMAIL_SENT_LAST_ON AS expiration_email_sent_last_on_26, t0.OWNER_USER_ID AS owner_user_id_27, t0.OWNER_GROUP_ID AS owner_group_id_28, t0.userchanged AS userchanged_29 FROM ACL_user t0 WHERE t0.ID = $1;Times Reported Time consuming prepare #11
Day Hour Count Duration Avg duration 05 8 5ms 0ms 10 33 23ms 0ms 11 4 2ms 0ms 12 3 2ms 0ms 13 21 16ms 0ms 15 10 7ms 0ms 16 12 8ms 0ms 17 26 19ms 0ms 18 34 24ms 0ms 19 7 4ms 0ms 20 2 0ms 0ms 21 3 1ms 0ms 22 7 5ms 0ms 23 3 2ms 0ms 05 2 0ms 0ms 06 18 17ms 0ms 07 4 0ms 0ms 09 6 4ms 0ms 10 12 9ms 0ms 11 2 0ms 0ms 12 18 13ms 0ms 13 6 1ms 0ms 14 48 38ms 0ms 17 18 11ms 0ms 20 6 4ms 0ms 21 28 19ms 0ms 05 4 2ms 0ms 06 150 109ms 0ms 07 94 72ms 0ms 08 810 594ms 0ms 09 394 280ms 0ms 10 152 118ms 0ms 11 198 133ms 0ms 12 140 110ms 0ms 13 208 148ms 0ms 14 32 25ms 0ms 15 80 67ms 0ms 17 392 303ms 0ms 18 122 93ms 0ms 19 160 129ms 0ms 20 72 59ms 0ms 21 22 15ms 0ms 22 88 70ms 0ms 01 1 0ms 0ms 05 10 9ms 0ms 06 150 103ms 0ms 07 278 200ms 0ms 08 392 269ms 0ms 09 234 178ms 0ms 10 188 124ms 0ms 11 198 130ms 0ms 12 274 185ms 0ms 13 122 92ms 0ms 14 80 57ms 0ms 15 52 38ms 0ms 16 36 25ms 0ms 17 14 9ms 0ms 20 16 10ms 0ms 22 8 5ms 0ms 01 6 4ms 0ms 05 28 19ms 0ms 06 226 157ms 0ms 07 612 430ms 0ms 08 598 443ms 0ms 09 192 129ms 0ms 10 328 232ms 0ms 11 276 206ms 0ms 12 144 102ms 0ms 13 88 72ms 0ms 14 170 120ms 0ms 15 70 52ms 0ms 16 28 23ms 0ms 17 6 6ms 1ms 18 38 26ms 0ms 19 26 19ms 0ms 21 34 25ms 0ms 22 58 42ms 0ms 05 6 5ms 0ms 06 106 54ms 0ms 07 270 156ms 0ms 08 538 280ms 0ms 09 150 76ms 0ms 10 96 52ms 0ms 11 118 67ms 0ms 12 218 130ms 0ms 13 94 62ms 0ms 14 114 61ms 0ms 15 224 107ms 0ms 17 6 4ms 0ms 20 14 8ms 0ms 22 34 20ms 0ms 23 3 2ms 0ms 04 21 12ms 0ms 05 27 16ms 0ms 06 288 142ms 0ms 07 279 138ms 0ms 08 408 212ms 0ms 09 243 124ms 0ms 10 240 139ms 0ms 11 138 80ms 0ms 12 378 211ms 0ms 13 153 83ms 0ms 14 15 8ms 0ms 16 9 5ms 0ms 17 21 16ms 0ms 18 54 32ms 0ms 19 18 11ms 0ms 22 18 11ms 0ms 23 6 3ms 0ms 07 24 16ms 0ms 08 18 9ms 0ms 09 3 1ms 0ms 10 24 11ms 0ms 11 42 27ms 0ms 12 66 34ms 0ms 13 21 12ms 0ms 16 66 38ms 0ms 17 84 55ms 0ms 18 12 7ms 0ms 19 18 13ms 0ms 20 12 5ms 0ms 21 12 6ms 0ms 22 36 24ms 0ms [ User: tng_migration_user - Total duration: 698ms - Times executed: 13185 ]
[ Application: [unknown] - Total duration: 698ms - Times executed: 13185 ]
-
SELECT t0.ID AS id_1, t0.LOGIN AS login_2, t0.EMAIL AS email_3, t0.NAME AS name_4, t0.ACTIVE AS active_5, t0.AUTH_CODE AS auth_code_6, t0.IS_EMAIL_TWO_FACTOR_AUTHENTICATION AS is_email_two_factor_authentication_7, t0.TITLE_BEFORE AS title_before_8, t0.TITLE_AFTER AS title_after_9, t0.PHONE AS phone_10, t0.SALT AS salt_11, t0.PASSWORD AS password_12, t0.PASSWORD_HASH_ALGORITHM AS password_hash_algorithm_13, t0.PASSWORD_HASH_COST AS password_hash_cost_14, t0.INFO AS info_15, t0.INFO_PUBLIC AS info_public_16, t0.datecreated AS datecreated_17, t0.datechanged AS datechanged_18, t0.PASSWORD_EXPIRE AS password_expire_19, t0.PASSWORD_RESET_HASH AS password_reset_hash_20, t0.PASSWORD_RESET_HASH_VALIDITY AS password_reset_hash_validity_21, t0.CREDENTIALS_SENT_LAST_ON AS credentials_sent_last_on_22, t0.SEND_CREDENTIALS_IMMEDIATELY AS send_credentials_immediately_23, t0.DEACTIVATED_LAST_ON AS deactivated_last_on_24, t0.PASSWORD_CHANGED_LAST_ON AS password_changed_last_on_25, t0.EXPIRATION_EMAIL_SENT_LAST_ON AS expiration_email_sent_last_on_26, t0.OWNER_USER_ID AS owner_user_id_27, t0.OWNER_GROUP_ID AS owner_group_id_28, t0.userchanged AS userchanged_29 FROM ACL_user t0 WHERE t0.ID = $1;
Date: 2025-12-02 08:34:00 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.ID AS id_1, t0.LOGIN AS login_2, t0.EMAIL AS email_3, t0.NAME AS name_4, t0.ACTIVE AS active_5, t0.AUTH_CODE AS auth_code_6, t0.IS_EMAIL_TWO_FACTOR_AUTHENTICATION AS is_email_two_factor_authentication_7, t0.TITLE_BEFORE AS title_before_8, t0.TITLE_AFTER AS title_after_9, t0.PHONE AS phone_10, t0.SALT AS salt_11, t0.PASSWORD AS password_12, t0.PASSWORD_HASH_ALGORITHM AS password_hash_algorithm_13, t0.PASSWORD_HASH_COST AS password_hash_cost_14, t0.INFO AS info_15, t0.INFO_PUBLIC AS info_public_16, t0.datecreated AS datecreated_17, t0.datechanged AS datechanged_18, t0.PASSWORD_EXPIRE AS password_expire_19, t0.PASSWORD_RESET_HASH AS password_reset_hash_20, t0.PASSWORD_RESET_HASH_VALIDITY AS password_reset_hash_validity_21, t0.CREDENTIALS_SENT_LAST_ON AS credentials_sent_last_on_22, t0.SEND_CREDENTIALS_IMMEDIATELY AS send_credentials_immediately_23, t0.DEACTIVATED_LAST_ON AS deactivated_last_on_24, t0.PASSWORD_CHANGED_LAST_ON AS password_changed_last_on_25, t0.EXPIRATION_EMAIL_SENT_LAST_ON AS expiration_email_sent_last_on_26, t0.OWNER_USER_ID AS owner_user_id_27, t0.OWNER_GROUP_ID AS owner_group_id_28, t0.userchanged AS userchanged_29 FROM ACL_user t0 WHERE t0.ID = $1;
Date: 2025-12-03 11:18:03 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.ID AS id_1, t0.LOGIN AS login_2, t0.EMAIL AS email_3, t0.NAME AS name_4, t0.ACTIVE AS active_5, t0.AUTH_CODE AS auth_code_6, t0.IS_EMAIL_TWO_FACTOR_AUTHENTICATION AS is_email_two_factor_authentication_7, t0.TITLE_BEFORE AS title_before_8, t0.TITLE_AFTER AS title_after_9, t0.PHONE AS phone_10, t0.SALT AS salt_11, t0.PASSWORD AS password_12, t0.PASSWORD_HASH_ALGORITHM AS password_hash_algorithm_13, t0.PASSWORD_HASH_COST AS password_hash_cost_14, t0.INFO AS info_15, t0.INFO_PUBLIC AS info_public_16, t0.datecreated AS datecreated_17, t0.datechanged AS datechanged_18, t0.PASSWORD_EXPIRE AS password_expire_19, t0.PASSWORD_RESET_HASH AS password_reset_hash_20, t0.PASSWORD_RESET_HASH_VALIDITY AS password_reset_hash_validity_21, t0.CREDENTIALS_SENT_LAST_ON AS credentials_sent_last_on_22, t0.SEND_CREDENTIALS_IMMEDIATELY AS send_credentials_immediately_23, t0.DEACTIVATED_LAST_ON AS deactivated_last_on_24, t0.PASSWORD_CHANGED_LAST_ON AS password_changed_last_on_25, t0.EXPIRATION_EMAIL_SENT_LAST_ON AS expiration_email_sent_last_on_26, t0.OWNER_USER_ID AS owner_user_id_27, t0.OWNER_GROUP_ID AS owner_group_id_28, t0.userchanged AS userchanged_29 FROM ACL_user t0 WHERE t0.ID = $1;
Date: 2025-12-03 15:59:34 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
12 6s606ms 78,691 0ms 0ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;Times Reported Time consuming prepare #12
Day Hour Count Duration Avg duration 05 212 16ms 0ms 10 579 43ms 0ms 11 87 6ms 0ms 12 95 6ms 0ms 13 592 45ms 0ms 15 309 23ms 0ms 16 309 24ms 0ms 17 618 46ms 0ms 18 392 31ms 0ms 19 138 10ms 0ms 21 154 11ms 0ms 22 190 14ms 0ms 23 95 7ms 0ms 05 6 0ms 0ms 06 570 45ms 0ms 09 46 3ms 0ms 10 380 29ms 0ms 12 472 37ms 0ms 14 976 80ms 0ms 17 190 13ms 0ms 20 380 30ms 0ms 21 1,640 124ms 0ms 05 40 4ms 0ms 06 360 37ms 0ms 07 130 13ms 0ms 08 1,188 128ms 0ms 09 602 61ms 0ms 10 86 8ms 0ms 11 258 27ms 0ms 12 54 6ms 0ms 13 94 10ms 0ms 14 280 20ms 0ms 15 1,618 124ms 0ms 17 6,456 505ms 0ms 18 2,548 195ms 0ms 19 3,624 288ms 0ms 20 1,596 124ms 0ms 21 846 63ms 0ms 22 2,070 158ms 0ms 05 12 1ms 0ms 06 98 11ms 0ms 07 250 22ms 0ms 08 690 58ms 0ms 09 1,316 104ms 0ms 10 480 44ms 0ms 11 1,770 147ms 0ms 12 1,012 94ms 0ms 13 470 41ms 0ms 14 452 35ms 0ms 15 282 22ms 0ms 16 664 52ms 0ms 17 456 36ms 0ms 20 380 28ms 0ms 22 410 34ms 0ms 01 190 15ms 0ms 05 176 15ms 0ms 06 864 81ms 0ms 07 1,438 129ms 0ms 08 1,416 139ms 0ms 09 756 69ms 0ms 10 934 82ms 0ms 11 756 77ms 0ms 12 356 39ms 0ms 13 490 42ms 0ms 14 436 42ms 0ms 15 684 53ms 0ms 16 682 58ms 0ms 17 74 6ms 0ms 18 538 41ms 0ms 19 710 53ms 0ms 21 1,434 116ms 0ms 22 1,154 95ms 0ms 05 218 20ms 0ms 06 224 21ms 0ms 07 470 46ms 0ms 08 1,104 118ms 0ms 09 286 30ms 0ms 10 578 46ms 0ms 11 564 49ms 0ms 12 266 24ms 0ms 13 1,800 139ms 0ms 14 56 7ms 0ms 15 236 17ms 0ms 17 122 8ms 0ms 20 190 15ms 0ms 22 270 22ms 0ms 23 45 3ms 0ms 04 570 51ms 0ms 05 843 64ms 0ms 06 636 64ms 0ms 07 1,578 141ms 0ms 08 1,752 158ms 0ms 09 588 62ms 0ms 10 1,179 101ms 0ms 11 1,086 91ms 0ms 12 1,071 102ms 0ms 13 312 33ms 0ms 16 123 9ms 0ms 17 246 21ms 0ms 18 1,035 77ms 0ms 19 522 42ms 0ms 22 570 49ms 0ms 23 190 14ms 0ms 05 33 3ms 0ms 07 174 15ms 0ms 08 570 41ms 0ms 09 3 0ms 0ms 10 51 6ms 0ms 11 489 38ms 0ms 12 75 7ms 0ms 13 498 39ms 0ms 16 1,290 93ms 0ms 17 2,124 163ms 0ms 18 261 20ms 0ms 19 708 57ms 0ms 20 342 25ms 0ms 21 237 18ms 0ms 22 996 83ms 0ms [ User: tng_migration_user - Total duration: 3s69ms - Times executed: 78691 ]
[ Application: [unknown] - Total duration: 3s69ms - Times executed: 78691 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;
Date: 2025-12-04 06:11:07 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;
Date: 2025-12-01 09:13:43 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;
Date: 2025-12-01 10:06:04 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
13 6s344ms 55,528 0ms 7ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.subject_inform_consent_state t0 WHERE t0.code = $1 LIMIT 1;Times Reported Time consuming prepare #13
Day Hour Count Duration Avg duration 04 36 5ms 0ms 05 92 12ms 0ms 06 68 10ms 0ms 07 68 10ms 0ms 08 68 11ms 0ms 09 68 10ms 0ms 10 160 19ms 0ms 11 84 11ms 0ms 12 76 10ms 0ms 13 144 18ms 0ms 14 68 9ms 0ms 15 104 13ms 0ms 16 96 10ms 0ms 17 156 17ms 0ms 18 180 21ms 0ms 19 92 11ms 0ms 20 72 10ms 0ms 21 80 12ms 0ms 22 88 11ms 0ms 23 12 1ms 0ms 04 80 11ms 0ms 05 136 20ms 0ms 06 208 27ms 0ms 07 136 19ms 0ms 08 144 24ms 0ms 09 152 21ms 0ms 10 184 26ms 0ms 11 144 20ms 0ms 12 192 25ms 0ms 13 168 22ms 0ms 14 288 36ms 0ms 15 136 20ms 0ms 16 120 17ms 0ms 17 184 22ms 0ms 18 144 21ms 0ms 19 136 23ms 0ms 20 168 22ms 0ms 21 224 28ms 0ms 22 136 21ms 0ms 04 72 10ms 0ms 05 136 20ms 0ms 06 504 52ms 0ms 07 352 41ms 0ms 08 1,800 172ms 0ms 09 1,128 107ms 0ms 10 464 50ms 0ms 11 664 69ms 0ms 12 304 36ms 0ms 13 520 57ms 0ms 14 232 30ms 0ms 15 392 47ms 0ms 16 120 20ms 0ms 17 1,120 101ms 0ms 18 480 47ms 0ms 19 640 59ms 0ms 20 328 37ms 0ms 21 248 31ms 0ms 22 376 41ms 0ms 02 4 0ms 0ms 04 72 9ms 0ms 05 136 20ms 0ms 06 448 54ms 0ms 07 936 86ms 0ms 08 1,344 119ms 0ms 09 680 73ms 0ms 10 656 67ms 0ms 11 664 71ms 0ms 12 840 88ms 0ms 13 432 47ms 0ms 14 312 34ms 0ms 15 328 43ms 0ms 16 280 32ms 0ms 17 184 25ms 0ms 18 136 19ms 0ms 19 136 20ms 0ms 20 184 26ms 0ms 21 136 19ms 0ms 22 160 23ms 0ms 01 20 1ms 0ms 04 80 13ms 0ms 05 216 27ms 0ms 06 800 89ms 0ms 07 1,672 166ms 0ms 08 1,440 164ms 0ms 09 640 71ms 0ms 10 1,032 114ms 0ms 11 800 92ms 0ms 12 536 61ms 0ms 13 288 37ms 0ms 14 512 56ms 0ms 15 288 36ms 0ms 16 200 25ms 0ms 17 160 38ms 0ms 18 232 27ms 0ms 19 232 30ms 0ms 20 136 19ms 0ms 21 256 32ms 0ms 22 312 35ms 0ms 04 80 11ms 0ms 05 160 24ms 0ms 06 376 37ms 0ms 07 656 66ms 0ms 08 1,584 142ms 0ms 09 560 56ms 0ms 10 360 43ms 0ms 11 448 46ms 0ms 12 624 63ms 0ms 13 352 41ms 0ms 14 352 36ms 0ms 15 712 70ms 0ms 16 128 21ms 0ms 17 160 25ms 0ms 18 136 21ms 0ms 19 136 19ms 0ms 20 192 24ms 0ms 21 136 19ms 0ms 22 264 33ms 0ms 23 12 1ms 0ms 04 180 44ms 0ms 05 300 36ms 0ms 06 984 99ms 0ms 07 1,020 101ms 0ms 08 1,452 135ms 0ms 09 876 89ms 0ms 10 756 73ms 0ms 11 624 74ms 0ms 12 1,212 117ms 0ms 13 624 66ms 0ms 14 216 28ms 0ms 15 204 27ms 0ms 16 216 25ms 0ms 17 336 47ms 0ms 18 372 44ms 0ms 19 264 36ms 0ms 20 204 30ms 0ms 21 204 33ms 0ms 22 264 34ms 0ms 23 24 2ms 0ms 04 120 16ms 0ms 05 204 30ms 0ms 06 204 29ms 0ms 07 276 37ms 0ms 08 264 31ms 0ms 09 216 29ms 0ms 10 288 33ms 0ms 11 300 38ms 0ms 12 348 42ms 0ms 13 276 33ms 0ms 14 204 26ms 0ms 15 204 26ms 0ms 16 336 34ms 0ms 17 480 57ms 0ms 18 240 34ms 0ms 19 276 32ms 0ms 20 240 35ms 0ms 21 240 33ms 0ms 22 360 45ms 0ms [ User: tng_migration_user - Total duration: 518ms - Times executed: 55528 ]
[ Application: [unknown] - Total duration: 518ms - Times executed: 55528 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.subject_inform_consent_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-12-03 18:54:02 Duration: 7ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.subject_inform_consent_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-12-05 05:12:02 Duration: 7ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.subject_inform_consent_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-11-29 11:45:32 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
14 6s97ms 163,120 0ms 1ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;Times Reported Time consuming prepare #14
Day Hour Count Duration Avg duration 04 573 20ms 0ms 05 521 19ms 0ms 06 516 18ms 0ms 07 516 17ms 0ms 08 516 18ms 0ms 09 516 18ms 0ms 10 522 18ms 0ms 11 517 18ms 0ms 12 515 18ms 0ms 13 518 19ms 0ms 14 514 19ms 0ms 15 516 18ms 0ms 16 516 19ms 0ms 17 510 18ms 0ms 18 522 23ms 0ms 19 508 17ms 0ms 20 509 18ms 0ms 21 508 19ms 0ms 22 509 18ms 0ms 04 1,134 40ms 0ms 05 1,004 37ms 0ms 06 1,006 36ms 0ms 07 1,006 40ms 0ms 08 1,002 37ms 0ms 09 1,004 35ms 0ms 10 1,006 37ms 0ms 11 1,002 38ms 0ms 12 1,006 43ms 0ms 13 1,004 39ms 0ms 14 1,010 40ms 0ms 15 990 35ms 0ms 16 990 35ms 0ms 17 992 36ms 0ms 18 990 33ms 0ms 19 990 34ms 0ms 20 990 34ms 0ms 21 996 36ms 0ms 22 990 34ms 0ms 04 1,062 40ms 0ms 05 946 33ms 0ms 06 978 38ms 0ms 07 960 36ms 0ms 08 1,016 45ms 0ms 09 960 37ms 0ms 10 944 35ms 0ms 11 946 37ms 0ms 12 942 34ms 0ms 13 942 37ms 0ms 14 942 36ms 0ms 15 964 36ms 0ms 16 942 33ms 0ms 17 944 37ms 0ms 18 944 33ms 0ms 19 946 40ms 0ms 20 948 37ms 0ms 21 938 36ms 0ms 22 946 36ms 0ms 01 1 0ms 0ms 04 1,034 38ms 0ms 05 948 33ms 0ms 06 950 37ms 0ms 07 950 36ms 0ms 08 956 37ms 0ms 09 966 41ms 0ms 10 952 34ms 0ms 11 956 33ms 0ms 12 944 33ms 0ms 13 948 34ms 0ms 14 956 35ms 0ms 15 942 34ms 0ms 16 940 36ms 0ms 17 938 36ms 0ms 18 936 32ms 0ms 19 936 32ms 0ms 20 942 33ms 0ms 21 936 36ms 0ms 22 938 34ms 0ms 01 1 0ms 0ms 04 1,044 38ms 0ms 05 940 34ms 0ms 06 948 38ms 0ms 07 970 41ms 0ms 08 972 36ms 0ms 09 940 39ms 0ms 10 960 39ms 0ms 11 956 38ms 0ms 12 938 34ms 0ms 13 946 36ms 0ms 14 970 38ms 0ms 15 966 40ms 0ms 16 934 34ms 0ms 17 932 34ms 0ms 18 938 35ms 0ms 19 934 35ms 0ms 20 928 31ms 0ms 21 936 36ms 0ms 22 934 36ms 0ms 04 1,110 38ms 0ms 05 1,032 38ms 0ms 06 1,030 35ms 0ms 07 1,036 38ms 0ms 08 1,032 36ms 0ms 09 1,032 42ms 0ms 10 1,038 38ms 0ms 11 1,054 41ms 0ms 12 1,064 38ms 0ms 13 1,050 44ms 0ms 14 1,050 40ms 0ms 15 1,038 37ms 0ms 16 1,034 37ms 0ms 17 1,036 38ms 0ms 18 1,034 35ms 0ms 19 1,034 37ms 0ms 20 1,036 37ms 0ms 21 1,034 38ms 0ms 22 1,038 38ms 0ms 04 1,728 63ms 0ms 05 1,533 57ms 0ms 06 1,548 55ms 0ms 07 1,536 55ms 0ms 08 1,533 56ms 0ms 09 1,533 54ms 0ms 10 1,542 56ms 0ms 11 1,554 61ms 0ms 12 1,551 56ms 0ms 13 1,524 53ms 0ms 14 1,524 56ms 0ms 15 1,524 54ms 0ms 16 1,527 53ms 0ms 17 1,527 55ms 0ms 18 1,536 54ms 0ms 19 1,521 54ms 0ms 20 1,515 54ms 0ms 21 1,515 56ms 0ms 22 1,521 53ms 0ms 04 1,812 64ms 0ms 05 1,614 56ms 0ms 06 1,614 55ms 0ms 07 1,626 60ms 0ms 08 1,614 61ms 0ms 09 1,608 62ms 0ms 10 1,608 58ms 0ms 11 1,611 64ms 0ms 12 1,608 57ms 0ms 13 1,614 59ms 0ms 14 1,602 56ms 0ms 15 1,602 54ms 0ms 16 1,605 55ms 0ms 17 1,614 64ms 0ms 18 1,593 61ms 0ms 19 1,590 59ms 0ms 20 1,587 69ms 0ms 21 1,587 64ms 0ms 22 1,587 61ms 0ms [ User: tng_migration_user - Total duration: 2s358ms - Times executed: 163120 ]
[ Application: [unknown] - Total duration: 2s358ms - Times executed: 163120 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;
Date: 2025-11-30 13:00:04 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;
Date: 2025-11-29 19:16:50 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;
Date: 2025-12-03 22:56:17 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
15 5s178ms 108,480 0ms 0ms 0ms SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);Times Reported Time consuming prepare #15
Day Hour Count Duration Avg duration 04 88 5ms 0ms 05 320 14ms 0ms 10 823 36ms 0ms 11 112 4ms 0ms 12 122 5ms 0ms 13 763 32ms 0ms 15 405 17ms 0ms 16 405 18ms 0ms 17 810 35ms 0ms 18 669 30ms 0ms 19 246 10ms 0ms 21 214 9ms 0ms 22 244 10ms 0ms 23 122 5ms 0ms 04 218 13ms 0ms 06 732 32ms 0ms 09 76 3ms 0ms 10 488 21ms 0ms 12 608 27ms 0ms 14 1,600 74ms 0ms 17 272 11ms 0ms 20 488 23ms 0ms 21 2,400 104ms 0ms 04 142 8ms 0ms 06 414 25ms 0ms 07 386 17ms 0ms 08 1,428 77ms 0ms 09 1,094 55ms 0ms 10 962 49ms 0ms 11 500 27ms 0ms 12 68 3ms 0ms 13 310 17ms 0ms 14 686 29ms 0ms 15 2,228 97ms 0ms 17 8,620 388ms 0ms 18 3,364 149ms 0ms 19 4,822 220ms 0ms 20 2,358 106ms 0ms 21 1,122 50ms 0ms 22 2,918 129ms 0ms 04 240 15ms 0ms 06 172 10ms 0ms 07 746 41ms 0ms 08 1,446 81ms 0ms 09 2,196 103ms 0ms 10 698 36ms 0ms 11 1,938 90ms 0ms 12 1,024 52ms 0ms 13 770 36ms 0ms 14 654 29ms 0ms 15 506 23ms 0ms 16 920 42ms 0ms 17 600 27ms 0ms 20 488 20ms 0ms 22 600 27ms 0ms 01 244 11ms 0ms 04 210 12ms 0ms 05 234 10ms 0ms 06 810 41ms 0ms 07 2,990 152ms 0ms 08 1,878 100ms 0ms 09 684 34ms 0ms 10 1,124 59ms 0ms 11 694 35ms 0ms 12 100 8ms 0ms 13 750 36ms 0ms 14 374 18ms 0ms 15 930 41ms 0ms 16 880 43ms 0ms 17 162 7ms 0ms 18 706 31ms 0ms 19 916 39ms 0ms 21 2,204 104ms 0ms 22 1,544 71ms 0ms 04 262 15ms 0ms 05 278 13ms 0ms 06 190 11ms 0ms 07 646 35ms 0ms 08 1,028 60ms 0ms 09 384 19ms 0ms 10 762 35ms 0ms 11 590 27ms 0ms 12 312 16ms 0ms 13 2,660 121ms 0ms 14 90 5ms 0ms 15 1,174 57ms 0ms 17 158 6ms 0ms 20 304 14ms 0ms 22 424 19ms 0ms 23 70 3ms 0ms 04 1,044 58ms 0ms 05 1,071 46ms 0ms 06 453 27ms 0ms 07 1,782 91ms 0ms 08 1,794 94ms 0ms 09 282 18ms 0ms 10 1,326 63ms 0ms 11 1,245 58ms 0ms 12 1,032 58ms 0ms 13 273 18ms 0ms 16 192 8ms 0ms 17 384 18ms 0ms 18 1,545 67ms 0ms 19 672 31ms 0ms 22 732 36ms 0ms 23 244 10ms 0ms 04 366 23ms 0ms 07 276 13ms 0ms 08 732 31ms 0ms 10 6 1ms 0ms 11 648 29ms 0ms 12 9 1ms 0ms 13 660 30ms 0ms 16 1,734 73ms 0ms 17 3,192 139ms 0ms 18 336 14ms 0ms 19 912 41ms 0ms 20 537 22ms 0ms 21 306 14ms 0ms 22 1,284 61ms 0ms [ User: tng_migration_user - Total duration: 2s209ms - Times executed: 108480 ]
[ Application: [unknown] - Total duration: 2s209ms - Times executed: 108480 ]
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-12-02 11:58:13 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-11-29 11:31:59 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-12-04 16:41:34 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
16 4s775ms 55,692 0ms 4ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;Times Reported Time consuming prepare #16
Day Hour Count Duration Avg duration 05 182 15ms 0ms 06 182 15ms 0ms 07 182 16ms 0ms 08 182 15ms 0ms 09 182 14ms 0ms 10 182 15ms 0ms 11 182 15ms 0ms 12 182 15ms 0ms 13 182 16ms 0ms 14 182 15ms 0ms 15 182 15ms 0ms 16 182 15ms 0ms 17 182 15ms 0ms 18 182 15ms 0ms 19 182 16ms 0ms 20 182 15ms 0ms 21 182 16ms 0ms 22 182 15ms 0ms 05 364 30ms 0ms 06 364 32ms 0ms 07 364 30ms 0ms 08 364 30ms 0ms 09 364 30ms 0ms 10 364 29ms 0ms 11 364 30ms 0ms 12 364 30ms 0ms 13 364 30ms 0ms 14 364 31ms 0ms 15 364 32ms 0ms 16 364 29ms 0ms 17 364 30ms 0ms 18 364 29ms 0ms 19 364 33ms 0ms 20 364 29ms 0ms 21 364 29ms 0ms 22 364 33ms 0ms 05 364 30ms 0ms 06 364 32ms 0ms 07 364 32ms 0ms 08 364 35ms 0ms 09 364 31ms 0ms 10 364 30ms 0ms 11 364 31ms 0ms 12 364 33ms 0ms 13 364 30ms 0ms 14 364 32ms 0ms 15 364 31ms 0ms 16 364 30ms 0ms 17 364 29ms 0ms 18 364 28ms 0ms 19 364 32ms 0ms 20 364 30ms 0ms 21 364 30ms 0ms 22 364 30ms 0ms 05 364 31ms 0ms 06 364 29ms 0ms 07 364 39ms 0ms 08 364 29ms 0ms 09 364 30ms 0ms 10 364 29ms 0ms 11 364 32ms 0ms 12 364 33ms 0ms 13 364 30ms 0ms 14 364 32ms 0ms 15 364 34ms 0ms 16 364 31ms 0ms 17 364 29ms 0ms 18 364 29ms 0ms 19 364 32ms 0ms 20 364 31ms 0ms 21 364 29ms 0ms 22 364 34ms 0ms 05 364 31ms 0ms 06 364 30ms 0ms 07 364 33ms 0ms 08 364 32ms 0ms 09 364 31ms 0ms 10 364 30ms 0ms 11 364 30ms 0ms 12 364 31ms 0ms 13 364 31ms 0ms 14 364 30ms 0ms 15 364 30ms 0ms 16 364 31ms 0ms 17 364 30ms 0ms 18 364 33ms 0ms 19 364 33ms 0ms 20 364 31ms 0ms 21 364 31ms 0ms 22 364 29ms 0ms 05 364 30ms 0ms 06 364 33ms 0ms 07 364 31ms 0ms 08 364 31ms 0ms 09 364 31ms 0ms 10 364 32ms 0ms 11 364 30ms 0ms 12 364 31ms 0ms 13 364 33ms 0ms 14 364 32ms 0ms 15 364 30ms 0ms 16 364 32ms 0ms 17 364 30ms 0ms 18 364 32ms 0ms 19 364 30ms 0ms 20 364 30ms 0ms 21 364 33ms 0ms 22 364 31ms 0ms 05 546 50ms 0ms 06 546 46ms 0ms 07 546 47ms 0ms 08 546 46ms 0ms 09 546 46ms 0ms 10 546 49ms 0ms 11 546 46ms 0ms 12 546 46ms 0ms 13 546 45ms 0ms 14 546 45ms 0ms 15 546 44ms 0ms 16 546 42ms 0ms 17 546 43ms 0ms 18 546 46ms 0ms 19 546 45ms 0ms 20 546 48ms 0ms 21 546 47ms 0ms 22 546 46ms 0ms 05 546 45ms 0ms 06 546 45ms 0ms 07 546 47ms 0ms 08 546 46ms 0ms 09 546 45ms 0ms 10 546 46ms 0ms 11 546 47ms 0ms 12 546 44ms 0ms 13 546 47ms 0ms 14 546 47ms 0ms 15 546 47ms 0ms 16 546 47ms 0ms 17 546 43ms 0ms 18 546 44ms 0ms 19 546 44ms 0ms 20 546 44ms 0ms 21 546 46ms 0ms 22 546 46ms 0ms [ User: tng_migration_user - Total duration: 15s647ms - Times executed: 55692 ]
[ Application: [unknown] - Total duration: 15s647ms - Times executed: 55692 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-12-02 08:32:02 Duration: 4ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-12-01 07:23:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-11-29 08:59:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
17 4s694ms 72,828 0ms 0ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND (m0_.result_date BETWEEN $6 AND $7);Times Reported Time consuming prepare #17
Day Hour Count Duration Avg duration 05 238 15ms 0ms 06 238 14ms 0ms 07 238 15ms 0ms 08 238 14ms 0ms 09 238 14ms 0ms 10 238 14ms 0ms 11 238 14ms 0ms 12 238 15ms 0ms 13 238 16ms 0ms 14 238 15ms 0ms 15 238 14ms 0ms 16 238 15ms 0ms 17 238 14ms 0ms 18 238 14ms 0ms 19 238 15ms 0ms 20 238 15ms 0ms 21 238 15ms 0ms 22 238 15ms 0ms 05 476 30ms 0ms 06 476 32ms 0ms 07 476 29ms 0ms 08 476 30ms 0ms 09 476 30ms 0ms 10 476 30ms 0ms 11 476 30ms 0ms 12 476 30ms 0ms 13 476 30ms 0ms 14 476 30ms 0ms 15 476 32ms 0ms 16 476 29ms 0ms 17 476 30ms 0ms 18 476 29ms 0ms 19 476 32ms 0ms 20 476 28ms 0ms 21 476 29ms 0ms 22 476 31ms 0ms 05 476 30ms 0ms 06 476 31ms 0ms 07 476 31ms 0ms 08 476 33ms 0ms 09 476 31ms 0ms 10 476 29ms 0ms 11 476 30ms 0ms 12 476 31ms 0ms 13 476 30ms 0ms 14 476 32ms 0ms 15 476 31ms 0ms 16 476 30ms 0ms 17 476 28ms 0ms 18 476 29ms 0ms 19 476 30ms 0ms 20 476 30ms 0ms 21 476 29ms 0ms 22 476 29ms 0ms 05 476 30ms 0ms 06 476 29ms 0ms 07 476 31ms 0ms 08 476 28ms 0ms 09 476 30ms 0ms 10 476 29ms 0ms 11 476 31ms 0ms 12 476 30ms 0ms 13 476 30ms 0ms 14 476 31ms 0ms 15 476 33ms 0ms 16 476 30ms 0ms 17 476 29ms 0ms 18 476 29ms 0ms 19 476 31ms 0ms 20 476 30ms 0ms 21 476 29ms 0ms 22 476 33ms 0ms 05 476 31ms 0ms 06 476 30ms 0ms 07 476 30ms 0ms 08 476 31ms 0ms 09 476 31ms 0ms 10 476 30ms 0ms 11 476 29ms 0ms 12 476 31ms 0ms 13 476 30ms 0ms 14 476 30ms 0ms 15 476 30ms 0ms 16 476 31ms 0ms 17 476 29ms 0ms 18 476 32ms 0ms 19 476 31ms 0ms 20 476 31ms 0ms 21 476 30ms 0ms 22 476 29ms 0ms 05 476 30ms 0ms 06 476 31ms 0ms 07 476 31ms 0ms 08 476 30ms 0ms 09 476 30ms 0ms 10 476 30ms 0ms 11 476 30ms 0ms 12 476 30ms 0ms 13 476 31ms 0ms 14 476 33ms 0ms 15 476 31ms 0ms 16 476 32ms 0ms 17 476 30ms 0ms 18 476 32ms 0ms 19 476 30ms 0ms 20 476 29ms 0ms 21 476 32ms 0ms 22 476 30ms 0ms 05 714 49ms 0ms 06 714 45ms 0ms 07 714 44ms 0ms 08 714 49ms 0ms 09 714 46ms 0ms 10 714 48ms 0ms 11 714 46ms 0ms 12 714 45ms 0ms 13 714 45ms 0ms 14 714 44ms 0ms 15 714 44ms 0ms 16 714 43ms 0ms 17 714 44ms 0ms 18 714 47ms 0ms 19 714 47ms 0ms 20 714 46ms 0ms 21 714 46ms 0ms 22 714 44ms 0ms 05 714 46ms 0ms 06 714 45ms 0ms 07 714 47ms 0ms 08 714 46ms 0ms 09 714 44ms 0ms 10 714 45ms 0ms 11 714 45ms 0ms 12 714 45ms 0ms 13 714 45ms 0ms 14 714 46ms 0ms 15 714 46ms 0ms 16 714 46ms 0ms 17 714 43ms 0ms 18 714 45ms 0ms 19 714 44ms 0ms 20 714 45ms 0ms 21 714 44ms 0ms 22 714 47ms 0ms [ User: tng_migration_user - Total duration: 1s217ms - Times executed: 72828 ]
[ Application: [unknown] - Total duration: 1s217ms - Times executed: 72828 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND (m0_.result_date BETWEEN $6 AND $7);
Date: 2025-12-05 09:23:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND (m0_.result_date BETWEEN $6 AND $7);
Date: 2025-12-01 09:05:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND (m0_.result_date BETWEEN $6 AND $7);
Date: 2025-12-01 09:05:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
18 4s177ms 87,690 0ms 0ms 0ms SELECT a0_.ID AS id_0, a0_.NAME AS name_1, a0_.ACRONYM AS acronym_2, a0_.DESCRIPTION AS description_3, a0_.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_4, a0_.STRUCTURE_LEFT_TREE AS structure_left_tree_5, a0_.STRUCTURE_RIGHT_TREE AS structure_right_tree_6, a0_.INFO AS info_7 FROM ACL_GROUP a0_ WHERE a0_.STRUCTURE_ROOT_GROUP_ID = $1 AND a0_.STRUCTURE_LEFT_TREE > $2 AND a0_.STRUCTURE_RIGHT_TREE < $3 ORDER BY a0_.STRUCTURE_LEFT_TREE ASC;Times Reported Time consuming prepare #18
Day Hour Count Duration Avg duration 05 7 0ms 0ms 10 39 4ms 0ms 11 4 0ms 0ms 12 4 0ms 0ms 13 22 2ms 0ms 15 11 1ms 0ms 16 12 1ms 0ms 17 30 3ms 0ms 18 31 3ms 0ms 19 7 0ms 0ms 21 3 0ms 0ms 22 8 1ms 0ms 23 3 0ms 0ms 06 20 2ms 0ms 09 8 0ms 0ms 10 14 1ms 0ms 12 18 2ms 0ms 14 106 8ms 0ms 17 24 2ms 0ms 20 8 0ms 0ms 21 30 2ms 0ms 05 36 1ms 0ms 06 768 39ms 0ms 07 810 38ms 0ms 08 5,902 278ms 0ms 09 2,952 137ms 0ms 10 1,348 61ms 0ms 11 1,080 53ms 0ms 12 322 22ms 0ms 13 1,090 54ms 0ms 14 228 11ms 0ms 15 188 14ms 0ms 17 432 50ms 0ms 18 138 15ms 0ms 19 172 20ms 0ms 20 80 9ms 0ms 21 26 2ms 0ms 22 130 13ms 0ms 05 132 5ms 0ms 06 1,122 54ms 0ms 07 1,986 94ms 0ms 08 2,576 125ms 0ms 09 970 56ms 0ms 10 2,064 87ms 0ms 11 1,564 69ms 0ms 12 3,532 145ms 0ms 13 1,166 51ms 0ms 14 346 18ms 0ms 15 72 6ms 0ms 16 40 4ms 0ms 17 14 1ms 0ms 20 16 1ms 0ms 22 10 1ms 0ms 01 7 0ms 0ms 05 148 7ms 0ms 06 2,096 94ms 0ms 07 5,950 259ms 0ms 08 3,460 178ms 0ms 09 774 40ms 0ms 10 4,526 188ms 0ms 11 1,388 73ms 0ms 12 622 34ms 0ms 13 918 41ms 0ms 14 1,002 48ms 0ms 15 298 16ms 0ms 16 30 4ms 0ms 17 8 1ms 0ms 18 42 4ms 0ms 19 28 3ms 0ms 21 36 4ms 0ms 22 62 7ms 0ms 05 8 1ms 0ms 06 1,848 71ms 0ms 07 3,270 134ms 0ms 08 5,884 243ms 0ms 09 1,254 54ms 0ms 10 1,134 46ms 0ms 11 856 39ms 0ms 12 784 44ms 0ms 13 366 21ms 0ms 14 764 35ms 0ms 15 1,708 74ms 0ms 17 8 0ms 0ms 20 16 1ms 0ms 22 36 3ms 0ms 23 3 0ms 0ms 04 24 2ms 0ms 05 36 3ms 0ms 06 2,016 91ms 0ms 07 1,410 68ms 0ms 08 2,112 103ms 0ms 09 2,061 88ms 0ms 10 933 53ms 0ms 11 882 43ms 0ms 12 4,863 201ms 0ms 13 1,260 56ms 0ms 14 18 1ms 0ms 16 12 1ms 0ms 17 21 2ms 0ms 18 57 6ms 0ms 19 21 2ms 0ms 22 21 2ms 0ms 23 6 0ms 0ms 07 24 3ms 0ms 08 21 2ms 0ms 09 6 0ms 0ms 10 21 2ms 0ms 11 48 5ms 0ms 12 480 21ms 0ms 13 21 2ms 0ms 16 75 8ms 0ms 17 87 10ms 0ms 18 15 1ms 0ms 19 21 2ms 0ms 20 12 1ms 0ms 21 12 1ms 0ms 22 39 4ms 0ms [ User: tng_migration_user - Total duration: 2s519ms - Times executed: 87690 ]
[ Application: [unknown] - Total duration: 2s519ms - Times executed: 87690 ]
-
SELECT a0_.ID AS id_0, a0_.NAME AS name_1, a0_.ACRONYM AS acronym_2, a0_.DESCRIPTION AS description_3, a0_.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_4, a0_.STRUCTURE_LEFT_TREE AS structure_left_tree_5, a0_.STRUCTURE_RIGHT_TREE AS structure_right_tree_6, a0_.INFO AS info_7 FROM ACL_GROUP a0_ WHERE a0_.STRUCTURE_ROOT_GROUP_ID = $1 AND a0_.STRUCTURE_LEFT_TREE > $2 AND a0_.STRUCTURE_RIGHT_TREE < $3 ORDER BY a0_.STRUCTURE_LEFT_TREE ASC;
Date: 2025-12-03 07:57:08 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT a0_.ID AS id_0, a0_.NAME AS name_1, a0_.ACRONYM AS acronym_2, a0_.DESCRIPTION AS description_3, a0_.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_4, a0_.STRUCTURE_LEFT_TREE AS structure_left_tree_5, a0_.STRUCTURE_RIGHT_TREE AS structure_right_tree_6, a0_.INFO AS info_7 FROM ACL_GROUP a0_ WHERE a0_.STRUCTURE_ROOT_GROUP_ID = $1 AND a0_.STRUCTURE_LEFT_TREE > $2 AND a0_.STRUCTURE_RIGHT_TREE < $3 ORDER BY a0_.STRUCTURE_LEFT_TREE ASC;
Date: 2025-12-03 11:04:26 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT a0_.ID AS id_0, a0_.NAME AS name_1, a0_.ACRONYM AS acronym_2, a0_.DESCRIPTION AS description_3, a0_.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_4, a0_.STRUCTURE_LEFT_TREE AS structure_left_tree_5, a0_.STRUCTURE_RIGHT_TREE AS structure_right_tree_6, a0_.INFO AS info_7 FROM ACL_GROUP a0_ WHERE a0_.STRUCTURE_ROOT_GROUP_ID = $1 AND a0_.STRUCTURE_LEFT_TREE > $2 AND a0_.STRUCTURE_RIGHT_TREE < $3 ORDER BY a0_.STRUCTURE_LEFT_TREE ASC;
Date: 2025-12-01 12:47:48 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
19 4s151ms 39,247 0ms 6ms 0ms SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = $1 AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;Times Reported Time consuming prepare #19
Day Hour Count Duration Avg duration 14 200 16ms 0ms 05 200 16ms 0ms 06 596 72ms 0ms 07 824 77ms 0ms 08 1,268 129ms 0ms 09 1,466 154ms 0ms 10 2,494 243ms 0ms 11 1,714 172ms 0ms 12 206 20ms 0ms 13 248 27ms 0ms 14 202 19ms 0ms 22 610 57ms 0ms 05 410 39ms 0ms 06 1,678 161ms 0ms 07 1,954 197ms 0ms 08 456 44ms 0ms 09 518 51ms 0ms 10 634 71ms 0ms 11 1,100 115ms 0ms 12 684 88ms 0ms 13 206 20ms 0ms 14 202 18ms 0ms 05 204 19ms 0ms 06 226 31ms 0ms 07 2,122 247ms 0ms 08 2,082 220ms 0ms 09 400 35ms 0ms 10 3,130 293ms 0ms 11 738 73ms 0ms 12 204 18ms 0ms 13 424 43ms 0ms 14 8 1ms 0ms 06 242 43ms 0ms 07 670 88ms 0ms 08 1,146 143ms 0ms 09 684 63ms 0ms 10 22 13ms 0ms 11 404 38ms 0ms 12 606 54ms 0ms 13 200 17ms 0ms 14 416 38ms 0ms 15 234 34ms 0ms 06 1,095 133ms 0ms 07 660 84ms 0ms 08 669 96ms 0ms 09 999 96ms 0ms 10 906 81ms 0ms 11 300 28ms 0ms 12 2,040 226ms 0ms 13 546 67ms 0ms [ User: tng_migration_user - Total duration: 54s717ms - Times executed: 39247 ]
[ Application: [unknown] - Total duration: 54s717ms - Times executed: 39247 ]
-
SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = $1 AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;
Date: 2025-12-05 07:20:35 Duration: 6ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = $1 AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;
Date: 2025-12-02 08:28:15 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = $1 AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;
Date: 2025-12-01 10:31:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
20 3s942ms 12,164 0ms 4ms 0ms SELECT a0_.NAME AS name_0, a1_.NAME AS name_1, a2_.DATA_OWN_USER AS data_own_user_2, a2_.DATA_OWN_SUBGROUP AS data_own_subgroup_3, a2_.DATA_OWN AS data_own_4, a2_.DATA_GROUP AS data_group_5, a2_.DATA_SUBGROUP AS data_subgroup_6, a2_.DATA_ALL AS data_all_7, a2_.DATA_SPECIAL_PARAMETER AS data_special_parameter_8 FROM ACL_PERMISSION a2_ INNER JOIN ACL_RESOURCE a0_ ON a2_.RESOURCE_ID = a0_.ID INNER JOIN ACL_ACTIVITY a1_ ON a2_.ACTIVITY_ID = a1_.ID WHERE a2_.ROLE_ID IN ($1) ORDER BY a0_.NAME ASC, a1_.NAME ASC;Times Reported Time consuming prepare #20
Day Hour Count Duration Avg duration 05 7 2ms 0ms 10 39 11ms 0ms 11 4 1ms 0ms 12 4 1ms 0ms 13 22 6ms 0ms 15 11 3ms 0ms 16 12 3ms 0ms 17 30 8ms 0ms 18 31 10ms 0ms 19 7 2ms 0ms 21 3 1ms 0ms 22 8 2ms 0ms 23 3 1ms 0ms 06 20 7ms 0ms 09 8 2ms 0ms 10 14 4ms 0ms 12 18 6ms 0ms 14 52 17ms 0ms 17 24 6ms 0ms 20 8 2ms 0ms 21 30 8ms 0ms 05 6 1ms 0ms 06 124 40ms 0ms 07 98 31ms 0ms 08 738 237ms 0ms 09 352 113ms 0ms 10 152 50ms 0ms 11 170 52ms 0ms 12 142 43ms 0ms 13 186 58ms 0ms 14 36 11ms 0ms 15 90 28ms 0ms 17 432 131ms 0ms 18 138 42ms 0ms 19 172 55ms 0ms 20 80 24ms 0ms 21 26 7ms 0ms 22 90 28ms 0ms 05 12 4ms 0ms 06 126 44ms 0ms 07 246 78ms 0ms 08 336 111ms 0ms 09 228 73ms 0ms 10 156 49ms 0ms 11 168 53ms 0ms 12 232 75ms 0ms 13 118 38ms 0ms 14 86 26ms 0ms 15 52 15ms 0ms 16 40 12ms 0ms 17 14 4ms 0ms 20 16 5ms 0ms 22 10 2ms 0ms 01 7 2ms 0ms 05 28 9ms 0ms 06 196 66ms 0ms 07 524 182ms 0ms 08 534 185ms 0ms 09 184 56ms 0ms 10 292 101ms 0ms 11 256 87ms 0ms 12 126 42ms 0ms 13 86 29ms 0ms 14 154 48ms 0ms 15 70 23ms 0ms 16 30 10ms 0ms 17 8 3ms 0ms 18 42 13ms 0ms 19 28 8ms 0ms 21 36 11ms 0ms 22 62 20ms 0ms 05 8 2ms 0ms 06 88 29ms 0ms 07 242 81ms 0ms 08 422 135ms 0ms 09 126 39ms 0ms 10 86 27ms 0ms 11 112 33ms 0ms 12 220 65ms 0ms 13 102 33ms 0ms 14 110 32ms 0ms 15 178 55ms 0ms 17 8 2ms 0ms 20 16 5ms 0ms 22 36 10ms 0ms 23 3 1ms 0ms 04 24 20ms 0ms 05 36 11ms 0ms 06 240 75ms 0ms 07 222 69ms 0ms 08 336 107ms 0ms 09 207 62ms 0ms 10 243 77ms 0ms 11 138 44ms 0ms 12 327 109ms 0ms 13 126 41ms 0ms 14 18 5ms 0ms 16 12 3ms 0ms 17 21 7ms 0ms 18 57 16ms 0ms 19 21 6ms 0ms 22 21 6ms 0ms 23 6 1ms 0ms 07 24 10ms 0ms 08 21 5ms 0ms 09 6 1ms 0ms 10 21 6ms 0ms 11 48 15ms 0ms 12 60 17ms 0ms 13 21 6ms 0ms 16 75 23ms 0ms 17 87 27ms 0ms 18 15 5ms 0ms 19 21 7ms 0ms 20 12 3ms 0ms 21 12 3ms 0ms 22 39 12ms 0ms [ User: tng_migration_user - Total duration: 1s516ms - Times executed: 12164 ]
[ Application: [unknown] - Total duration: 1s516ms - Times executed: 12164 ]
-
SELECT a0_.NAME AS name_0, a1_.NAME AS name_1, a2_.DATA_OWN_USER AS data_own_user_2, a2_.DATA_OWN_SUBGROUP AS data_own_subgroup_3, a2_.DATA_OWN AS data_own_4, a2_.DATA_GROUP AS data_group_5, a2_.DATA_SUBGROUP AS data_subgroup_6, a2_.DATA_ALL AS data_all_7, a2_.DATA_SPECIAL_PARAMETER AS data_special_parameter_8 FROM ACL_PERMISSION a2_ INNER JOIN ACL_RESOURCE a0_ ON a2_.RESOURCE_ID = a0_.ID INNER JOIN ACL_ACTIVITY a1_ ON a2_.ACTIVITY_ID = a1_.ID WHERE a2_.ROLE_ID IN ($1) ORDER BY a0_.NAME ASC, a1_.NAME ASC;
Date: 2025-12-05 05:29:20 Duration: 4ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT a0_.NAME AS name_0, a1_.NAME AS name_1, a2_.DATA_OWN_USER AS data_own_user_2, a2_.DATA_OWN_SUBGROUP AS data_own_subgroup_3, a2_.DATA_OWN AS data_own_4, a2_.DATA_GROUP AS data_group_5, a2_.DATA_SUBGROUP AS data_subgroup_6, a2_.DATA_ALL AS data_all_7, a2_.DATA_SPECIAL_PARAMETER AS data_special_parameter_8 FROM ACL_PERMISSION a2_ INNER JOIN ACL_RESOURCE a0_ ON a2_.RESOURCE_ID = a0_.ID INNER JOIN ACL_ACTIVITY a1_ ON a2_.ACTIVITY_ID = a1_.ID WHERE a2_.ROLE_ID IN ($1) ORDER BY a0_.NAME ASC, a1_.NAME ASC;
Date: 2025-12-05 07:44:57 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT a0_.NAME AS name_0, a1_.NAME AS name_1, a2_.DATA_OWN_USER AS data_own_user_2, a2_.DATA_OWN_SUBGROUP AS data_own_subgroup_3, a2_.DATA_OWN AS data_own_4, a2_.DATA_GROUP AS data_group_5, a2_.DATA_SUBGROUP AS data_subgroup_6, a2_.DATA_ALL AS data_all_7, a2_.DATA_SPECIAL_PARAMETER AS data_special_parameter_8 FROM ACL_PERMISSION a2_ INNER JOIN ACL_RESOURCE a0_ ON a2_.RESOURCE_ID = a0_.ID INNER JOIN ACL_ACTIVITY a1_ ON a2_.ACTIVITY_ID = a1_.ID WHERE a2_.ROLE_ID IN ($1) ORDER BY a0_.NAME ASC, a1_.NAME ASC;
Date: 2025-12-03 08:30:47 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
Time consuming bind
Rank Total duration Times executed Min duration Max duration Avg duration Query 1 2m3s 1,008,966 0ms 15ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = $1;Times Reported Time consuming bind #1
Day Hour Count Duration Avg duration Dec 06 04 2,191 273ms 0ms 05 2,527 312ms 0ms 06 2,737 341ms 0ms 07 2,730 320ms 0ms 08 2,730 326ms 0ms 09 2,730 323ms 0ms 10 2,730 326ms 0ms 11 2,730 329ms 0ms 12 2,730 331ms 0ms 13 2,730 334ms 0ms 14 2,730 329ms 0ms 15 2,730 335ms 0ms 16 2,730 330ms 0ms 17 2,702 325ms 0ms 18 2,730 330ms 0ms 19 2,730 324ms 0ms 20 2,730 322ms 0ms 21 2,730 328ms 0ms 22 2,730 335ms 0ms 23 2,730 334ms 0ms Dec 06 00 2,520 310ms 0ms 01 2,520 307ms 0ms 02 2,520 308ms 0ms 03 2,520 310ms 0ms 04 4,914 620ms 0ms 05 5,054 619ms 0ms 06 5,474 661ms 0ms 07 5,460 673ms 0ms 08 5,460 670ms 0ms 09 5,460 657ms 0ms 10 5,460 672ms 0ms 11 5,460 666ms 0ms 12 5,460 667ms 0ms 13 5,460 660ms 0ms 14 5,460 669ms 0ms 15 5,460 669ms 0ms 16 5,460 667ms 0ms 17 5,404 642ms 0ms 18 5,460 664ms 0ms 19 5,460 658ms 0ms 20 5,460 674ms 0ms 21 5,460 667ms 0ms 22 5,460 666ms 0ms 23 5,152 623ms 0ms Dec 06 00 2,520 313ms 0ms 01 2,520 316ms 0ms 02 2,520 313ms 0ms 03 2,520 309ms 0ms 04 4,816 586ms 0ms 05 5,054 634ms 0ms 06 5,474 670ms 0ms 07 5,460 668ms 0ms 08 5,460 655ms 0ms 09 5,460 661ms 0ms 10 5,460 667ms 0ms 11 5,446 669ms 0ms 12 5,460 666ms 0ms 13 5,460 674ms 0ms 14 5,460 655ms 0ms 15 5,460 673ms 0ms 16 5,460 684ms 0ms 17 5,404 660ms 0ms 18 5,474 659ms 0ms 19 5,460 663ms 0ms 20 5,460 668ms 0ms 21 5,460 677ms 0ms 22 5,460 678ms 0ms 23 5,460 672ms 0ms Dec 06 00 2,520 309ms 0ms 01 2,520 309ms 0ms 02 2,520 307ms 0ms 03 2,520 304ms 0ms 04 4,781 584ms 0ms 05 5,054 617ms 0ms 06 5,474 692ms 0ms 07 5,460 673ms 0ms 08 5,474 690ms 0ms 09 5,460 680ms 0ms 10 5,460 677ms 0ms 11 5,460 680ms 0ms 12 5,460 669ms 0ms 13 5,460 674ms 0ms 14 5,460 676ms 0ms 15 5,460 677ms 0ms 16 5,460 689ms 0ms 17 5,418 671ms 0ms 18 5,474 687ms 0ms 19 5,460 676ms 0ms 20 5,460 692ms 0ms 21 5,460 684ms 0ms 22 5,460 688ms 0ms 23 5,460 667ms 0ms Dec 06 00 2,520 315ms 0ms 01 2,520 315ms 0ms 02 2,520 321ms 0ms 03 2,520 311ms 0ms 04 4,746 589ms 0ms 05 5,054 641ms 0ms 06 5,474 701ms 0ms 07 5,474 682ms 0ms 08 5,460 692ms 0ms 09 5,474 702ms 0ms 10 5,474 687ms 0ms 11 5,460 676ms 0ms 12 5,460 689ms 0ms 13 5,474 687ms 0ms 14 5,460 695ms 0ms 15 5,460 689ms 0ms 16 5,460 686ms 0ms 17 5,404 670ms 0ms 18 5,474 719ms 0ms 19 5,460 655ms 0ms 20 5,460 675ms 0ms 21 5,460 677ms 0ms 22 5,460 667ms 0ms 23 5,460 668ms 0ms Dec 06 00 2,520 310ms 0ms 01 2,520 309ms 0ms 02 2,520 314ms 0ms 03 2,520 311ms 0ms 04 4,711 598ms 0ms 05 5,054 627ms 0ms 06 5,460 694ms 0ms 07 5,460 674ms 0ms 08 5,460 687ms 0ms 09 5,460 681ms 0ms 10 5,474 661ms 0ms 11 5,460 670ms 0ms 12 5,460 686ms 0ms 13 5,460 657ms 0ms 14 5,474 682ms 0ms 15 5,460 679ms 0ms 16 5,460 672ms 0ms 17 5,418 659ms 0ms 18 5,460 653ms 0ms 19 5,460 661ms 0ms 20 5,460 670ms 0ms 21 5,460 676ms 0ms 22 5,460 668ms 0ms 23 5,460 677ms 0ms Dec 06 00 2,520 312ms 0ms 01 2,520 311ms 0ms 02 2,520 307ms 0ms 03 2,520 305ms 0ms 04 6,888 865ms 0ms 05 7,581 909ms 0ms 06 8,211 995ms 0ms 07 8,211 987ms 0ms 08 8,190 991ms 0ms 09 8,190 990ms 0ms 10 8,211 966ms 0ms 11 8,190 978ms 0ms 12 8,190 996ms 0ms 13 8,190 1s1ms 0ms 14 8,190 985ms 0ms 15 8,190 976ms 0ms 16 8,190 990ms 0ms 17 8,106 980ms 0ms 18 8,190 995ms 0ms 19 8,190 986ms 0ms 20 8,190 988ms 0ms 21 8,190 1s23ms 0ms 22 8,190 1s8ms 0ms 23 8,190 1s10ms 0ms Dec 06 00 5,040 622ms 0ms 01 5,040 612ms 0ms 02 5,040 617ms 0ms 03 5,040 616ms 0ms 04 7,224 907ms 0ms 05 7,581 912ms 0ms 06 8,211 1s1ms 0ms 07 8,190 977ms 0ms 08 8,190 995ms 0ms 09 8,190 985ms 0ms 10 8,190 986ms 0ms 11 8,190 972ms 0ms 12 8,190 1s19ms 0ms 13 8,190 976ms 0ms 14 8,190 976ms 0ms 15 8,190 977ms 0ms 16 8,190 998ms 0ms 17 8,106 978ms 0ms 18 8,190 991ms 0ms 19 8,190 986ms 0ms 20 8,190 1s2ms 0ms 21 8,190 1s13ms 0ms 22 8,190 1s15ms 0ms 23 8,190 1s5ms 0ms Dec 06 00 2,513 309ms 0ms 01 2,520 310ms 0ms 02 2,520 306ms 0ms 03 2,520 312ms 0ms 04 126 15ms 0ms [ User: tng_migration_user - Total duration: 19s312ms - Times executed: 1008966 ]
[ Application: [unknown] - Total duration: 19s312ms - Times executed: 1008966 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = $1;
Date: 2025-12-03 18:52:25 Duration: 15ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = $1;
Date: 2025-12-04 06:43:01 Duration: 10ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'READY'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_type t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_type_code WHERE core.notif_type_state.notif_state_code = $1;
Date: 2025-12-01 05:02:25 Duration: 8ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR'
2 1m18s 134,962 0ms 52ms 0ms SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;Times Reported Time consuming bind #2
Day Hour Count Duration Avg duration 03 313 197ms 0ms 04 360 221ms 0ms 05 360 222ms 0ms 06 360 210ms 0ms 07 360 211ms 0ms 08 360 211ms 0ms 09 360 213ms 0ms 10 360 217ms 0ms 11 360 216ms 0ms 12 360 224ms 0ms 13 360 217ms 0ms 14 360 223ms 0ms 15 360 213ms 0ms 16 360 212ms 0ms 17 360 217ms 0ms 18 360 209ms 0ms 19 360 209ms 0ms 20 360 212ms 0ms 21 360 215ms 0ms 22 360 216ms 0ms 23 360 246ms 0ms 00 360 220ms 0ms 01 360 226ms 0ms 02 360 226ms 0ms 03 702 456ms 0ms 04 720 450ms 0ms 05 720 445ms 0ms 06 720 459ms 0ms 07 720 461ms 0ms 08 720 445ms 0ms 09 720 458ms 0ms 10 720 454ms 0ms 11 720 456ms 0ms 12 720 444ms 0ms 13 720 451ms 0ms 14 720 461ms 0ms 15 720 454ms 0ms 16 720 441ms 0ms 17 720 455ms 0ms 18 720 449ms 0ms 19 720 458ms 0ms 20 720 450ms 0ms 21 720 450ms 0ms 22 676 416ms 0ms 23 360 236ms 0ms 00 360 234ms 0ms 01 360 235ms 0ms 02 360 230ms 0ms 03 688 532ms 0ms 04 720 492ms 0ms 05 720 460ms 0ms 06 720 461ms 0ms 07 720 455ms 0ms 08 720 451ms 0ms 09 720 460ms 0ms 10 718 472ms 0ms 11 720 470ms 0ms 12 720 463ms 0ms 13 720 451ms 0ms 14 720 467ms 0ms 15 720 474ms 0ms 16 720 464ms 0ms 17 720 457ms 0ms 18 720 469ms 0ms 19 720 466ms 0ms 20 720 474ms 0ms 21 720 471ms 0ms 22 720 461ms 0ms 23 360 234ms 0ms 00 360 235ms 0ms 01 360 234ms 0ms 02 360 231ms 0ms 03 683 442ms 0ms 04 720 438ms 0ms 05 720 465ms 0ms 06 720 451ms 0ms 07 720 481ms 0ms 08 720 460ms 0ms 09 720 459ms 0ms 10 720 451ms 0ms 11 720 453ms 0ms 12 720 449ms 0ms 13 720 450ms 0ms 14 720 450ms 0ms 15 720 463ms 0ms 16 720 465ms 0ms 17 720 482ms 0ms 18 720 463ms 0ms 19 720 484ms 0ms 20 720 470ms 0ms 21 720 476ms 0ms 22 720 458ms 0ms 23 360 235ms 0ms 00 360 236ms 0ms 01 360 241ms 0ms 02 360 229ms 0ms 03 678 429ms 0ms 04 720 560ms 0ms 05 720 558ms 0ms 06 720 546ms 0ms 07 720 549ms 0ms 08 720 558ms 0ms 09 720 547ms 0ms 10 720 533ms 0ms 11 720 543ms 0ms 12 720 555ms 0ms 13 720 563ms 0ms 14 720 562ms 0ms 15 720 549ms 0ms 16 720 462ms 0ms 17 720 574ms 0ms 18 720 418ms 0ms 19 720 435ms 0ms 20 720 435ms 0ms 21 720 431ms 0ms 22 720 430ms 0ms 23 360 218ms 0ms 00 360 217ms 0ms 01 360 218ms 0ms 02 360 218ms 0ms 03 673 425ms 0ms 04 720 451ms 0ms 05 718 412ms 0ms 06 720 357ms 0ms 07 720 360ms 0ms 08 720 358ms 0ms 09 720 345ms 0ms 10 720 351ms 0ms 11 720 366ms 0ms 12 720 342ms 0ms 13 720 364ms 0ms 14 720 361ms 0ms 15 720 358ms 0ms 16 720 358ms 0ms 17 720 351ms 0ms 18 720 355ms 0ms 19 720 363ms 0ms 20 720 366ms 0ms 21 720 355ms 0ms 22 720 367ms 0ms 23 360 183ms 0ms 00 360 181ms 0ms 01 360 176ms 0ms 02 360 178ms 0ms 03 984 507ms 0ms 04 1,080 513ms 0ms 05 1,080 538ms 0ms 06 1,080 529ms 0ms 07 1,080 531ms 0ms 08 1,080 532ms 0ms 09 1,080 507ms 0ms 10 1,080 527ms 0ms 11 1,080 539ms 0ms 12 1,080 539ms 0ms 13 1,080 530ms 0ms 14 1,080 516ms 0ms 15 1,080 535ms 0ms 16 1,080 524ms 0ms 17 1,080 536ms 0ms 18 1,080 529ms 0ms 19 1,080 529ms 0ms 20 1,080 549ms 0ms 21 1,080 545ms 0ms 22 1,080 535ms 0ms 23 720 362ms 0ms 00 720 361ms 0ms 01 720 365ms 0ms 02 720 352ms 0ms 03 1,032 541ms 0ms 04 1,080 522ms 0ms 05 1,080 539ms 0ms 06 1,080 520ms 0ms 07 1,080 539ms 0ms 08 1,080 523ms 0ms 09 1,080 527ms 0ms 10 1,080 506ms 0ms 11 1,080 562ms 0ms 12 1,080 529ms 0ms 13 1,080 522ms 0ms 14 1,080 528ms 0ms 15 1,080 539ms 0ms 16 1,080 526ms 0ms 17 1,080 532ms 0ms 18 1,080 525ms 0ms 19 1,080 546ms 0ms 20 1,080 549ms 0ms 21 1,080 542ms 0ms 22 1,080 538ms 0ms 23 359 176ms 0ms 00 360 181ms 0ms 01 360 181ms 0ms 02 360 177ms 0ms 03 18 8ms 0ms [ User: tng_migration_user - Total duration: 16s372ms - Times executed: 134962 ]
[ Application: [unknown] - Total duration: 16s372ms - Times executed: 134962 ]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-12-01 04:14:56 Duration: 52ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-12-03 18:53:42 Duration: 43ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-30 00:01:42 Duration: 20ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
3 1m15s 532,252 0ms 14ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = $1;Times Reported Time consuming bind #3
Day Hour Count Duration Avg duration 04 1,386 182ms 0ms 05 1,613 220ms 0ms 06 1,540 211ms 0ms 07 1,540 200ms 0ms 08 1,540 214ms 0ms 09 1,540 204ms 0ms 10 1,790 255ms 0ms 11 1,568 212ms 0ms 12 1,568 211ms 0ms 13 1,760 243ms 0ms 14 1,540 207ms 0ms 15 1,639 230ms 0ms 16 1,488 204ms 0ms 17 1,733 237ms 0ms 18 1,786 258ms 0ms 19 1,617 215ms 0ms 20 1,543 206ms 0ms 21 1,603 219ms 0ms 22 1,597 218ms 0ms 23 28 5ms 0ms 04 3,080 408ms 0ms 05 3,082 418ms 0ms 06 3,252 454ms 0ms 07 3,084 416ms 0ms 08 3,082 436ms 0ms 09 3,112 432ms 0ms 10 3,196 447ms 0ms 11 3,084 425ms 0ms 12 3,230 455ms 0ms 13 3,094 421ms 0ms 14 3,458 512ms 0ms 15 3,080 413ms 0ms 16 2,772 378ms 0ms 17 3,154 415ms 0ms 18 3,082 408ms 0ms 19 3,080 428ms 0ms 20 3,188 439ms 0ms 21 3,732 506ms 0ms 22 3,080 435ms 0ms 04 2,772 389ms 0ms 05 3,080 418ms 0ms 06 3,254 467ms 0ms 07 3,252 458ms 0ms 08 4,468 707ms 0ms 09 3,904 574ms 0ms 10 3,170 431ms 0ms 11 3,242 464ms 0ms 12 3,110 422ms 0ms 13 3,140 438ms 0ms 14 3,212 426ms 0ms 15 3,670 546ms 0ms 16 2,772 424ms 0ms 17 6,740 946ms 0ms 18 4,302 593ms 0ms 19 4,724 655ms 0ms 20 3,864 544ms 0ms 21 3,442 462ms 0ms 22 3,488 485ms 0ms 01 1 0ms 0ms 02 1 0ms 0ms 04 2,772 377ms 0ms 05 3,080 424ms 0ms 06 3,186 492ms 0ms 07 3,420 476ms 0ms 08 3,754 541ms 0ms 09 3,984 592ms 0ms 10 3,316 470ms 0ms 11 3,662 535ms 0ms 12 3,744 534ms 0ms 13 3,650 535ms 0ms 14 3,316 476ms 0ms 15 3,302 495ms 0ms 16 3,452 484ms 0ms 17 3,230 455ms 0ms 18 3,080 424ms 0ms 19 3,080 423ms 0ms 20 3,198 464ms 0ms 21 3,080 415ms 0ms 22 3,244 447ms 0ms 01 56 9ms 0ms 04 3,080 430ms 0ms 05 3,174 477ms 0ms 06 3,716 532ms 0ms 07 3,750 566ms 0ms 08 3,886 591ms 0ms 09 3,432 498ms 0ms 10 3,562 505ms 0ms 11 3,932 577ms 0ms 12 3,184 455ms 0ms 13 3,358 454ms 0ms 14 3,498 488ms 0ms 15 3,372 499ms 0ms 16 3,048 417ms 0ms 17 3,136 456ms 0ms 18 3,418 454ms 0ms 19 3,298 470ms 0ms 20 3,080 419ms 0ms 21 3,710 532ms 0ms 22 3,486 498ms 0ms 04 3,080 427ms 0ms 05 3,152 471ms 0ms 06 3,140 427ms 0ms 07 3,228 456ms 0ms 08 3,538 519ms 0ms 09 3,124 429ms 0ms 10 3,268 472ms 0ms 11 3,398 488ms 0ms 12 3,238 440ms 0ms 13 3,848 572ms 0ms 14 3,178 439ms 0ms 15 3,186 467ms 0ms 16 3,080 423ms 0ms 17 3,120 435ms 0ms 18 3,080 432ms 0ms 19 3,080 433ms 0ms 20 3,304 482ms 0ms 21 3,080 426ms 0ms 22 3,242 458ms 0ms 23 27 4ms 0ms 04 4,332 656ms 0ms 05 4,890 679ms 0ms 06 4,992 732ms 0ms 07 5,367 789ms 0ms 08 5,229 761ms 0ms 09 4,716 653ms 0ms 10 4,980 718ms 0ms 11 5,373 777ms 0ms 12 5,106 758ms 0ms 13 4,701 661ms 0ms 14 4,620 638ms 0ms 15 4,620 643ms 0ms 16 4,236 565ms 0ms 17 4,788 669ms 0ms 18 5,139 737ms 0ms 19 4,776 681ms 0ms 20 4,620 634ms 0ms 21 4,620 703ms 0ms 22 4,791 667ms 0ms 23 56 9ms 0ms 04 4,620 611ms 0ms 05 4,620 655ms 0ms 06 4,620 684ms 0ms 07 4,746 663ms 0ms 08 4,788 659ms 0ms 09 4,620 635ms 0ms 10 4,638 624ms 0ms 11 4,887 672ms 0ms 12 4,629 687ms 0ms 13 4,794 660ms 0ms 14 4,620 617ms 0ms 15 4,620 627ms 0ms 16 4,758 633ms 0ms 17 5,358 776ms 0ms 18 4,704 637ms 0ms 19 4,833 665ms 0ms 20 4,752 668ms 0ms 21 4,698 674ms 0ms 22 4,929 748ms 0ms [ User: tng_migration_user - Total duration: 16s94ms - Times executed: 532252 ]
[ Application: [unknown] - Total duration: 16s94ms - Times executed: 532252 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = $1;
Date: 2025-12-05 05:12:02 Duration: 14ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = $1;
Date: 2025-12-03 18:54:02 Duration: 10ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.name AS name_5, t0.description AS description_6, t0.is_automatic AS is_automatic_7, t0.is_recruitment AS is_recruitment_8, t0.is_welcome AS is_welcome_9, t0.welcome_message AS welcome_message_10, t0.biobank_id AS biobank_id_11, t0.owner_user_id AS owner_user_id_12, t0.owner_group_id AS owner_group_id_13, t0.pilot_id AS pilot_id_14, t0.subcohort_state_code AS subcohort_state_code_15, t0.inform_consent_id AS inform_consent_id_16 FROM core.subcohort t0 INNER JOIN core.subcohort_form_structure_variant ON t0.id = core.subcohort_form_structure_variant.subcohort_id WHERE core.subcohort_form_structure_variant.form_structure_variant_id = $1;
Date: 2025-12-04 06:48:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13'
4 49s40ms 576,552 0ms 1ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;Times Reported Time consuming bind #4
Day Hour Count Duration Avg duration 03 1,252 107ms 0ms 04 1,444 124ms 0ms 05 1,564 134ms 0ms 06 1,560 128ms 0ms 07 1,560 130ms 0ms 08 1,560 129ms 0ms 09 1,560 130ms 0ms 10 1,560 131ms 0ms 11 1,560 131ms 0ms 12 1,560 132ms 0ms 13 1,560 131ms 0ms 14 1,560 133ms 0ms 15 1,560 131ms 0ms 16 1,544 130ms 0ms 17 1,560 132ms 0ms 18 1,560 129ms 0ms 19 1,560 128ms 0ms 20 1,560 131ms 0ms 21 1,560 134ms 0ms 22 1,560 132ms 0ms 23 1,440 123ms 0ms 00 1,440 124ms 0ms 01 1,440 123ms 0ms 02 1,440 123ms 0ms 03 2,808 245ms 0ms 04 2,888 248ms 0ms 05 3,128 265ms 0ms 06 3,120 268ms 0ms 07 3,120 267ms 0ms 08 3,120 261ms 0ms 09 3,120 266ms 0ms 10 3,120 267ms 0ms 11 3,120 265ms 0ms 12 3,120 264ms 0ms 13 3,120 264ms 0ms 14 3,120 263ms 0ms 15 3,120 265ms 0ms 16 3,088 260ms 0ms 17 3,120 265ms 0ms 18 3,120 263ms 0ms 19 3,120 268ms 0ms 20 3,120 264ms 0ms 21 3,120 265ms 0ms 22 2,944 249ms 0ms 23 1,440 123ms 0ms 00 1,440 125ms 0ms 01 1,440 125ms 0ms 02 1,440 123ms 0ms 03 2,752 235ms 0ms 04 2,888 247ms 0ms 05 3,128 266ms 0ms 06 3,120 265ms 0ms 07 3,120 261ms 0ms 08 3,120 265ms 0ms 09 3,120 264ms 0ms 10 3,112 266ms 0ms 11 3,120 266ms 0ms 12 3,120 267ms 0ms 13 3,120 262ms 0ms 14 3,120 267ms 0ms 15 3,120 269ms 0ms 16 3,088 263ms 0ms 17 3,128 262ms 0ms 18 3,120 262ms 0ms 19 3,120 265ms 0ms 20 3,120 269ms 0ms 21 3,120 266ms 0ms 22 3,120 267ms 0ms 23 1,440 123ms 0ms 00 1,440 122ms 0ms 01 1,440 122ms 0ms 02 1,440 121ms 0ms 03 2,732 236ms 0ms 04 2,888 246ms 0ms 05 3,128 269ms 0ms 06 3,120 264ms 0ms 07 3,128 269ms 0ms 08 3,120 267ms 0ms 09 3,120 268ms 0ms 10 3,120 267ms 0ms 11 3,120 265ms 0ms 12 3,120 264ms 0ms 13 3,120 267ms 0ms 14 3,120 267ms 0ms 15 3,120 270ms 0ms 16 3,096 266ms 0ms 17 3,128 271ms 0ms 18 3,120 268ms 0ms 19 3,120 273ms 0ms 20 3,120 270ms 0ms 21 3,120 271ms 0ms 22 3,120 266ms 0ms 23 1,440 125ms 0ms 00 1,440 126ms 0ms 01 1,440 125ms 0ms 02 1,440 124ms 0ms 03 2,712 234ms 0ms 04 2,888 250ms 0ms 05 3,128 273ms 0ms 06 3,128 268ms 0ms 07 3,120 268ms 0ms 08 3,128 274ms 0ms 09 3,128 269ms 0ms 10 3,120 266ms 0ms 11 3,120 270ms 0ms 12 3,128 267ms 0ms 13 3,120 269ms 0ms 14 3,120 269ms 0ms 15 3,120 267ms 0ms 16 3,088 264ms 0ms 17 3,128 271ms 0ms 18 3,120 261ms 0ms 19 3,120 267ms 0ms 20 3,120 265ms 0ms 21 3,120 264ms 0ms 22 3,120 265ms 0ms 23 1,440 122ms 0ms 00 1,440 123ms 0ms 01 1,440 123ms 0ms 02 1,440 123ms 0ms 03 2,692 237ms 0ms 04 2,888 248ms 0ms 05 3,120 266ms 0ms 06 3,120 263ms 0ms 07 3,120 266ms 0ms 08 3,120 268ms 0ms 09 3,128 262ms 0ms 10 3,120 261ms 0ms 11 3,120 264ms 0ms 12 3,120 260ms 0ms 13 3,128 264ms 0ms 14 3,120 263ms 0ms 15 3,120 264ms 0ms 16 3,096 262ms 0ms 17 3,120 261ms 0ms 18 3,120 262ms 0ms 19 3,120 266ms 0ms 20 3,120 267ms 0ms 21 3,120 266ms 0ms 22 3,120 265ms 0ms 23 1,440 123ms 0ms 00 1,440 123ms 0ms 01 1,440 122ms 0ms 02 1,440 122ms 0ms 03 3,936 344ms 0ms 04 4,332 364ms 0ms 05 4,692 394ms 0ms 06 4,692 392ms 0ms 07 4,680 393ms 0ms 08 4,680 394ms 0ms 09 4,692 387ms 0ms 10 4,680 391ms 0ms 11 4,680 393ms 0ms 12 4,680 395ms 0ms 13 4,680 390ms 0ms 14 4,680 391ms 0ms 15 4,680 394ms 0ms 16 4,632 389ms 0ms 17 4,680 394ms 0ms 18 4,680 392ms 0ms 19 4,680 391ms 0ms 20 4,680 403ms 0ms 21 4,680 397ms 0ms 22 4,680 399ms 0ms 23 2,880 246ms 0ms 00 2,880 244ms 0ms 01 2,880 245ms 0ms 02 2,880 245ms 0ms 03 4,128 357ms 0ms 04 4,332 363ms 0ms 05 4,692 396ms 0ms 06 4,680 390ms 0ms 07 4,680 392ms 0ms 08 4,680 394ms 0ms 09 4,680 390ms 0ms 10 4,680 388ms 0ms 11 4,680 400ms 0ms 12 4,680 391ms 0ms 13 4,680 389ms 0ms 14 4,680 388ms 0ms 15 4,680 393ms 0ms 16 4,632 391ms 0ms 17 4,680 393ms 0ms 18 4,680 393ms 0ms 19 4,680 396ms 0ms 20 4,680 399ms 0ms 21 4,680 400ms 0ms 22 4,680 398ms 0ms 23 1,436 123ms 0ms 00 1,440 122ms 0ms 01 1,440 121ms 0ms 02 1,440 123ms 0ms 03 72 5ms 0ms [ User: tng_migration_user - Total duration: 9s857ms - Times executed: 576552 ]
[ Application: [unknown] - Total duration: 9s857ms - Times executed: 576552 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-11-30 01:22:17 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'EMAIL_SENDED'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-11-29 14:09:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'PHONE'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-11-30 17:15:15 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'EMAIL_SENDED'
5 39s52ms 134,962 0ms 30ms 0ms SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;Times Reported Time consuming bind #5
Day Hour Count Duration Avg duration 03 313 94ms 0ms 04 360 106ms 0ms 05 360 107ms 0ms 06 360 99ms 0ms 07 360 101ms 0ms 08 360 101ms 0ms 09 360 102ms 0ms 10 360 104ms 0ms 11 360 105ms 0ms 12 360 108ms 0ms 13 360 103ms 0ms 14 360 106ms 0ms 15 360 103ms 0ms 16 360 105ms 0ms 17 360 104ms 0ms 18 360 98ms 0ms 19 360 100ms 0ms 20 360 105ms 0ms 21 360 105ms 0ms 22 360 103ms 0ms 23 360 107ms 0ms 00 360 107ms 0ms 01 360 108ms 0ms 02 360 107ms 0ms 03 702 219ms 0ms 04 720 217ms 0ms 05 720 214ms 0ms 06 720 219ms 0ms 07 720 217ms 0ms 08 720 211ms 0ms 09 720 219ms 0ms 10 720 218ms 0ms 11 720 214ms 0ms 12 720 212ms 0ms 13 720 212ms 0ms 14 720 221ms 0ms 15 720 219ms 0ms 16 720 210ms 0ms 17 720 218ms 0ms 18 720 213ms 0ms 19 720 217ms 0ms 20 720 217ms 0ms 21 720 218ms 0ms 22 676 201ms 0ms 23 360 111ms 0ms 00 360 113ms 0ms 01 360 112ms 0ms 02 360 110ms 0ms 03 688 207ms 0ms 04 720 274ms 0ms 05 720 210ms 0ms 06 720 210ms 0ms 07 720 205ms 0ms 08 720 205ms 0ms 09 720 208ms 0ms 10 718 210ms 0ms 11 720 209ms 0ms 12 720 212ms 0ms 13 720 204ms 0ms 14 720 211ms 0ms 15 720 215ms 0ms 16 720 227ms 0ms 17 720 215ms 0ms 18 720 214ms 0ms 19 720 218ms 0ms 20 720 219ms 0ms 21 720 222ms 0ms 22 720 216ms 0ms 23 360 109ms 0ms 00 360 110ms 0ms 01 360 109ms 0ms 02 360 107ms 0ms 03 683 203ms 0ms 04 720 208ms 0ms 05 720 219ms 0ms 06 720 212ms 0ms 07 720 224ms 0ms 08 720 214ms 0ms 09 720 214ms 0ms 10 720 215ms 0ms 11 720 212ms 0ms 12 720 211ms 0ms 13 720 211ms 0ms 14 720 212ms 0ms 15 720 217ms 0ms 16 720 212ms 0ms 17 720 214ms 0ms 18 720 208ms 0ms 19 720 213ms 0ms 20 720 215ms 0ms 21 720 214ms 0ms 22 720 207ms 0ms 23 360 108ms 0ms 00 360 109ms 0ms 01 360 109ms 0ms 02 360 105ms 0ms 03 678 199ms 0ms 04 720 252ms 0ms 05 720 259ms 0ms 06 720 248ms 0ms 07 720 251ms 0ms 08 720 260ms 0ms 09 720 251ms 0ms 10 720 244ms 0ms 11 720 250ms 0ms 12 720 254ms 0ms 13 720 260ms 0ms 14 720 256ms 0ms 15 720 252ms 0ms 16 720 216ms 0ms 17 720 215ms 0ms 18 720 205ms 0ms 19 720 217ms 0ms 20 720 213ms 0ms 21 720 213ms 0ms 22 720 214ms 0ms 23 360 108ms 0ms 00 360 109ms 0ms 01 360 109ms 0ms 02 360 108ms 0ms 03 673 208ms 0ms 04 720 218ms 0ms 05 718 206ms 0ms 06 720 198ms 0ms 07 720 199ms 0ms 08 720 200ms 0ms 09 720 193ms 0ms 10 720 199ms 0ms 11 720 201ms 0ms 12 720 188ms 0ms 13 720 199ms 0ms 14 720 197ms 0ms 15 720 197ms 0ms 16 720 198ms 0ms 17 720 190ms 0ms 18 720 195ms 0ms 19 720 199ms 0ms 20 720 202ms 0ms 21 720 195ms 0ms 22 720 200ms 0ms 23 360 100ms 0ms 00 360 99ms 0ms 01 360 97ms 0ms 02 360 97ms 0ms 03 984 278ms 0ms 04 1,080 285ms 0ms 05 1,080 289ms 0ms 06 1,080 288ms 0ms 07 1,080 290ms 0ms 08 1,080 292ms 0ms 09 1,080 278ms 0ms 10 1,080 286ms 0ms 11 1,080 291ms 0ms 12 1,080 296ms 0ms 13 1,080 291ms 0ms 14 1,080 283ms 0ms 15 1,080 289ms 0ms 16 1,080 290ms 0ms 17 1,080 292ms 0ms 18 1,080 286ms 0ms 19 1,080 289ms 0ms 20 1,080 303ms 0ms 21 1,080 299ms 0ms 22 1,080 295ms 0ms 23 720 196ms 0ms 00 720 196ms 0ms 01 720 197ms 0ms 02 720 194ms 0ms 03 1,032 289ms 0ms 04 1,080 290ms 0ms 05 1,080 293ms 0ms 06 1,080 283ms 0ms 07 1,080 291ms 0ms 08 1,080 287ms 0ms 09 1,080 286ms 0ms 10 1,080 278ms 0ms 11 1,080 304ms 0ms 12 1,080 287ms 0ms 13 1,080 279ms 0ms 14 1,080 283ms 0ms 15 1,080 290ms 0ms 16 1,080 287ms 0ms 17 1,080 293ms 0ms 18 1,080 290ms 0ms 19 1,080 294ms 0ms 20 1,080 298ms 0ms 21 1,080 296ms 0ms 22 1,080 290ms 0ms 23 359 96ms 0ms 00 360 99ms 0ms 01 360 97ms 0ms 02 360 98ms 0ms 03 18 4ms 0ms [ User: tng_migration_user - Total duration: 25s737ms - Times executed: 134962 ]
[ Application: [unknown] - Total duration: 25s737ms - Times executed: 134962 ]
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;
Date: 2025-12-01 05:02:25 Duration: 30ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR', $2 = '2025-11-24 05:02:25'
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;
Date: 2025-12-01 17:02:25 Duration: 5ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR', $2 = '2025-11-24 17:02:25'
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;
Date: 2025-11-29 13:21:15 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR', $2 = '2025-11-22 13:21:15'
6 29s755ms 375,453 0ms 0ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;Times Reported Time consuming bind #6
Day Hour Count Duration Avg duration 04 1,053 80ms 0ms 05 1,170 89ms 0ms 06 1,170 88ms 0ms 07 1,170 90ms 0ms 08 1,170 91ms 0ms 09 1,170 91ms 0ms 10 1,170 89ms 0ms 11 1,170 92ms 0ms 12 1,170 91ms 0ms 13 1,170 92ms 0ms 14 1,170 93ms 0ms 15 1,170 93ms 0ms 16 1,053 82ms 0ms 17 1,170 90ms 0ms 18 1,170 93ms 0ms 19 1,170 93ms 0ms 20 1,170 91ms 0ms 21 1,170 94ms 0ms 22 1,170 90ms 0ms 04 2,340 184ms 0ms 05 2,340 182ms 0ms 06 2,340 186ms 0ms 07 2,340 183ms 0ms 08 2,340 182ms 0ms 09 2,340 184ms 0ms 10 2,340 191ms 0ms 11 2,340 190ms 0ms 12 2,340 183ms 0ms 13 2,340 179ms 0ms 14 2,340 183ms 0ms 15 2,340 184ms 0ms 16 2,106 169ms 0ms 17 2,340 186ms 0ms 18 2,340 177ms 0ms 19 2,340 181ms 0ms 20 2,340 181ms 0ms 21 2,340 181ms 0ms 22 2,340 181ms 0ms 04 2,106 164ms 0ms 05 2,340 183ms 0ms 06 2,340 189ms 0ms 07 2,340 191ms 0ms 08 2,340 181ms 0ms 09 2,340 184ms 0ms 10 2,340 187ms 0ms 11 2,340 182ms 0ms 12 2,340 181ms 0ms 13 2,340 186ms 0ms 14 2,340 184ms 0ms 15 2,340 184ms 0ms 16 2,106 170ms 0ms 17 2,340 181ms 0ms 18 2,340 186ms 0ms 19 2,340 185ms 0ms 20 2,340 183ms 0ms 21 2,340 184ms 0ms 22 2,340 185ms 0ms 04 2,106 165ms 0ms 05 2,340 180ms 0ms 06 2,340 179ms 0ms 07 2,340 185ms 0ms 08 2,340 187ms 0ms 09 2,340 191ms 0ms 10 2,340 184ms 0ms 11 2,340 183ms 0ms 12 2,340 185ms 0ms 13 2,340 182ms 0ms 14 2,340 182ms 0ms 15 2,340 187ms 0ms 16 2,340 185ms 0ms 17 2,340 184ms 0ms 18 2,340 183ms 0ms 19 2,340 178ms 0ms 20 2,340 181ms 0ms 21 2,340 185ms 0ms 22 2,340 186ms 0ms 04 2,340 183ms 0ms 05 2,340 184ms 0ms 06 2,340 184ms 0ms 07 2,340 190ms 0ms 08 2,340 180ms 0ms 09 2,340 188ms 0ms 10 2,340 185ms 0ms 11 2,340 194ms 0ms 12 2,340 182ms 0ms 13 2,340 184ms 0ms 14 2,340 181ms 0ms 15 2,340 193ms 0ms 16 2,106 165ms 0ms 17 2,340 188ms 0ms 18 2,340 179ms 0ms 19 2,340 186ms 0ms 20 2,340 181ms 0ms 21 2,340 180ms 0ms 22 2,340 183ms 0ms 04 2,340 181ms 0ms 05 2,340 187ms 0ms 06 2,340 183ms 0ms 07 2,340 186ms 0ms 08 2,340 189ms 0ms 09 2,340 186ms 0ms 10 2,340 188ms 0ms 11 2,340 188ms 0ms 12 2,340 186ms 0ms 13 2,340 188ms 0ms 14 2,340 190ms 0ms 15 2,340 187ms 0ms 16 2,340 182ms 0ms 17 2,340 185ms 0ms 18 2,340 182ms 0ms 19 2,340 188ms 0ms 20 2,340 187ms 0ms 21 2,340 187ms 0ms 22 2,340 192ms 0ms 04 3,159 261ms 0ms 05 3,510 289ms 0ms 06 3,510 281ms 0ms 07 3,510 283ms 0ms 08 3,510 275ms 0ms 09 3,510 278ms 0ms 10 3,510 279ms 0ms 11 3,510 276ms 0ms 12 3,510 276ms 0ms 13 3,510 277ms 0ms 14 3,510 279ms 0ms 15 3,510 278ms 0ms 16 3,159 249ms 0ms 17 3,510 283ms 0ms 18 3,510 291ms 0ms 19 3,510 280ms 0ms 20 3,510 281ms 0ms 21 3,510 283ms 0ms 22 3,510 279ms 0ms 04 3,510 276ms 0ms 05 3,510 275ms 0ms 06 3,510 275ms 0ms 07 3,510 274ms 0ms 08 3,510 276ms 0ms 09 3,510 283ms 0ms 10 3,510 276ms 0ms 11 3,510 277ms 0ms 12 3,510 274ms 0ms 13 3,510 276ms 0ms 14 3,510 283ms 0ms 15 3,510 274ms 0ms 16 3,159 252ms 0ms 17 3,510 280ms 0ms 18 3,510 283ms 0ms 19 3,510 277ms 0ms 20 3,510 283ms 0ms 21 3,510 282ms 0ms 22 3,510 275ms 0ms [ User: tng_migration_user - Total duration: 3m30s - Times executed: 375453 ]
[ Application: [unknown] - Total duration: 3m30s - Times executed: 375453 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;
Date: 2025-12-02 10:24:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13', $2 = '2025-03-18 10:24:01', $3 = 't'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;
Date: 2025-12-03 16:48:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13', $2 = '2025-03-19 16:48:02', $3 = 't'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ($1) AND m0_.form_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;
Date: 2025-12-03 18:48:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13', $2 = '2025-03-19 18:48:01', $3 = 't'
7 26s436ms 39,247 0ms 3ms 0ms SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = $1 AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;Times Reported Time consuming bind #7
Day Hour Count Duration Avg duration 14 200 103ms 0ms 05 200 125ms 0ms 06 596 385ms 0ms 07 824 548ms 0ms 08 1,268 860ms 0ms 09 1,466 993ms 0ms 10 2,494 1s665ms 0ms 11 1,714 1s175ms 0ms 12 206 138ms 0ms 13 248 171ms 0ms 14 202 145ms 0ms 22 610 397ms 0ms 05 410 276ms 0ms 06 1,678 1s99ms 0ms 07 1,954 1s323ms 0ms 08 456 301ms 0ms 09 518 345ms 0ms 10 634 455ms 0ms 11 1,100 792ms 0ms 12 684 510ms 0ms 13 206 144ms 0ms 14 202 131ms 0ms 05 204 112ms 0ms 06 226 171ms 0ms 07 2,122 1s547ms 0ms 08 2,082 1s366ms 0ms 09 400 217ms 0ms 10 3,130 1s927ms 0ms 11 738 440ms 0ms 12 204 130ms 0ms 13 424 289ms 0ms 14 8 7ms 0ms 06 242 216ms 0ms 07 670 514ms 0ms 08 1,146 834ms 0ms 09 684 444ms 0ms 10 22 40ms 1ms 11 404 266ms 0ms 12 606 379ms 0ms 13 200 107ms 0ms 14 416 251ms 0ms 15 234 189ms 0ms 06 1,095 734ms 0ms 07 660 492ms 0ms 08 669 502ms 0ms 09 999 657ms 0ms 10 906 565ms 0ms 11 300 195ms 0ms 12 2,040 1s392ms 0ms 13 546 348ms 0ms [ User: tng_migration_user - Total duration: 54s717ms - Times executed: 39247 ]
[ Application: [unknown] - Total duration: 54s717ms - Times executed: 39247 ]
-
SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = $1 AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;
Date: 2025-12-02 08:28:15 Duration: 3ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '48865'
-
SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = $1 AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;
Date: 2025-12-01 12:12:04 Duration: 3ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '48865'
-
SELECT string_agg(s0_.name::text, ', ') AS sclr_0 FROM core.subject_inform_consent s1_ LEFT JOIN core.subcohort_inform_consent s2_ ON s1_.subcohort_inform_consent_id = s2_.id LEFT JOIN core.subcohort s0_ ON s2_.subcohort_id = s0_.id LEFT JOIN core.pilot p3_ ON s0_.pilot_id = p3_.id LEFT JOIN core.cohort c4_ ON p3_.cohort_id = c4_.id WHERE s1_.subject_about_id = $1 AND p3_.default_subcohort_id = s2_.subcohort_id AND s0_.inform_consent_id = s2_.info_consent_id GROUP BY s1_.subject_about_id;
Date: 2025-12-02 08:48:58 Duration: 3ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '48865'
8 25s540ms 148,153 0ms 14ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = $1 LIMIT 1;Times Reported Time consuming bind #8
Day Hour Count Duration Avg duration 03 313 59ms 0ms 04 360 67ms 0ms 05 578 82ms 0ms 06 390 68ms 0ms 07 390 70ms 0ms 08 390 69ms 0ms 09 390 70ms 0ms 10 390 71ms 0ms 11 390 71ms 0ms 12 390 74ms 0ms 13 390 72ms 0ms 14 390 73ms 0ms 15 390 70ms 0ms 16 386 70ms 0ms 17 390 71ms 0ms 18 390 70ms 0ms 19 390 69ms 0ms 20 390 70ms 0ms 21 390 71ms 0ms 22 390 73ms 0ms 23 360 67ms 0ms 00 360 66ms 0ms 01 360 66ms 0ms 02 360 67ms 0ms 03 702 137ms 0ms 04 720 134ms 0ms 05 1,228 167ms 0ms 06 780 147ms 0ms 07 780 147ms 0ms 08 780 142ms 0ms 09 780 147ms 0ms 10 780 146ms 0ms 11 780 146ms 0ms 12 780 144ms 0ms 13 780 145ms 0ms 14 780 147ms 0ms 15 780 149ms 0ms 16 772 139ms 0ms 17 780 146ms 0ms 18 780 142ms 0ms 19 780 149ms 0ms 20 780 147ms 0ms 21 780 145ms 0ms 22 736 136ms 0ms 23 360 69ms 0ms 00 360 69ms 0ms 01 360 68ms 0ms 02 360 68ms 0ms 03 688 128ms 0ms 04 720 149ms 0ms 05 1,104 161ms 0ms 06 780 145ms 0ms 07 780 140ms 0ms 08 780 143ms 0ms 09 780 146ms 0ms 10 778 148ms 0ms 11 780 146ms 0ms 12 780 148ms 0ms 13 780 142ms 0ms 14 780 147ms 0ms 15 780 150ms 0ms 16 772 139ms 0ms 17 972 151ms 0ms 18 780 141ms 0ms 19 780 141ms 0ms 20 780 147ms 0ms 21 780 144ms 0ms 22 780 142ms 0ms 23 360 65ms 0ms 00 360 65ms 0ms 01 360 65ms 0ms 02 360 64ms 0ms 03 683 122ms 0ms 04 720 132ms 0ms 05 1,276 178ms 0ms 06 780 148ms 0ms 07 784 156ms 0ms 08 780 151ms 0ms 09 780 148ms 0ms 10 780 149ms 0ms 11 780 146ms 0ms 12 780 146ms 0ms 13 780 149ms 0ms 14 780 148ms 0ms 15 780 150ms 0ms 16 774 144ms 0ms 17 792 147ms 0ms 18 780 143ms 0ms 19 780 150ms 0ms 20 780 146ms 0ms 21 780 146ms 0ms 22 780 143ms 0ms 23 360 67ms 0ms 00 360 67ms 0ms 01 360 69ms 0ms 02 360 66ms 0ms 03 678 125ms 0ms 04 720 145ms 0ms 05 1,224 182ms 0ms 06 784 153ms 0ms 07 780 157ms 0ms 08 782 160ms 0ms 09 784 156ms 0ms 10 780 150ms 0ms 11 780 156ms 0ms 12 784 157ms 0ms 13 780 158ms 0ms 14 780 157ms 0ms 15 780 154ms 0ms 16 772 145ms 0ms 17 784 173ms 0ms 18 780 128ms 0ms 19 780 133ms 0ms 20 780 132ms 0ms 21 780 131ms 0ms 22 780 134ms 0ms 23 360 60ms 0ms 00 360 60ms 0ms 01 360 61ms 0ms 02 360 61ms 0ms 03 673 119ms 0ms 04 720 129ms 0ms 05 1,310 178ms 0ms 06 780 126ms 0ms 07 780 128ms 0ms 08 780 128ms 0ms 09 784 121ms 0ms 10 780 124ms 0ms 11 780 129ms 0ms 12 780 120ms 0ms 13 780 127ms 0ms 14 780 126ms 0ms 15 780 124ms 0ms 16 774 126ms 0ms 17 780 122ms 0ms 18 780 124ms 0ms 19 780 127ms 0ms 20 780 128ms 0ms 21 780 125ms 0ms 22 780 128ms 0ms 23 360 58ms 0ms 00 360 58ms 0ms 01 360 57ms 0ms 02 360 57ms 0ms 03 984 164ms 0ms 04 1,080 172ms 0ms 05 1,806 219ms 0ms 06 1,173 186ms 0ms 07 1,170 186ms 0ms 08 1,170 187ms 0ms 09 1,176 179ms 0ms 10 1,170 183ms 0ms 11 1,170 189ms 0ms 12 1,170 191ms 0ms 13 1,170 187ms 0ms 14 1,170 181ms 0ms 15 1,170 186ms 0ms 16 1,158 185ms 0ms 17 1,170 190ms 0ms 18 1,170 187ms 0ms 19 1,170 187ms 0ms 20 1,170 196ms 0ms 21 1,170 193ms 0ms 22 1,170 193ms 0ms 23 720 118ms 0ms 00 720 118ms 0ms 01 720 117ms 0ms 02 720 117ms 0ms 03 1,032 174ms 0ms 04 1,080 171ms 0ms 05 1,938 232ms 0ms 06 1,170 183ms 0ms 07 1,170 192ms 0ms 08 1,170 186ms 0ms 09 1,170 187ms 0ms 10 1,170 179ms 0ms 11 1,170 195ms 0ms 12 1,170 184ms 0ms 13 1,170 183ms 0ms 14 1,170 185ms 0ms 15 1,170 192ms 0ms 16 1,158 180ms 0ms 17 1,170 187ms 0ms 18 1,170 183ms 0ms 19 1,170 191ms 0ms 20 1,170 193ms 0ms 21 1,170 190ms 0ms 22 1,170 192ms 0ms 23 359 57ms 0ms 00 360 59ms 0ms 01 360 58ms 0ms 02 360 57ms 0ms 03 18 2ms 0ms [ User: tng_migration_user - Total duration: 1s837ms - Times executed: 148153 ]
[ Application: [unknown] - Total duration: 1s837ms - Times executed: 148153 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-12-03 18:52:25 Duration: 14ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-12-04 06:43:01 Duration: 9ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'READY'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-12-01 05:02:25 Duration: 7ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR'
9 23s236ms 191,666 0ms 2ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;Times Reported Time consuming bind #9
Day Hour Count Duration Avg duration 04 430 44ms 0ms 05 565 67ms 0ms 06 510 52ms 0ms 07 510 53ms 0ms 08 510 52ms 0ms 09 510 53ms 0ms 10 530 60ms 0ms 11 514 56ms 0ms 12 510 52ms 0ms 13 523 62ms 0ms 14 508 57ms 0ms 15 514 54ms 0ms 16 517 59ms 0ms 17 514 56ms 0ms 18 543 77ms 0ms 19 509 56ms 0ms 20 507 55ms 0ms 21 509 58ms 0ms 22 509 56ms 0ms 23 2 0ms 0ms 04 838 85ms 0ms 05 1,110 133ms 0ms 06 1,046 122ms 0ms 07 1,038 120ms 0ms 08 1,032 109ms 0ms 09 1,034 110ms 0ms 10 1,042 119ms 0ms 11 1,036 115ms 0ms 12 1,048 130ms 0ms 13 1,044 120ms 0ms 14 1,062 133ms 0ms 15 1,022 114ms 0ms 16 1,022 105ms 0ms 17 1,026 111ms 0ms 18 1,024 106ms 0ms 19 1,022 114ms 0ms 20 1,026 104ms 0ms 21 1,050 120ms 0ms 22 1,022 111ms 0ms 04 762 83ms 0ms 05 1,016 116ms 0ms 06 1,018 157ms 0ms 07 1,478 177ms 0ms 08 4,196 589ms 0ms 09 2,386 322ms 0ms 10 1,184 155ms 0ms 11 1,212 167ms 0ms 12 936 106ms 0ms 13 1,534 189ms 0ms 14 948 112ms 0ms 15 1,288 168ms 0ms 16 926 98ms 0ms 17 1,188 146ms 0ms 18 956 103ms 0ms 19 976 123ms 0ms 20 956 113ms 0ms 21 938 108ms 0ms 22 1,176 147ms 0ms 01 1 1ms 1ms 02 1 0ms 0ms 04 780 84ms 0ms 05 1,062 126ms 0ms 06 1,220 151ms 0ms 07 2,842 348ms 0ms 08 4,496 554ms 0ms 09 1,064 160ms 0ms 10 2,110 258ms 0ms 11 1,046 139ms 0ms 12 1,348 188ms 0ms 13 1,364 161ms 0ms 14 1,316 161ms 0ms 15 1,008 129ms 0ms 16 994 120ms 0ms 17 988 118ms 0ms 18 970 99ms 0ms 19 970 106ms 0ms 20 986 110ms 0ms 21 970 106ms 0ms 22 978 114ms 0ms 01 4 1ms 0ms 04 778 85ms 0ms 05 1,104 134ms 0ms 06 1,110 162ms 0ms 07 1,970 342ms 0ms 08 1,404 236ms 0ms 09 1,664 210ms 0ms 10 1,118 170ms 0ms 11 1,554 207ms 0ms 12 1,646 209ms 0ms 13 1,048 132ms 0ms 14 1,314 161ms 0ms 15 1,440 179ms 0ms 16 1,022 118ms 0ms 17 1,018 116ms 0ms 18 1,024 122ms 0ms 19 1,028 122ms 0ms 20 1,004 104ms 0ms 21 1,040 128ms 0ms 22 1,032 122ms 0ms 04 830 84ms 0ms 05 1,158 140ms 0ms 06 1,096 136ms 0ms 07 1,134 162ms 0ms 08 2,050 310ms 0ms 09 1,518 195ms 0ms 10 1,096 136ms 0ms 11 1,312 170ms 0ms 12 2,614 290ms 0ms 13 1,114 153ms 0ms 14 1,494 184ms 0ms 15 1,114 143ms 0ms 16 1,054 115ms 0ms 17 1,060 117ms 0ms 18 1,054 112ms 0ms 19 1,054 114ms 0ms 20 1,062 110ms 0ms 21 1,054 118ms 0ms 22 1,054 118ms 0ms 23 2 0ms 0ms 04 1,314 147ms 0ms 05 1,617 199ms 0ms 06 1,914 251ms 0ms 07 1,617 238ms 0ms 08 2,559 360ms 0ms 09 1,851 244ms 0ms 10 3,507 416ms 0ms 11 1,863 247ms 0ms 12 1,632 245ms 0ms 13 1,524 193ms 0ms 14 1,464 165ms 0ms 15 1,464 154ms 0ms 16 1,473 154ms 0ms 17 1,494 177ms 0ms 18 1,503 175ms 0ms 19 1,470 164ms 0ms 20 1,458 161ms 0ms 21 1,458 165ms 0ms 22 1,473 163ms 0ms 23 4 1ms 0ms 04 1,299 133ms 0ms 05 1,689 197ms 0ms 06 1,545 158ms 0ms 07 1,572 182ms 0ms 08 1,551 175ms 0ms 09 1,533 172ms 0ms 10 1,983 213ms 0ms 11 1,545 178ms 0ms 12 2,748 306ms 0ms 13 1,554 176ms 0ms 14 1,527 158ms 0ms 15 1,527 160ms 0ms 16 1,542 164ms 0ms 17 1,572 205ms 0ms 18 1,536 173ms 0ms 19 1,536 164ms 0ms 20 1,536 197ms 0ms 21 1,536 184ms 0ms 22 1,554 204ms 0ms [ User: tng_migration_user - Total duration: 3s896ms - Times executed: 191666 ]
[ Application: [unknown] - Total duration: 3s896ms - Times executed: 191666 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-11-29 19:16:50 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '41999'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-11-30 08:57:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '41999'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-12-03 22:56:17 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '41896'
10 22s300ms 157,190 0ms 11ms 0ms SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;Times Reported Time consuming bind #10
Day Hour Count Duration Avg duration 03 365 55ms 0ms 04 410 55ms 0ms 05 420 60ms 0ms 06 420 58ms 0ms 07 420 59ms 0ms 08 420 59ms 0ms 09 420 58ms 0ms 10 420 59ms 0ms 11 420 59ms 0ms 12 420 61ms 0ms 13 420 57ms 0ms 14 420 59ms 0ms 15 420 59ms 0ms 16 411 56ms 0ms 17 420 61ms 0ms 18 420 59ms 0ms 19 420 59ms 0ms 20 420 61ms 0ms 21 420 63ms 0ms 22 420 64ms 0ms 23 420 64ms 0ms 00 420 62ms 0ms 01 420 64ms 0ms 02 420 63ms 0ms 03 818 129ms 0ms 04 826 114ms 0ms 05 840 122ms 0ms 06 840 126ms 0ms 07 840 125ms 0ms 08 840 123ms 0ms 09 840 126ms 0ms 10 840 126ms 0ms 11 840 129ms 0ms 12 840 127ms 0ms 13 840 121ms 0ms 14 840 124ms 0ms 15 840 129ms 0ms 16 822 111ms 0ms 17 840 119ms 0ms 18 840 120ms 0ms 19 840 127ms 0ms 20 840 125ms 0ms 21 840 121ms 0ms 22 796 124ms 0ms 23 420 63ms 0ms 00 420 63ms 0ms 01 420 63ms 0ms 02 420 62ms 0ms 03 802 116ms 0ms 04 822 116ms 0ms 05 840 127ms 0ms 06 840 127ms 0ms 07 840 123ms 0ms 08 840 129ms 0ms 09 840 132ms 0ms 10 838 130ms 0ms 11 840 126ms 0ms 12 840 128ms 0ms 13 840 127ms 0ms 14 840 129ms 0ms 15 840 131ms 0ms 16 822 115ms 0ms 17 840 127ms 0ms 18 840 126ms 0ms 19 840 129ms 0ms 20 840 129ms 0ms 21 840 129ms 0ms 22 840 127ms 0ms 23 420 66ms 0ms 00 420 64ms 0ms 01 420 63ms 0ms 02 420 62ms 0ms 03 796 122ms 0ms 04 820 105ms 0ms 05 840 127ms 0ms 06 840 123ms 0ms 07 840 125ms 0ms 08 840 123ms 0ms 09 840 122ms 0ms 10 840 124ms 0ms 11 840 123ms 0ms 12 840 123ms 0ms 13 840 126ms 0ms 14 840 127ms 0ms 15 840 130ms 0ms 16 828 119ms 0ms 17 840 130ms 0ms 18 840 127ms 0ms 19 840 129ms 0ms 20 840 128ms 0ms 21 840 130ms 0ms 22 840 129ms 0ms 23 420 63ms 0ms 00 420 66ms 0ms 01 420 67ms 0ms 02 420 64ms 0ms 03 790 119ms 0ms 04 838 142ms 0ms 05 840 140ms 0ms 06 840 140ms 0ms 07 840 141ms 0ms 08 840 148ms 0ms 09 840 138ms 0ms 10 840 139ms 0ms 11 840 143ms 0ms 12 840 140ms 0ms 13 840 146ms 0ms 14 840 137ms 0ms 15 840 140ms 0ms 16 822 116ms 0ms 17 840 128ms 0ms 18 840 122ms 0ms 19 840 125ms 0ms 20 840 122ms 0ms 21 840 122ms 0ms 22 840 122ms 0ms 23 420 61ms 0ms 00 420 60ms 0ms 01 420 61ms 0ms 02 420 60ms 0ms 03 785 119ms 0ms 04 826 116ms 0ms 05 838 139ms 0ms 06 840 106ms 0ms 07 840 109ms 0ms 08 840 107ms 0ms 09 840 106ms 0ms 10 840 109ms 0ms 11 840 112ms 0ms 12 840 105ms 0ms 13 840 110ms 0ms 14 840 107ms 0ms 15 840 106ms 0ms 16 828 102ms 0ms 17 840 109ms 0ms 18 840 110ms 0ms 19 840 110ms 0ms 20 840 112ms 0ms 21 840 109ms 0ms 22 840 114ms 0ms 23 420 55ms 0ms 00 420 55ms 0ms 01 420 56ms 0ms 02 420 55ms 0ms 03 1,148 157ms 0ms 04 1,230 148ms 0ms 05 1,260 170ms 0ms 06 1,260 164ms 0ms 07 1,260 167ms 0ms 08 1,260 165ms 0ms 09 1,260 159ms 0ms 10 1,260 161ms 0ms 11 1,260 166ms 0ms 12 1,260 168ms 0ms 13 1,260 167ms 0ms 14 1,260 160ms 0ms 15 1,260 163ms 0ms 16 1,233 144ms 0ms 17 1,260 161ms 0ms 18 1,260 164ms 0ms 19 1,260 163ms 0ms 20 1,260 168ms 0ms 21 1,260 166ms 0ms 22 1,260 166ms 0ms 23 840 112ms 0ms 00 840 108ms 0ms 01 840 110ms 0ms 02 840 107ms 0ms 03 1,203 165ms 0ms 04 1,239 151ms 0ms 05 1,260 167ms 0ms 06 1,260 165ms 0ms 07 1,260 169ms 0ms 08 1,260 159ms 0ms 09 1,260 161ms 0ms 10 1,260 158ms 0ms 11 1,260 164ms 0ms 12 1,260 161ms 0ms 13 1,260 169ms 0ms 14 1,260 162ms 0ms 15 1,260 164ms 0ms 16 1,233 146ms 0ms 17 1,260 166ms 0ms 18 1,260 164ms 0ms 19 1,260 168ms 0ms 20 1,260 170ms 0ms 21 1,260 166ms 0ms 22 1,260 172ms 0ms 23 419 56ms 0ms 00 420 55ms 0ms 01 420 56ms 0ms 02 420 55ms 0ms 03 22 3ms 0ms [ User: tng_migration_user - Total duration: 5s409ms - Times executed: 157190 ]
[ Application: [unknown] - Total duration: 5s409ms - Times executed: 157190 ]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;
Date: 2025-12-04 06:43:01 Duration: 11ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = 'f'
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;
Date: 2025-12-06 14:25:15 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = 't'
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 WHERE t0.disabled = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;
Date: 2025-12-03 09:10:01 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = 'f'
11 18s139ms 78,691 0ms 4ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;Times Reported Time consuming bind #11
Day Hour Count Duration Avg duration 05 212 44ms 0ms 10 579 122ms 0ms 11 87 16ms 0ms 12 95 18ms 0ms 13 592 117ms 0ms 15 309 62ms 0ms 16 309 64ms 0ms 17 618 122ms 0ms 18 392 91ms 0ms 19 138 27ms 0ms 21 154 30ms 0ms 22 190 39ms 0ms 23 95 20ms 0ms 05 6 2ms 0ms 06 570 118ms 0ms 09 46 9ms 0ms 10 380 75ms 0ms 12 472 97ms 0ms 14 976 210ms 0ms 17 190 35ms 0ms 20 380 83ms 0ms 21 1,640 324ms 0ms 05 40 12ms 0ms 06 360 117ms 0ms 07 130 45ms 0ms 08 1,188 420ms 0ms 09 602 189ms 0ms 10 86 27ms 0ms 11 258 91ms 0ms 12 54 20ms 0ms 13 94 33ms 0ms 14 280 62ms 0ms 15 1,618 339ms 0ms 17 6,456 1s330ms 0ms 18 2,548 513ms 0ms 19 3,624 757ms 0ms 20 1,596 336ms 0ms 21 846 170ms 0ms 22 2,070 416ms 0ms 05 12 3ms 0ms 06 98 37ms 0ms 07 250 63ms 0ms 08 690 155ms 0ms 09 1,316 280ms 0ms 10 480 125ms 0ms 11 1,770 409ms 0ms 12 1,012 275ms 0ms 13 470 120ms 0ms 14 452 97ms 0ms 15 282 60ms 0ms 16 664 137ms 0ms 17 456 94ms 0ms 20 380 74ms 0ms 22 410 88ms 0ms 01 190 39ms 0ms 05 176 45ms 0ms 06 864 238ms 0ms 07 1,438 374ms 0ms 08 1,416 402ms 0ms 09 756 198ms 0ms 10 934 232ms 0ms 11 756 229ms 0ms 12 356 125ms 0ms 13 490 114ms 0ms 14 436 126ms 0ms 15 684 138ms 0ms 16 682 146ms 0ms 17 74 16ms 0ms 18 538 111ms 0ms 19 710 136ms 0ms 21 1,434 297ms 0ms 22 1,154 245ms 0ms 05 218 48ms 0ms 06 224 63ms 0ms 07 470 137ms 0ms 08 1,104 359ms 0ms 09 286 95ms 0ms 10 578 137ms 0ms 11 564 151ms 0ms 12 266 70ms 0ms 13 1,800 358ms 0ms 14 56 25ms 0ms 15 236 49ms 0ms 17 122 22ms 0ms 20 190 40ms 0ms 22 270 57ms 0ms 23 45 8ms 0ms 04 570 129ms 0ms 05 843 167ms 0ms 06 636 193ms 0ms 07 1,578 412ms 0ms 08 1,752 446ms 0ms 09 588 196ms 0ms 10 1,179 281ms 0ms 11 1,086 251ms 0ms 12 1,071 298ms 0ms 13 312 107ms 0ms 16 123 25ms 0ms 17 246 54ms 0ms 18 1,035 220ms 0ms 19 522 105ms 0ms 22 570 124ms 0ms 23 190 36ms 0ms 05 33 9ms 0ms 07 174 40ms 0ms 08 570 105ms 0ms 09 3 2ms 0ms 10 51 18ms 0ms 11 489 97ms 0ms 12 75 25ms 0ms 13 498 102ms 0ms 16 1,290 252ms 0ms 17 2,124 411ms 0ms 18 261 52ms 0ms 19 708 143ms 0ms 20 342 63ms 0ms 21 237 46ms 0ms 22 996 221ms 0ms [ User: tng_migration_user - Total duration: 3s69ms - Times executed: 78691 ]
[ Application: [unknown] - Total duration: 3s69ms - Times executed: 78691 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;
Date: 2025-11-29 19:42:23 Duration: 4ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '50018', $2 = '561', $3 = '560'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;
Date: 2025-12-01 09:39:43 Duration: 3ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '50346', $2 = '561', $3 = '560'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;
Date: 2025-12-01 09:44:07 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '1683', $2 = '591', $3 = '592'
12 17s669ms 108,480 0ms 1ms 0ms SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);Times Reported Time consuming bind #12
Day Hour Count Duration Avg duration 04 88 16ms 0ms 05 320 48ms 0ms 10 823 122ms 0ms 11 112 15ms 0ms 12 122 17ms 0ms 13 763 112ms 0ms 15 405 61ms 0ms 16 405 63ms 0ms 17 810 117ms 0ms 18 669 104ms 0ms 19 246 35ms 0ms 21 214 30ms 0ms 22 244 36ms 0ms 23 122 19ms 0ms 04 218 42ms 0ms 06 732 111ms 0ms 09 76 11ms 0ms 10 488 72ms 0ms 12 608 93ms 0ms 14 1,600 254ms 0ms 17 272 38ms 0ms 20 488 79ms 0ms 21 2,400 355ms 0ms 04 142 28ms 0ms 06 414 86ms 0ms 07 386 62ms 0ms 08 1,428 261ms 0ms 09 1,094 191ms 0ms 10 962 170ms 0ms 11 500 93ms 0ms 12 68 12ms 0ms 13 310 58ms 0ms 14 686 102ms 0ms 15 2,228 335ms 0ms 17 8,620 1s328ms 0ms 18 3,364 509ms 0ms 19 4,822 753ms 0ms 20 2,358 362ms 0ms 21 1,122 168ms 0ms 22 2,918 441ms 0ms 04 240 46ms 0ms 06 172 36ms 0ms 07 746 144ms 0ms 08 1,446 276ms 0ms 09 2,196 355ms 0ms 10 698 123ms 0ms 11 1,938 309ms 0ms 12 1,024 181ms 0ms 13 770 128ms 0ms 14 654 100ms 0ms 15 506 78ms 0ms 16 920 142ms 0ms 17 600 92ms 0ms 20 488 71ms 0ms 22 600 94ms 0ms 01 244 38ms 0ms 04 210 40ms 0ms 05 234 38ms 0ms 06 810 139ms 0ms 07 2,990 522ms 0ms 08 1,878 345ms 0ms 09 684 116ms 0ms 10 1,124 198ms 0ms 11 694 122ms 0ms 12 100 29ms 0ms 13 750 126ms 0ms 14 374 64ms 0ms 15 930 141ms 0ms 16 880 148ms 0ms 17 162 26ms 0ms 18 706 108ms 0ms 19 916 135ms 0ms 21 2,204 353ms 0ms 22 1,544 247ms 0ms 04 262 49ms 0ms 05 278 47ms 0ms 06 190 39ms 0ms 07 646 120ms 0ms 08 1,028 206ms 0ms 09 384 68ms 0ms 10 762 119ms 0ms 11 590 93ms 0ms 12 312 57ms 0ms 13 2,660 407ms 0ms 14 90 18ms 0ms 15 1,174 194ms 0ms 17 158 22ms 0ms 20 304 50ms 0ms 22 424 68ms 0ms 23 70 10ms 0ms 04 1,044 195ms 0ms 05 1,071 163ms 0ms 06 453 95ms 0ms 07 1,782 319ms 0ms 08 1,794 326ms 0ms 09 282 65ms 0ms 10 1,326 216ms 0ms 11 1,245 199ms 0ms 12 1,032 199ms 0ms 13 273 60ms 0ms 16 192 30ms 0ms 17 384 63ms 0ms 18 1,545 232ms 0ms 19 672 104ms 0ms 22 732 124ms 0ms 23 244 35ms 0ms 04 366 73ms 0ms 07 276 48ms 0ms 08 732 106ms 0ms 10 6 3ms 0ms 11 648 101ms 0ms 12 9 3ms 0ms 13 660 105ms 0ms 16 1,734 251ms 0ms 17 3,192 476ms 0ms 18 336 52ms 0ms 19 912 143ms 0ms 20 537 77ms 0ms 21 306 48ms 0ms 22 1,284 210ms 0ms [ User: tng_migration_user - Total duration: 2s209ms - Times executed: 108480 ]
[ Application: [unknown] - Total duration: 2s209ms - Times executed: 108480 ]
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-12-03 09:09:26 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '64'
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-12-02 08:34:58 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '81'
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-12-02 08:34:17 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '81'
13 15s787ms 12,134 0ms 64ms 1ms SELECT t0.ID AS id_1, t0.USER_ID AS user_id_2, t0.GROUP_ID AS group_id_3, t4.ID AS id_5, t4.NAME AS name_6, t4.ACRONYM AS acronym_7, t4.DESCRIPTION AS description_8, t4.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_9, t4.STRUCTURE_LEFT_TREE AS structure_left_tree_10, t4.STRUCTURE_RIGHT_TREE AS structure_right_tree_11, t4.INFO AS info_12, t4.TYPE_ID AS type_id_13, t4.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_14, t4.STRUCTURE_PARENT_GROUP_ID AS structure_parent_group_id_15, t4.OWNER_GROUP_ID AS owner_group_id_16, t4.OWNER_USER_ID AS owner_user_id_17, t0.ROLE_ID AS role_id_18, t19.ID AS id_20, t19.NAME AS name_21, t19.DESCRIPTION AS description_22 FROM ACL_USER_GROUP_ROLE t0 INNER JOIN ACL_GROUP t4 ON t0.GROUP_ID = t4.ID INNER JOIN ACL_Role t19 ON t0.ROLE_ID = t19.ID WHERE t0.USER_ID = $1;Times Reported Time consuming bind #13
Day Hour Count Duration Avg duration 05 7 8ms 1ms 10 39 45ms 1ms 11 4 4ms 1ms 12 4 5ms 1ms 13 22 27ms 1ms 15 11 12ms 1ms 16 12 14ms 1ms 17 30 36ms 1ms 18 31 40ms 1ms 19 7 7ms 1ms 21 3 3ms 1ms 22 8 10ms 1ms 23 3 4ms 1ms 06 20 30ms 1ms 09 8 8ms 1ms 10 14 17ms 1ms 12 18 23ms 1ms 14 52 68ms 1ms 17 24 29ms 1ms 20 8 8ms 1ms 21 30 34ms 1ms 05 6 6ms 1ms 06 124 172ms 1ms 07 96 124ms 1ms 08 738 958ms 1ms 09 350 447ms 1ms 10 152 196ms 1ms 11 168 212ms 1ms 12 142 178ms 1ms 13 184 241ms 1ms 14 36 45ms 1ms 15 90 115ms 1ms 17 432 547ms 1ms 18 138 169ms 1ms 19 172 226ms 1ms 20 80 102ms 1ms 21 26 31ms 1ms 22 88 117ms 1ms 05 12 17ms 1ms 06 128 178ms 1ms 07 244 324ms 1ms 08 336 451ms 1ms 09 228 308ms 1ms 10 156 210ms 1ms 11 168 217ms 1ms 12 232 308ms 1ms 13 118 159ms 1ms 14 82 106ms 1ms 15 52 69ms 1ms 16 40 48ms 1ms 17 14 15ms 1ms 20 16 19ms 1ms 22 10 10ms 1ms 01 7 7ms 1ms 05 28 35ms 1ms 06 196 257ms 1ms 07 522 697ms 1ms 08 534 723ms 1ms 09 180 219ms 1ms 10 292 384ms 1ms 11 256 341ms 1ms 12 124 166ms 1ms 13 86 119ms 1ms 14 152 197ms 1ms 15 70 91ms 1ms 16 30 42ms 1ms 17 8 13ms 1ms 18 42 52ms 1ms 19 28 35ms 1ms 21 36 47ms 1ms 22 62 83ms 1ms 05 8 11ms 1ms 06 88 108ms 1ms 07 242 314ms 1ms 08 422 538ms 1ms 09 126 155ms 1ms 10 86 105ms 1ms 11 110 135ms 1ms 12 218 262ms 1ms 13 102 134ms 1ms 14 108 129ms 1ms 15 178 215ms 1ms 17 8 10ms 1ms 20 16 18ms 1ms 22 36 40ms 1ms 23 3 4ms 1ms 04 24 218ms 9ms 05 36 39ms 1ms 06 240 288ms 1ms 07 222 272ms 1ms 08 336 418ms 1ms 09 207 249ms 1ms 10 243 299ms 1ms 11 138 169ms 1ms 12 327 419ms 1ms 13 126 160ms 1ms 14 18 22ms 1ms 16 12 14ms 1ms 17 21 29ms 1ms 18 57 64ms 1ms 19 21 24ms 1ms 22 21 27ms 1ms 23 6 6ms 1ms 07 24 35ms 1ms 08 21 22ms 1ms 09 6 6ms 1ms 10 21 26ms 1ms 11 48 62ms 1ms 12 60 72ms 1ms 13 21 26ms 1ms 16 75 91ms 1ms 17 87 110ms 1ms 18 15 19ms 1ms 19 21 26ms 1ms 20 12 12ms 1ms 21 12 12ms 1ms 22 39 49ms 1ms [ User: tng_migration_user - Total duration: 2s206ms - Times executed: 12134 ]
[ Application: [unknown] - Total duration: 2s206ms - Times executed: 12134 ]
-
SELECT t0.ID AS id_1, t0.USER_ID AS user_id_2, t0.GROUP_ID AS group_id_3, t4.ID AS id_5, t4.NAME AS name_6, t4.ACRONYM AS acronym_7, t4.DESCRIPTION AS description_8, t4.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_9, t4.STRUCTURE_LEFT_TREE AS structure_left_tree_10, t4.STRUCTURE_RIGHT_TREE AS structure_right_tree_11, t4.INFO AS info_12, t4.TYPE_ID AS type_id_13, t4.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_14, t4.STRUCTURE_PARENT_GROUP_ID AS structure_parent_group_id_15, t4.OWNER_GROUP_ID AS owner_group_id_16, t4.OWNER_USER_ID AS owner_user_id_17, t0.ROLE_ID AS role_id_18, t19.ID AS id_20, t19.NAME AS name_21, t19.DESCRIPTION AS description_22 FROM ACL_USER_GROUP_ROLE t0 INNER JOIN ACL_GROUP t4 ON t0.GROUP_ID = t4.ID INNER JOIN ACL_Role t19 ON t0.ROLE_ID = t19.ID WHERE t0.USER_ID = $1;
Date: 2025-12-05 05:29:20 Duration: 64ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '11996'
-
SELECT t0.ID AS id_1, t0.USER_ID AS user_id_2, t0.GROUP_ID AS group_id_3, t4.ID AS id_5, t4.NAME AS name_6, t4.ACRONYM AS acronym_7, t4.DESCRIPTION AS description_8, t4.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_9, t4.STRUCTURE_LEFT_TREE AS structure_left_tree_10, t4.STRUCTURE_RIGHT_TREE AS structure_right_tree_11, t4.INFO AS info_12, t4.TYPE_ID AS type_id_13, t4.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_14, t4.STRUCTURE_PARENT_GROUP_ID AS structure_parent_group_id_15, t4.OWNER_GROUP_ID AS owner_group_id_16, t4.OWNER_USER_ID AS owner_user_id_17, t0.ROLE_ID AS role_id_18, t19.ID AS id_20, t19.NAME AS name_21, t19.DESCRIPTION AS description_22 FROM ACL_USER_GROUP_ROLE t0 INNER JOIN ACL_GROUP t4 ON t0.GROUP_ID = t4.ID INNER JOIN ACL_Role t19 ON t0.ROLE_ID = t19.ID WHERE t0.USER_ID = $1;
Date: 2025-12-01 18:36:05 Duration: 3ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '1405'
-
SELECT t0.ID AS id_1, t0.USER_ID AS user_id_2, t0.GROUP_ID AS group_id_3, t4.ID AS id_5, t4.NAME AS name_6, t4.ACRONYM AS acronym_7, t4.DESCRIPTION AS description_8, t4.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_9, t4.STRUCTURE_LEFT_TREE AS structure_left_tree_10, t4.STRUCTURE_RIGHT_TREE AS structure_right_tree_11, t4.INFO AS info_12, t4.TYPE_ID AS type_id_13, t4.STRUCTURE_ROOT_GROUP_ID AS structure_root_group_id_14, t4.STRUCTURE_PARENT_GROUP_ID AS structure_parent_group_id_15, t4.OWNER_GROUP_ID AS owner_group_id_16, t4.OWNER_USER_ID AS owner_user_id_17, t0.ROLE_ID AS role_id_18, t19.ID AS id_20, t19.NAME AS name_21, t19.DESCRIPTION AS description_22 FROM ACL_USER_GROUP_ROLE t0 INNER JOIN ACL_GROUP t4 ON t0.GROUP_ID = t4.ID INNER JOIN ACL_Role t19 ON t0.ROLE_ID = t19.ID WHERE t0.USER_ID = $1;
Date: 2025-12-02 11:15:02 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '10182'
14 14s128ms 72,828 0ms 0ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND (m0_.result_date BETWEEN $6 AND $7);Times Reported Time consuming bind #14
Day Hour Count Duration Avg duration 05 238 46ms 0ms 06 238 45ms 0ms 07 238 45ms 0ms 08 238 45ms 0ms 09 238 44ms 0ms 10 238 45ms 0ms 11 238 45ms 0ms 12 238 45ms 0ms 13 238 49ms 0ms 14 238 45ms 0ms 15 238 45ms 0ms 16 238 46ms 0ms 17 238 45ms 0ms 18 238 44ms 0ms 19 238 46ms 0ms 20 238 46ms 0ms 21 238 46ms 0ms 22 238 46ms 0ms 05 476 92ms 0ms 06 476 100ms 0ms 07 476 90ms 0ms 08 476 92ms 0ms 09 476 93ms 0ms 10 476 90ms 0ms 11 476 90ms 0ms 12 476 91ms 0ms 13 476 91ms 0ms 14 476 92ms 0ms 15 476 98ms 0ms 16 476 91ms 0ms 17 476 91ms 0ms 18 476 91ms 0ms 19 476 98ms 0ms 20 476 88ms 0ms 21 476 90ms 0ms 22 476 95ms 0ms 05 476 91ms 0ms 06 476 92ms 0ms 07 476 95ms 0ms 08 476 98ms 0ms 09 476 96ms 0ms 10 476 90ms 0ms 11 476 91ms 0ms 12 476 95ms 0ms 13 476 90ms 0ms 14 476 96ms 0ms 15 476 95ms 0ms 16 476 91ms 0ms 17 476 88ms 0ms 18 476 88ms 0ms 19 476 91ms 0ms 20 476 91ms 0ms 21 476 89ms 0ms 22 476 89ms 0ms 05 476 92ms 0ms 06 476 88ms 0ms 07 476 93ms 0ms 08 476 87ms 0ms 09 476 90ms 0ms 10 476 88ms 0ms 11 476 94ms 0ms 12 476 93ms 0ms 13 476 89ms 0ms 14 476 92ms 0ms 15 476 100ms 0ms 16 476 91ms 0ms 17 476 89ms 0ms 18 476 90ms 0ms 19 476 93ms 0ms 20 476 93ms 0ms 21 476 89ms 0ms 22 476 101ms 0ms 05 476 94ms 0ms 06 476 92ms 0ms 07 476 93ms 0ms 08 476 96ms 0ms 09 476 93ms 0ms 10 476 93ms 0ms 11 476 91ms 0ms 12 476 95ms 0ms 13 476 92ms 0ms 14 476 93ms 0ms 15 476 91ms 0ms 16 476 95ms 0ms 17 476 89ms 0ms 18 476 97ms 0ms 19 476 92ms 0ms 20 476 93ms 0ms 21 476 92ms 0ms 22 476 90ms 0ms 05 476 93ms 0ms 06 476 97ms 0ms 07 476 92ms 0ms 08 476 91ms 0ms 09 476 89ms 0ms 10 476 90ms 0ms 11 476 90ms 0ms 12 476 92ms 0ms 13 476 96ms 0ms 14 476 98ms 0ms 15 476 91ms 0ms 16 476 96ms 0ms 17 476 91ms 0ms 18 476 96ms 0ms 19 476 89ms 0ms 20 476 89ms 0ms 21 476 95ms 0ms 22 476 90ms 0ms 05 714 145ms 0ms 06 714 133ms 0ms 07 714 135ms 0ms 08 714 139ms 0ms 09 714 138ms 0ms 10 714 141ms 0ms 11 714 137ms 0ms 12 714 134ms 0ms 13 714 135ms 0ms 14 714 133ms 0ms 15 714 133ms 0ms 16 714 132ms 0ms 17 714 135ms 0ms 18 714 140ms 0ms 19 714 142ms 0ms 20 714 139ms 0ms 21 714 137ms 0ms 22 714 135ms 0ms 05 714 138ms 0ms 06 714 135ms 0ms 07 714 142ms 0ms 08 714 136ms 0ms 09 714 134ms 0ms 10 714 136ms 0ms 11 714 138ms 0ms 12 714 134ms 0ms 13 714 138ms 0ms 14 714 142ms 0ms 15 714 137ms 0ms 16 714 139ms 0ms 17 714 132ms 0ms 18 714 138ms 0ms 19 714 133ms 0ms 20 714 135ms 0ms 21 714 134ms 0ms 22 714 144ms 0ms [ User: tng_migration_user - Total duration: 1s217ms - Times executed: 72828 ]
[ Application: [unknown] - Total duration: 1s217ms - Times executed: 72828 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND (m0_.result_date BETWEEN $6 AND $7);
Date: 2025-12-01 09:05:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '85', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = '2026-03-12 09:05:01', $7 = '2026-03-16 09:05:01'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND (m0_.result_date BETWEEN $6 AND $7);
Date: 2025-11-29 17:59:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '108', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = '2025-02-19 17:59:01', $7 = '2025-02-23 17:59:01'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND (m0_.result_date BETWEEN $6 AND $7);
Date: 2025-12-03 13:23:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '113', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = '2025-04-20 13:23:01', $7 = '2025-04-24 13:23:01'
15 11s783ms 134,962 0ms 0ms 0ms SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = $1 AND s0_.last_return_code <> $2;Times Reported Time consuming bind #15
Day Hour Count Duration Avg duration 03 313 26ms 0ms 04 360 31ms 0ms 05 360 31ms 0ms 06 360 29ms 0ms 07 360 29ms 0ms 08 360 29ms 0ms 09 360 29ms 0ms 10 360 30ms 0ms 11 360 30ms 0ms 12 360 31ms 0ms 13 360 30ms 0ms 14 360 31ms 0ms 15 360 30ms 0ms 16 360 29ms 0ms 17 360 29ms 0ms 18 360 28ms 0ms 19 360 28ms 0ms 20 360 29ms 0ms 21 360 29ms 0ms 22 360 29ms 0ms 23 360 30ms 0ms 00 360 31ms 0ms 01 360 31ms 0ms 02 360 31ms 0ms 03 702 64ms 0ms 04 720 61ms 0ms 05 720 61ms 0ms 06 720 62ms 0ms 07 720 62ms 0ms 08 720 61ms 0ms 09 720 62ms 0ms 10 720 61ms 0ms 11 720 61ms 0ms 12 720 61ms 0ms 13 720 61ms 0ms 14 720 63ms 0ms 15 720 62ms 0ms 16 720 61ms 0ms 17 720 63ms 0ms 18 720 63ms 0ms 19 720 65ms 0ms 20 720 64ms 0ms 21 720 63ms 0ms 22 676 60ms 0ms 23 360 32ms 0ms 00 360 33ms 0ms 01 360 32ms 0ms 02 360 32ms 0ms 03 688 61ms 0ms 04 720 64ms 0ms 05 720 63ms 0ms 06 720 64ms 0ms 07 720 63ms 0ms 08 720 63ms 0ms 09 720 63ms 0ms 10 718 64ms 0ms 11 720 64ms 0ms 12 720 64ms 0ms 13 720 64ms 0ms 14 720 64ms 0ms 15 720 66ms 0ms 16 720 63ms 0ms 17 720 64ms 0ms 18 720 64ms 0ms 19 720 64ms 0ms 20 720 65ms 0ms 21 720 63ms 0ms 22 720 64ms 0ms 23 360 32ms 0ms 00 360 32ms 0ms 01 360 32ms 0ms 02 360 32ms 0ms 03 683 62ms 0ms 04 720 63ms 0ms 05 720 64ms 0ms 06 720 64ms 0ms 07 720 67ms 0ms 08 720 65ms 0ms 09 720 63ms 0ms 10 720 64ms 0ms 11 720 65ms 0ms 12 720 63ms 0ms 13 720 64ms 0ms 14 720 64ms 0ms 15 720 65ms 0ms 16 720 63ms 0ms 17 720 64ms 0ms 18 720 62ms 0ms 19 720 64ms 0ms 20 720 64ms 0ms 21 720 63ms 0ms 22 720 62ms 0ms 23 360 32ms 0ms 00 360 31ms 0ms 01 360 32ms 0ms 02 360 31ms 0ms 03 678 61ms 0ms 04 720 66ms 0ms 05 720 65ms 0ms 06 720 64ms 0ms 07 720 64ms 0ms 08 720 65ms 0ms 09 720 65ms 0ms 10 720 63ms 0ms 11 720 63ms 0ms 12 720 64ms 0ms 13 720 67ms 0ms 14 720 65ms 0ms 15 720 65ms 0ms 16 720 65ms 0ms 17 720 66ms 0ms 18 720 62ms 0ms 19 720 64ms 0ms 20 720 64ms 0ms 21 720 64ms 0ms 22 720 64ms 0ms 23 360 32ms 0ms 00 360 32ms 0ms 01 360 32ms 0ms 02 360 32ms 0ms 03 673 62ms 0ms 04 720 63ms 0ms 05 718 60ms 0ms 06 720 61ms 0ms 07 720 62ms 0ms 08 720 61ms 0ms 09 720 59ms 0ms 10 720 61ms 0ms 11 720 63ms 0ms 12 720 59ms 0ms 13 720 62ms 0ms 14 720 62ms 0ms 15 720 63ms 0ms 16 720 63ms 0ms 17 720 61ms 0ms 18 720 61ms 0ms 19 720 61ms 0ms 20 720 64ms 0ms 21 720 62ms 0ms 22 720 63ms 0ms 23 360 31ms 0ms 00 360 31ms 0ms 01 360 31ms 0ms 02 360 30ms 0ms 03 984 89ms 0ms 04 1,080 91ms 0ms 05 1,080 92ms 0ms 06 1,080 91ms 0ms 07 1,080 92ms 0ms 08 1,080 92ms 0ms 09 1,080 90ms 0ms 10 1,080 90ms 0ms 11 1,080 92ms 0ms 12 1,080 94ms 0ms 13 1,080 92ms 0ms 14 1,080 89ms 0ms 15 1,080 92ms 0ms 16 1,080 90ms 0ms 17 1,080 89ms 0ms 18 1,080 88ms 0ms 19 1,080 90ms 0ms 20 1,080 92ms 0ms 21 1,080 95ms 0ms 22 1,080 90ms 0ms 23 720 62ms 0ms 00 720 60ms 0ms 01 720 61ms 0ms 02 720 61ms 0ms 03 1,032 92ms 0ms 04 1,080 92ms 0ms 05 1,080 91ms 0ms 06 1,080 91ms 0ms 07 1,080 93ms 0ms 08 1,080 91ms 0ms 09 1,080 91ms 0ms 10 1,080 88ms 0ms 11 1,080 95ms 0ms 12 1,080 92ms 0ms 13 1,080 91ms 0ms 14 1,080 92ms 0ms 15 1,080 93ms 0ms 16 1,080 91ms 0ms 17 1,080 92ms 0ms 18 1,080 90ms 0ms 19 1,080 94ms 0ms 20 1,080 97ms 0ms 21 1,080 95ms 0ms 22 1,080 94ms 0ms 23 359 31ms 0ms 00 360 31ms 0ms 01 360 31ms 0ms 02 360 31ms 0ms 03 18 1ms 0ms [ User: tng_migration_user - Total duration: 2s355ms - Times executed: 134962 ]
[ Application: [unknown] - Total duration: 2s355ms - Times executed: 134962 ]
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = $1 AND s0_.last_return_code <> $2;
Date: 2025-12-06 22:01:15 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = '0'
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = $1 AND s0_.last_return_code <> $2;
Date: 2025-12-05 22:02:16 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = '0'
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = $1 AND s0_.last_return_code <> $2;
Date: 2025-12-02 04:17:25 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = '0'
16 11s235ms 13,185 0ms 3ms 0ms SELECT t0.ID AS id_1, t0.LOGIN AS login_2, t0.EMAIL AS email_3, t0.NAME AS name_4, t0.ACTIVE AS active_5, t0.AUTH_CODE AS auth_code_6, t0.IS_EMAIL_TWO_FACTOR_AUTHENTICATION AS is_email_two_factor_authentication_7, t0.TITLE_BEFORE AS title_before_8, t0.TITLE_AFTER AS title_after_9, t0.PHONE AS phone_10, t0.SALT AS salt_11, t0.PASSWORD AS password_12, t0.PASSWORD_HASH_ALGORITHM AS password_hash_algorithm_13, t0.PASSWORD_HASH_COST AS password_hash_cost_14, t0.INFO AS info_15, t0.INFO_PUBLIC AS info_public_16, t0.datecreated AS datecreated_17, t0.datechanged AS datechanged_18, t0.PASSWORD_EXPIRE AS password_expire_19, t0.PASSWORD_RESET_HASH AS password_reset_hash_20, t0.PASSWORD_RESET_HASH_VALIDITY AS password_reset_hash_validity_21, t0.CREDENTIALS_SENT_LAST_ON AS credentials_sent_last_on_22, t0.SEND_CREDENTIALS_IMMEDIATELY AS send_credentials_immediately_23, t0.DEACTIVATED_LAST_ON AS deactivated_last_on_24, t0.PASSWORD_CHANGED_LAST_ON AS password_changed_last_on_25, t0.EXPIRATION_EMAIL_SENT_LAST_ON AS expiration_email_sent_last_on_26, t0.OWNER_USER_ID AS owner_user_id_27, t0.OWNER_GROUP_ID AS owner_group_id_28, t0.userchanged AS userchanged_29 FROM ACL_user t0 WHERE t0.ID = $1;Times Reported Time consuming bind #16
Day Hour Count Duration Avg duration 05 8 6ms 0ms 10 33 30ms 0ms 11 4 3ms 0ms 12 3 3ms 1ms 13 21 20ms 0ms 15 10 9ms 0ms 16 12 11ms 0ms 17 26 25ms 0ms 18 34 33ms 0ms 19 7 6ms 0ms 20 2 0ms 0ms 21 3 2ms 0ms 22 7 7ms 1ms 23 3 3ms 1ms 05 2 0ms 0ms 06 18 21ms 1ms 07 4 1ms 0ms 09 6 5ms 0ms 10 12 11ms 0ms 11 2 0ms 0ms 12 18 16ms 0ms 13 6 2ms 0ms 14 48 47ms 0ms 17 18 15ms 0ms 20 6 5ms 0ms 21 28 24ms 0ms 05 4 3ms 0ms 06 150 140ms 0ms 07 94 92ms 0ms 08 810 765ms 0ms 09 394 363ms 0ms 10 152 152ms 1ms 11 198 172ms 0ms 12 140 139ms 0ms 13 208 191ms 0ms 14 32 32ms 1ms 15 80 87ms 1ms 17 392 389ms 0ms 18 122 116ms 0ms 19 160 165ms 1ms 20 72 72ms 1ms 21 22 20ms 0ms 22 88 88ms 1ms 01 1 0ms 0ms 05 10 11ms 1ms 06 150 125ms 0ms 07 278 242ms 0ms 08 392 328ms 0ms 09 234 217ms 0ms 10 188 150ms 0ms 11 198 159ms 0ms 12 274 228ms 0ms 13 122 112ms 0ms 14 80 70ms 0ms 15 52 47ms 0ms 16 36 32ms 0ms 17 14 12ms 0ms 20 16 14ms 0ms 22 8 7ms 0ms 01 6 5ms 0ms 05 28 24ms 0ms 06 226 197ms 0ms 07 612 541ms 0ms 08 598 556ms 0ms 09 192 164ms 0ms 10 328 294ms 0ms 11 276 259ms 0ms 12 144 128ms 0ms 13 88 91ms 1ms 14 170 150ms 0ms 15 70 68ms 0ms 16 28 30ms 1ms 17 6 9ms 1ms 18 38 32ms 0ms 19 26 23ms 0ms 21 34 31ms 0ms 22 58 53ms 0ms 05 6 6ms 1ms 06 106 68ms 0ms 07 270 195ms 0ms 08 538 347ms 0ms 09 150 95ms 0ms 10 96 64ms 0ms 11 118 83ms 0ms 12 218 163ms 0ms 13 94 79ms 0ms 14 114 78ms 0ms 15 224 136ms 0ms 17 6 6ms 1ms 20 14 11ms 0ms 22 34 29ms 0ms 23 3 3ms 1ms 04 21 17ms 0ms 05 27 23ms 0ms 06 288 203ms 0ms 07 279 196ms 0ms 08 408 298ms 0ms 09 243 175ms 0ms 10 240 200ms 0ms 11 138 117ms 0ms 12 378 293ms 0ms 13 153 116ms 0ms 14 15 12ms 0ms 16 9 7ms 0ms 17 21 21ms 1ms 18 54 43ms 0ms 19 18 15ms 0ms 22 18 15ms 0ms 23 6 4ms 0ms 07 24 22ms 0ms 08 18 13ms 0ms 09 3 2ms 0ms 10 24 16ms 0ms 11 42 39ms 0ms 12 66 46ms 0ms 13 21 17ms 0ms 16 66 54ms 0ms 17 84 75ms 0ms 18 12 11ms 0ms 19 18 17ms 0ms 20 12 7ms 0ms 21 12 9ms 0ms 22 36 30ms 0ms [ User: tng_migration_user - Total duration: 698ms - Times executed: 13185 ]
[ Application: [unknown] - Total duration: 698ms - Times executed: 13185 ]
-
SELECT t0.ID AS id_1, t0.LOGIN AS login_2, t0.EMAIL AS email_3, t0.NAME AS name_4, t0.ACTIVE AS active_5, t0.AUTH_CODE AS auth_code_6, t0.IS_EMAIL_TWO_FACTOR_AUTHENTICATION AS is_email_two_factor_authentication_7, t0.TITLE_BEFORE AS title_before_8, t0.TITLE_AFTER AS title_after_9, t0.PHONE AS phone_10, t0.SALT AS salt_11, t0.PASSWORD AS password_12, t0.PASSWORD_HASH_ALGORITHM AS password_hash_algorithm_13, t0.PASSWORD_HASH_COST AS password_hash_cost_14, t0.INFO AS info_15, t0.INFO_PUBLIC AS info_public_16, t0.datecreated AS datecreated_17, t0.datechanged AS datechanged_18, t0.PASSWORD_EXPIRE AS password_expire_19, t0.PASSWORD_RESET_HASH AS password_reset_hash_20, t0.PASSWORD_RESET_HASH_VALIDITY AS password_reset_hash_validity_21, t0.CREDENTIALS_SENT_LAST_ON AS credentials_sent_last_on_22, t0.SEND_CREDENTIALS_IMMEDIATELY AS send_credentials_immediately_23, t0.DEACTIVATED_LAST_ON AS deactivated_last_on_24, t0.PASSWORD_CHANGED_LAST_ON AS password_changed_last_on_25, t0.EXPIRATION_EMAIL_SENT_LAST_ON AS expiration_email_sent_last_on_26, t0.OWNER_USER_ID AS owner_user_id_27, t0.OWNER_GROUP_ID AS owner_group_id_28, t0.userchanged AS userchanged_29 FROM ACL_user t0 WHERE t0.ID = $1;
Date: 2025-12-01 18:36:05 Duration: 3ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '1405'
-
SELECT t0.ID AS id_1, t0.LOGIN AS login_2, t0.EMAIL AS email_3, t0.NAME AS name_4, t0.ACTIVE AS active_5, t0.AUTH_CODE AS auth_code_6, t0.IS_EMAIL_TWO_FACTOR_AUTHENTICATION AS is_email_two_factor_authentication_7, t0.TITLE_BEFORE AS title_before_8, t0.TITLE_AFTER AS title_after_9, t0.PHONE AS phone_10, t0.SALT AS salt_11, t0.PASSWORD AS password_12, t0.PASSWORD_HASH_ALGORITHM AS password_hash_algorithm_13, t0.PASSWORD_HASH_COST AS password_hash_cost_14, t0.INFO AS info_15, t0.INFO_PUBLIC AS info_public_16, t0.datecreated AS datecreated_17, t0.datechanged AS datechanged_18, t0.PASSWORD_EXPIRE AS password_expire_19, t0.PASSWORD_RESET_HASH AS password_reset_hash_20, t0.PASSWORD_RESET_HASH_VALIDITY AS password_reset_hash_validity_21, t0.CREDENTIALS_SENT_LAST_ON AS credentials_sent_last_on_22, t0.SEND_CREDENTIALS_IMMEDIATELY AS send_credentials_immediately_23, t0.DEACTIVATED_LAST_ON AS deactivated_last_on_24, t0.PASSWORD_CHANGED_LAST_ON AS password_changed_last_on_25, t0.EXPIRATION_EMAIL_SENT_LAST_ON AS expiration_email_sent_last_on_26, t0.OWNER_USER_ID AS owner_user_id_27, t0.OWNER_GROUP_ID AS owner_group_id_28, t0.userchanged AS userchanged_29 FROM ACL_user t0 WHERE t0.ID = $1;
Date: 2025-12-01 10:30:11 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '15930'
-
SELECT t0.ID AS id_1, t0.LOGIN AS login_2, t0.EMAIL AS email_3, t0.NAME AS name_4, t0.ACTIVE AS active_5, t0.AUTH_CODE AS auth_code_6, t0.IS_EMAIL_TWO_FACTOR_AUTHENTICATION AS is_email_two_factor_authentication_7, t0.TITLE_BEFORE AS title_before_8, t0.TITLE_AFTER AS title_after_9, t0.PHONE AS phone_10, t0.SALT AS salt_11, t0.PASSWORD AS password_12, t0.PASSWORD_HASH_ALGORITHM AS password_hash_algorithm_13, t0.PASSWORD_HASH_COST AS password_hash_cost_14, t0.INFO AS info_15, t0.INFO_PUBLIC AS info_public_16, t0.datecreated AS datecreated_17, t0.datechanged AS datechanged_18, t0.PASSWORD_EXPIRE AS password_expire_19, t0.PASSWORD_RESET_HASH AS password_reset_hash_20, t0.PASSWORD_RESET_HASH_VALIDITY AS password_reset_hash_validity_21, t0.CREDENTIALS_SENT_LAST_ON AS credentials_sent_last_on_22, t0.SEND_CREDENTIALS_IMMEDIATELY AS send_credentials_immediately_23, t0.DEACTIVATED_LAST_ON AS deactivated_last_on_24, t0.PASSWORD_CHANGED_LAST_ON AS password_changed_last_on_25, t0.EXPIRATION_EMAIL_SENT_LAST_ON AS expiration_email_sent_last_on_26, t0.OWNER_USER_ID AS owner_user_id_27, t0.OWNER_GROUP_ID AS owner_group_id_28, t0.userchanged AS userchanged_29 FROM ACL_user t0 WHERE t0.ID = $1;
Date: 2025-12-01 09:44:07 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '14777'
17 11s177ms 55,692 0ms 1ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);Times Reported Time consuming bind #17
Day Hour Count Duration Avg duration 05 182 36ms 0ms 06 182 36ms 0ms 07 182 36ms 0ms 08 182 36ms 0ms 09 182 35ms 0ms 10 182 35ms 0ms 11 182 35ms 0ms 12 182 36ms 0ms 13 182 40ms 0ms 14 182 35ms 0ms 15 182 35ms 0ms 16 182 36ms 0ms 17 182 36ms 0ms 18 182 35ms 0ms 19 182 37ms 0ms 20 182 36ms 0ms 21 182 37ms 0ms 22 182 37ms 0ms 05 364 72ms 0ms 06 364 79ms 0ms 07 364 71ms 0ms 08 364 73ms 0ms 09 364 75ms 0ms 10 364 72ms 0ms 11 364 71ms 0ms 12 364 73ms 0ms 13 364 72ms 0ms 14 364 72ms 0ms 15 364 77ms 0ms 16 364 72ms 0ms 17 364 72ms 0ms 18 364 72ms 0ms 19 364 78ms 0ms 20 364 69ms 0ms 21 364 72ms 0ms 22 364 78ms 0ms 05 364 74ms 0ms 06 364 73ms 0ms 07 364 75ms 0ms 08 364 80ms 0ms 09 364 75ms 0ms 10 364 72ms 0ms 11 364 72ms 0ms 12 364 76ms 0ms 13 364 71ms 0ms 14 364 75ms 0ms 15 364 76ms 0ms 16 364 72ms 0ms 17 364 69ms 0ms 18 364 69ms 0ms 19 364 73ms 0ms 20 364 72ms 0ms 21 364 71ms 0ms 22 364 72ms 0ms 05 364 74ms 0ms 06 364 69ms 0ms 07 364 75ms 0ms 08 364 68ms 0ms 09 364 71ms 0ms 10 364 69ms 0ms 11 364 74ms 0ms 12 364 73ms 0ms 13 364 71ms 0ms 14 364 74ms 0ms 15 364 79ms 0ms 16 364 73ms 0ms 17 364 71ms 0ms 18 364 70ms 0ms 19 364 73ms 0ms 20 364 73ms 0ms 21 364 70ms 0ms 22 364 80ms 0ms 05 364 76ms 0ms 06 364 72ms 0ms 07 364 76ms 0ms 08 364 76ms 0ms 09 364 74ms 0ms 10 364 74ms 0ms 11 364 72ms 0ms 12 364 73ms 0ms 13 364 73ms 0ms 14 364 74ms 0ms 15 364 72ms 0ms 16 364 75ms 0ms 17 364 71ms 0ms 18 364 79ms 0ms 19 364 75ms 0ms 20 364 73ms 0ms 21 364 75ms 0ms 22 364 71ms 0ms 05 364 73ms 0ms 06 364 77ms 0ms 07 364 75ms 0ms 08 364 73ms 0ms 09 364 71ms 0ms 10 364 71ms 0ms 11 364 72ms 0ms 12 364 73ms 0ms 13 364 75ms 0ms 14 364 76ms 0ms 15 364 74ms 0ms 16 364 77ms 0ms 17 364 71ms 0ms 18 364 77ms 0ms 19 364 70ms 0ms 20 364 70ms 0ms 21 364 76ms 0ms 22 364 72ms 0ms 05 546 117ms 0ms 06 546 105ms 0ms 07 546 105ms 0ms 08 546 109ms 0ms 09 546 106ms 0ms 10 546 110ms 0ms 11 546 109ms 0ms 12 546 105ms 0ms 13 546 106ms 0ms 14 546 104ms 0ms 15 546 105ms 0ms 16 546 103ms 0ms 17 546 104ms 0ms 18 546 109ms 0ms 19 546 111ms 0ms 20 546 110ms 0ms 21 546 108ms 0ms 22 546 107ms 0ms 05 546 108ms 0ms 06 546 104ms 0ms 07 546 112ms 0ms 08 546 109ms 0ms 09 546 103ms 0ms 10 546 107ms 0ms 11 546 107ms 0ms 12 546 105ms 0ms 13 546 106ms 0ms 14 546 110ms 0ms 15 546 107ms 0ms 16 546 109ms 0ms 17 546 104ms 0ms 18 546 107ms 0ms 19 546 104ms 0ms 20 546 104ms 0ms 21 546 105ms 0ms 22 546 112ms 0ms [ User: tng_migration_user - Total duration: 1s795ms - Times executed: 55692 ]
[ Application: [unknown] - Total duration: 1s795ms - Times executed: 55692 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);
Date: 2025-12-01 09:05:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '88', $2 = 'READY', $3 = 'AWAITING', $4 = 'MISSED', $5 = 'DONE', $6 = 'CANCELED', $7 = 't', $8 = '2025-08-01 09:05:01', $9 = '2025-08-12 09:05:01'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);
Date: 2025-12-06 09:41:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '113', $2 = 'READY', $3 = 'AWAITING', $4 = 'MISSED', $5 = 'DONE', $6 = 'CANCELED', $7 = 't', $8 = '2025-04-23 09:41:01', $9 = '2025-05-04 09:41:01'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);
Date: 2025-12-01 09:05:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '113', $2 = 'READY', $3 = 'AWAITING', $4 = 'MISSED', $5 = 'DONE', $6 = 'CANCELED', $7 = 't', $8 = '2025-04-18 09:05:01', $9 = '2025-04-29 09:05:01'
18 11s176ms 55,692 0ms 5ms 0ms SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;Times Reported Time consuming bind #18
Day Hour Count Duration Avg duration 05 182 36ms 0ms 06 182 35ms 0ms 07 182 36ms 0ms 08 182 35ms 0ms 09 182 35ms 0ms 10 182 36ms 0ms 11 182 35ms 0ms 12 182 36ms 0ms 13 182 39ms 0ms 14 182 35ms 0ms 15 182 35ms 0ms 16 182 36ms 0ms 17 182 36ms 0ms 18 182 34ms 0ms 19 182 37ms 0ms 20 182 36ms 0ms 21 182 37ms 0ms 22 182 36ms 0ms 05 364 73ms 0ms 06 364 78ms 0ms 07 364 70ms 0ms 08 364 73ms 0ms 09 364 72ms 0ms 10 364 70ms 0ms 11 364 71ms 0ms 12 364 71ms 0ms 13 364 72ms 0ms 14 364 72ms 0ms 15 364 76ms 0ms 16 364 70ms 0ms 17 364 71ms 0ms 18 364 72ms 0ms 19 364 79ms 0ms 20 364 68ms 0ms 21 364 71ms 0ms 22 364 77ms 0ms 05 364 72ms 0ms 06 364 73ms 0ms 07 364 74ms 0ms 08 364 75ms 0ms 09 364 74ms 0ms 10 364 70ms 0ms 11 364 72ms 0ms 12 364 75ms 0ms 13 364 72ms 0ms 14 364 75ms 0ms 15 364 76ms 0ms 16 364 72ms 0ms 17 364 70ms 0ms 18 364 69ms 0ms 19 364 73ms 0ms 20 364 72ms 0ms 21 364 71ms 0ms 22 364 71ms 0ms 05 364 73ms 0ms 06 364 69ms 0ms 07 364 77ms 0ms 08 364 69ms 0ms 09 364 71ms 0ms 10 364 69ms 0ms 11 364 74ms 0ms 12 364 74ms 0ms 13 364 70ms 0ms 14 364 74ms 0ms 15 364 80ms 0ms 16 364 72ms 0ms 17 364 70ms 0ms 18 364 70ms 0ms 19 364 74ms 0ms 20 364 74ms 0ms 21 364 70ms 0ms 22 364 80ms 0ms 05 364 76ms 0ms 06 364 73ms 0ms 07 364 74ms 0ms 08 364 75ms 0ms 09 364 73ms 0ms 10 364 72ms 0ms 11 364 71ms 0ms 12 364 74ms 0ms 13 364 73ms 0ms 14 364 73ms 0ms 15 364 71ms 0ms 16 364 77ms 0ms 17 364 70ms 0ms 18 364 76ms 0ms 19 364 74ms 0ms 20 364 72ms 0ms 21 364 72ms 0ms 22 364 70ms 0ms 05 364 72ms 0ms 06 364 78ms 0ms 07 364 73ms 0ms 08 364 73ms 0ms 09 364 71ms 0ms 10 364 72ms 0ms 11 364 71ms 0ms 12 364 72ms 0ms 13 364 76ms 0ms 14 364 77ms 0ms 15 364 73ms 0ms 16 364 75ms 0ms 17 364 71ms 0ms 18 364 77ms 0ms 19 364 71ms 0ms 20 364 69ms 0ms 21 364 75ms 0ms 22 364 71ms 0ms 05 546 132ms 0ms 06 546 106ms 0ms 07 546 106ms 0ms 08 546 109ms 0ms 09 546 108ms 0ms 10 546 111ms 0ms 11 546 108ms 0ms 12 546 107ms 0ms 13 546 106ms 0ms 14 546 106ms 0ms 15 546 105ms 0ms 16 546 103ms 0ms 17 546 104ms 0ms 18 546 110ms 0ms 19 546 111ms 0ms 20 546 111ms 0ms 21 546 109ms 0ms 22 546 106ms 0ms 05 546 108ms 0ms 06 546 105ms 0ms 07 546 113ms 0ms 08 546 107ms 0ms 09 546 105ms 0ms 10 546 109ms 0ms 11 546 108ms 0ms 12 546 105ms 0ms 13 546 107ms 0ms 14 546 112ms 0ms 15 546 111ms 0ms 16 546 110ms 0ms 17 546 104ms 0ms 18 546 106ms 0ms 19 546 107ms 0ms 20 546 105ms 0ms 21 546 107ms 0ms 22 546 112ms 0ms [ User: tng_migration_user - Total duration: 15s647ms - Times executed: 55692 ]
[ Application: [unknown] - Total duration: 15s647ms - Times executed: 55692 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-12-05 06:05:02 Duration: 5ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '104', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = 't', $7 = '2025-10-14 06:05:01'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-12-02 08:32:02 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '104', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = 't', $7 = '2025-10-11 08:32:02'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-12-04 11:59:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '104', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = 't', $7 = '2025-10-13 11:59:02'
19 8s639ms 12,164 0ms 24ms 0ms SELECT a0_.NAME AS name_0, a1_.NAME AS name_1, a2_.DATA_OWN_USER AS data_own_user_2, a2_.DATA_OWN_SUBGROUP AS data_own_subgroup_3, a2_.DATA_OWN AS data_own_4, a2_.DATA_GROUP AS data_group_5, a2_.DATA_SUBGROUP AS data_subgroup_6, a2_.DATA_ALL AS data_all_7, a2_.DATA_SPECIAL_PARAMETER AS data_special_parameter_8 FROM ACL_PERMISSION a2_ INNER JOIN ACL_RESOURCE a0_ ON a2_.RESOURCE_ID = a0_.ID INNER JOIN ACL_ACTIVITY a1_ ON a2_.ACTIVITY_ID = a1_.ID WHERE a2_.ROLE_ID IN ($1) ORDER BY a0_.NAME ASC, a1_.NAME ASC;Times Reported Time consuming bind #19
Day Hour Count Duration Avg duration 05 7 6ms 0ms 10 39 26ms 0ms 11 4 2ms 0ms 12 4 2ms 0ms 13 22 15ms 0ms 15 11 7ms 0ms 16 12 8ms 0ms 17 30 20ms 0ms 18 31 21ms 0ms 19 7 4ms 0ms 21 3 2ms 0ms 22 8 5ms 0ms 23 3 2ms 0ms 06 20 16ms 0ms 09 8 5ms 0ms 10 14 9ms 0ms 12 18 13ms 0ms 14 52 39ms 0ms 17 24 15ms 0ms 20 8 5ms 0ms 21 30 18ms 0ms 05 6 4ms 0ms 06 124 91ms 0ms 07 98 71ms 0ms 08 738 510ms 0ms 09 352 255ms 0ms 10 152 111ms 0ms 11 170 115ms 0ms 12 142 97ms 0ms 13 186 130ms 0ms 14 36 25ms 0ms 15 90 63ms 0ms 17 432 299ms 0ms 18 138 96ms 0ms 19 172 122ms 0ms 20 80 54ms 0ms 21 26 17ms 0ms 22 90 61ms 0ms 05 12 9ms 0ms 06 126 95ms 0ms 07 246 177ms 0ms 08 336 245ms 0ms 09 228 164ms 0ms 10 156 109ms 0ms 11 168 117ms 0ms 12 232 166ms 0ms 13 118 85ms 0ms 14 86 59ms 0ms 15 52 36ms 0ms 16 40 27ms 0ms 17 14 9ms 0ms 20 16 11ms 0ms 22 10 6ms 0ms 01 7 4ms 0ms 05 28 19ms 0ms 06 196 139ms 0ms 07 524 376ms 0ms 08 534 389ms 0ms 09 184 125ms 0ms 10 292 216ms 0ms 11 256 187ms 0ms 12 126 90ms 0ms 13 86 65ms 0ms 14 154 103ms 0ms 15 70 50ms 0ms 16 30 23ms 0ms 17 8 7ms 0ms 18 42 29ms 0ms 19 28 19ms 0ms 21 36 26ms 0ms 22 62 46ms 0ms 05 8 5ms 0ms 06 88 61ms 0ms 07 242 169ms 0ms 08 422 292ms 0ms 09 126 84ms 0ms 10 86 58ms 0ms 11 112 74ms 0ms 12 220 145ms 0ms 13 102 70ms 0ms 14 110 71ms 0ms 15 178 120ms 0ms 17 8 6ms 0ms 20 16 10ms 0ms 22 36 23ms 0ms 23 3 2ms 0ms 04 24 87ms 3ms 05 36 24ms 0ms 06 240 164ms 0ms 07 222 151ms 0ms 08 336 230ms 0ms 09 207 138ms 0ms 10 243 166ms 0ms 11 138 96ms 0ms 12 327 234ms 0ms 13 126 87ms 0ms 14 18 12ms 0ms 16 12 8ms 0ms 17 21 16ms 0ms 18 57 38ms 0ms 19 21 15ms 0ms 22 21 14ms 0ms 23 6 3ms 0ms 07 24 21ms 0ms 08 21 13ms 0ms 09 6 3ms 0ms 10 21 14ms 0ms 11 48 35ms 0ms 12 60 38ms 0ms 13 21 14ms 0ms 16 75 54ms 0ms 17 87 62ms 0ms 18 15 11ms 0ms 19 21 15ms 0ms 20 12 7ms 0ms 21 12 7ms 0ms 22 39 26ms 0ms [ User: tng_migration_user - Total duration: 1s516ms - Times executed: 12164 ]
[ Application: [unknown] - Total duration: 1s516ms - Times executed: 12164 ]
-
SELECT a0_.NAME AS name_0, a1_.NAME AS name_1, a2_.DATA_OWN_USER AS data_own_user_2, a2_.DATA_OWN_SUBGROUP AS data_own_subgroup_3, a2_.DATA_OWN AS data_own_4, a2_.DATA_GROUP AS data_group_5, a2_.DATA_SUBGROUP AS data_subgroup_6, a2_.DATA_ALL AS data_all_7, a2_.DATA_SPECIAL_PARAMETER AS data_special_parameter_8 FROM ACL_PERMISSION a2_ INNER JOIN ACL_RESOURCE a0_ ON a2_.RESOURCE_ID = a0_.ID INNER JOIN ACL_ACTIVITY a1_ ON a2_.ACTIVITY_ID = a1_.ID WHERE a2_.ROLE_ID IN ($1) ORDER BY a0_.NAME ASC, a1_.NAME ASC;
Date: 2025-12-05 05:29:20 Duration: 24ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '3'
-
SELECT a0_.NAME AS name_0, a1_.NAME AS name_1, a2_.DATA_OWN_USER AS data_own_user_2, a2_.DATA_OWN_SUBGROUP AS data_own_subgroup_3, a2_.DATA_OWN AS data_own_4, a2_.DATA_GROUP AS data_group_5, a2_.DATA_SUBGROUP AS data_subgroup_6, a2_.DATA_ALL AS data_all_7, a2_.DATA_SPECIAL_PARAMETER AS data_special_parameter_8 FROM ACL_PERMISSION a2_ INNER JOIN ACL_RESOURCE a0_ ON a2_.RESOURCE_ID = a0_.ID INNER JOIN ACL_ACTIVITY a1_ ON a2_.ACTIVITY_ID = a1_.ID WHERE a2_.ROLE_ID IN ($1) ORDER BY a0_.NAME ASC, a1_.NAME ASC;
Date: 2025-12-03 12:08:42 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '5'
-
SELECT a0_.NAME AS name_0, a1_.NAME AS name_1, a2_.DATA_OWN_USER AS data_own_user_2, a2_.DATA_OWN_SUBGROUP AS data_own_subgroup_3, a2_.DATA_OWN AS data_own_4, a2_.DATA_GROUP AS data_group_5, a2_.DATA_SUBGROUP AS data_subgroup_6, a2_.DATA_ALL AS data_all_7, a2_.DATA_SPECIAL_PARAMETER AS data_special_parameter_8 FROM ACL_PERMISSION a2_ INNER JOIN ACL_RESOURCE a0_ ON a2_.RESOURCE_ID = a0_.ID INNER JOIN ACL_ACTIVITY a1_ ON a2_.ACTIVITY_ID = a1_.ID WHERE a2_.ROLE_ID IN ($1) ORDER BY a0_.NAME ASC, a1_.NAME ASC;
Date: 2025-12-06 08:30:23 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '3'
20 8s266ms 163,120 0ms 1ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;Times Reported Time consuming bind #20
Day Hour Count Duration Avg duration 04 573 27ms 0ms 05 521 25ms 0ms 06 516 24ms 0ms 07 516 24ms 0ms 08 516 23ms 0ms 09 516 25ms 0ms 10 522 26ms 0ms 11 517 24ms 0ms 12 515 24ms 0ms 13 518 27ms 0ms 14 514 27ms 0ms 15 516 24ms 0ms 16 516 26ms 0ms 17 510 24ms 0ms 18 522 32ms 0ms 19 508 23ms 0ms 20 509 24ms 0ms 21 508 25ms 0ms 22 509 24ms 0ms 04 1,134 52ms 0ms 05 1,004 50ms 0ms 06 1,006 50ms 0ms 07 1,006 52ms 0ms 08 1,002 48ms 0ms 09 1,004 47ms 0ms 10 1,006 51ms 0ms 11 1,002 49ms 0ms 12 1,006 55ms 0ms 13 1,004 51ms 0ms 14 1,010 54ms 0ms 15 990 47ms 0ms 16 990 48ms 0ms 17 992 48ms 0ms 18 990 45ms 0ms 19 990 45ms 0ms 20 990 45ms 0ms 21 996 50ms 0ms 22 990 45ms 0ms 04 1,062 53ms 0ms 05 946 43ms 0ms 06 978 56ms 0ms 07 960 50ms 0ms 08 1,016 76ms 0ms 09 960 53ms 0ms 10 944 48ms 0ms 11 946 49ms 0ms 12 942 45ms 0ms 13 942 48ms 0ms 14 942 48ms 0ms 15 964 53ms 0ms 16 942 46ms 0ms 17 944 48ms 0ms 18 944 45ms 0ms 19 946 53ms 0ms 20 948 50ms 0ms 21 938 47ms 0ms 22 946 50ms 0ms 01 1 0ms 0ms 04 1,034 50ms 0ms 05 948 45ms 0ms 06 950 50ms 0ms 07 950 49ms 0ms 08 956 52ms 0ms 09 966 57ms 0ms 10 952 47ms 0ms 11 956 48ms 0ms 12 944 45ms 0ms 13 948 48ms 0ms 14 956 49ms 0ms 15 942 46ms 0ms 16 940 48ms 0ms 17 938 48ms 0ms 18 936 43ms 0ms 19 936 43ms 0ms 20 942 45ms 0ms 21 936 47ms 0ms 22 938 45ms 0ms 01 1 0ms 0ms 04 1,044 52ms 0ms 05 940 47ms 0ms 06 948 51ms 0ms 07 970 59ms 0ms 08 972 54ms 0ms 09 940 53ms 0ms 10 960 53ms 0ms 11 956 55ms 0ms 12 938 47ms 0ms 13 946 49ms 0ms 14 970 52ms 0ms 15 966 57ms 0ms 16 934 47ms 0ms 17 932 45ms 0ms 18 938 49ms 0ms 19 934 47ms 0ms 20 928 42ms 0ms 21 936 48ms 0ms 22 934 50ms 0ms 04 1,110 51ms 0ms 05 1,032 52ms 0ms 06 1,030 47ms 0ms 07 1,036 52ms 0ms 08 1,032 48ms 0ms 09 1,032 57ms 0ms 10 1,038 53ms 0ms 11 1,054 59ms 0ms 12 1,064 54ms 0ms 13 1,050 62ms 0ms 14 1,050 57ms 0ms 15 1,038 51ms 0ms 16 1,034 50ms 0ms 17 1,036 51ms 0ms 18 1,034 48ms 0ms 19 1,034 49ms 0ms 20 1,036 48ms 0ms 21 1,034 51ms 0ms 22 1,038 52ms 0ms 04 1,728 86ms 0ms 05 1,533 77ms 0ms 06 1,548 75ms 0ms 07 1,536 75ms 0ms 08 1,533 75ms 0ms 09 1,533 72ms 0ms 10 1,542 77ms 0ms 11 1,554 87ms 0ms 12 1,551 76ms 0ms 13 1,524 70ms 0ms 14 1,524 76ms 0ms 15 1,524 71ms 0ms 16 1,527 71ms 0ms 17 1,527 74ms 0ms 18 1,536 76ms 0ms 19 1,521 72ms 0ms 20 1,515 72ms 0ms 21 1,515 73ms 0ms 22 1,521 74ms 0ms 04 1,812 87ms 0ms 05 1,614 75ms 0ms 06 1,614 75ms 0ms 07 1,626 82ms 0ms 08 1,614 82ms 0ms 09 1,608 83ms 0ms 10 1,608 75ms 0ms 11 1,611 87ms 0ms 12 1,608 77ms 0ms 13 1,614 79ms 0ms 14 1,602 75ms 0ms 15 1,602 72ms 0ms 16 1,605 75ms 0ms 17 1,614 91ms 0ms 18 1,593 81ms 0ms 19 1,590 76ms 0ms 20 1,587 97ms 0ms 21 1,587 87ms 0ms 22 1,587 84ms 0ms [ User: tng_migration_user - Total duration: 2s358ms - Times executed: 163120 ]
[ Application: [unknown] - Total duration: 2s358ms - Times executed: 163120 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;
Date: 2025-11-29 19:16:50 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '137406'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;
Date: 2025-12-03 22:56:17 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '135594'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;
Date: 2025-12-03 16:22:25 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '136400'
-
Events
Log levels
Key values
- 13,503,171 Event entries
- (EVENTLOG entries are formaly LOG level entries that are not queries)
Events distribution (except queries)
Key values
- 0 PANIC entries
- 239162 FATAL entries
- 1 ERROR entries
- 680 WARNING entries
- 117 EVENTLOG entries
Most Frequent Errors/Events
Key values
- 239,162 Max number of times the same event was reported
- 239,960 Total events found
Rank Times reported Error 1 239,162 FATAL: password authentication failed for user "..."
Times Reported Most Frequent Error / Event #1
Day Hour Count Nov 30 00 1,412 01 1,406 02 1,422 03 1,400 04 1,404 05 1,414 06 1,414 07 1,420 08 1,424 09 1,422 10 1,416 11 1,426 12 1,416 13 1,420 14 1,420 15 1,426 16 1,428 17 1,428 18 1,426 19 1,422 20 1,420 21 1,426 22 1,428 23 1,418 Dec 01 00 1,418 01 1,418 02 1,414 03 1,410 04 1,410 05 1,404 06 1,412 07 1,416 08 1,422 09 1,420 10 1,412 11 1,424 12 1,422 13 1,436 14 1,426 15 1,426 16 1,424 17 1,432 18 1,426 19 1,432 20 1,424 21 1,418 22 1,422 23 1,424 Dec 02 00 1,418 01 1,420 02 1,422 03 1,428 04 1,424 05 1,422 06 1,418 07 1,420 08 1,418 09 1,430 10 1,422 11 1,416 12 1,416 13 1,420 14 1,414 15 1,420 16 1,426 17 1,428 18 1,432 19 1,432 20 1,426 21 1,432 22 1,432 23 1,430 Dec 03 00 1,430 01 1,432 02 1,428 03 1,428 04 1,428 05 1,430 06 1,430 07 1,430 08 1,430 09 1,432 10 1,438 11 1,436 12 1,430 13 1,428 14 1,432 15 1,430 16 1,436 17 1,432 18 1,428 19 1,424 20 1,434 21 1,428 22 1,424 23 1,428 Dec 04 00 1,428 01 1,428 02 1,430 03 1,426 04 1,432 05 1,432 06 1,434 07 1,428 08 1,434 09 1,432 10 1,418 11 1,428 12 1,428 13 1,422 14 1,420 15 1,420 16 1,426 17 1,420 18 1,420 19 1,424 20 1,424 21 1,426 22 1,420 23 1,416 Dec 05 00 1,434 01 1,422 02 1,428 03 1,430 04 1,428 05 1,420 06 1,430 07 1,426 08 1,426 09 1,422 10 1,414 11 1,420 12 1,420 13 1,420 14 1,416 15 1,422 16 1,426 17 1,426 18 1,420 19 1,416 20 1,412 21 1,420 22 1,414 23 1,404 Dec 06 00 1,422 01 1,418 02 1,428 03 1,420 04 1,428 05 1,420 06 1,430 07 1,424 08 1,426 09 1,430 10 1,426 11 1,430 12 1,432 13 1,430 14 1,432 15 1,424 16 1,424 17 1,432 18 1,418 19 1,408 20 1,424 21 1,424 22 1,420 23 1,418 - FATAL: password authentication failed for user "ismael"
Detail: Connection matched file "/etc/postgresql/16/main/pg_hba.conf" line 143: "host all all 10.16.50.12/32 md5"
Date: 2025-11-30 04:03:13 Database: celspac Application: [unknown] User: ismael Remote: 10.16.50.12 Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
2 680 WARNING: there is already a transaction in progress
Times Reported Most Frequent Error / Event #2
Day Hour Count Nov 30 05 51 17 51 Dec 01 05 51 17 51 Dec 02 05 51 17 51 Dec 03 05 17 17 51 Dec 04 05 51 17 51 Dec 05 05 51 17 51 Dec 06 05 51 17 51 3 112 LOG: could not receive data from client: Connection reset by peer
Times Reported Most Frequent Error / Event #3
Day Hour Count Nov 30 01 2 23 14 Dec 01 01 2 23 14 Dec 02 01 2 23 14 Dec 03 01 2 23 14 Dec 04 01 2 23 14 Dec 05 01 2 23 14 Dec 06 01 2 23 14 4 2 LOG: process ... still waiting for AccessExclusiveLock on object 3090536 of class 2618 of database ... after ... ms
Times Reported Most Frequent Error / Event #4
Day Hour Count Dec 03 05 2 - LOG: process 1000964 still waiting for AccessExclusiveLock on object 3090536 of class 2618 of database 126311 after 1000.096 ms
- LOG: process 1000962 still waiting for AccessExclusiveLock on object 3090536 of class 2618 of database 126311 after 1000.319 ms
Detail: Process holding the lock: 1000960. Wait queue: 1000962, 1000964, 1000965.
Statement: /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subcohort"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__subcohort__dbt_backup" cascadeDate: 2025-12-03 05:02:05 Database: celspac Application: dbt User: tng_migration_user Remote: 127.0.0.1 Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
Detail: Process holding the lock: 1000960. Wait queue: 1000962, 1000964, 1000965.
Statement: /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subcohort_inform_consent"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent__dbt_backup" cascadeDate: 2025-12-03 05:02:05 Database: celspac Application: dbt User: tng_migration_user Remote: 127.0.0.1 Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
5 1 LOG: database system was shut down at ...
Times Reported Most Frequent Error / Event #5
Day Hour Count Dec 04 06 1 6 1 ERROR: deadlock detected
Times Reported Most Frequent Error / Event #6
Day Hour Count Dec 03 05 1 - ERROR: deadlock detected
Detail: Process 1000959 waits for AccessExclusiveLock on object 3090536 of class 2618 of database 126311; blocked by process 1000960. Process 1000960 waits for AccessExclusiveLock on object 3090544 of class 2618 of database 126311; blocked by process 1000959. Process 1000959: /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__pilot"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__pilot__dbt_backup" cascade Process 1000960: /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__inform_consent"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__inform_consent__dbt_backup" cascade
Hint: See server log for query details.
Statement: /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__pilot"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__pilot__dbt_backup" cascadeDate: 2025-12-03 05:02:05 Database: celspac Application: dbt User: tng_migration_user Remote: 127.0.0.1 Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
7 1 ERROR: process ... detected deadlock while waiting for AccessExclusiveLock on object 3090536 of class 2618 of database ... after ... ms
Times Reported Most Frequent Error / Event #7
Day Hour Count Dec 03 05 1 - ERROR: process 1000959 detected deadlock while waiting for AccessExclusiveLock on object 3090536 of class 2618 of database 126311 after 1000.092 ms
Detail: Process holding the lock: 1000960. Wait queue: 1000962, 1000964, 1000965.
Statement: /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__pilot"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__pilot__dbt_backup" cascadeDate: 2025-12-03 05:02:05 Database: celspac Application: dbt User: tng_migration_user Remote: 127.0.0.1 Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
8 1 LOG: process ... still waiting for AccessExclusiveLock on object 3090544 of class 2618 of database ... after ... ms
Times Reported Most Frequent Error / Event #8
Day Hour Count Dec 03 05 1 - LOG: process 1000960 still waiting for AccessExclusiveLock on object 3090544 of class 2618 of database 126311 after 1000.155 ms
Detail: Process holding the lock: 1000959. Wait queue: 1000960.
Statement: /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__inform_consent"} */ drop table if exists "celspac"."dbt_stg"."stg_celspac_admin__inform_consent__dbt_backup" cascadeDate: 2025-12-03 05:02:05 Database: celspac Application: dbt User: tng_migration_user Remote: 127.0.0.1 Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log