-
Global information
- Generated on Tue Dec 2 04:34:21 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 3,732,835 log entries in 34m19s
- Log start from 2025-12-01 00:00:02 to 2025-12-01 23:59:59
-
Overview
Global Stats
- 844 Number of unique normalized queries
- 447,736 Number of queries
- 29m49s Total query duration
- 2025-12-01 00:00:02 First query
- 2025-12-01 23:59:58 Last query
- 1,431 queries/s at 2025-12-01 06:00:03 Query peak
- 29m49s Total query duration
- 40s723ms Prepare/parse total duration
- 1m4s Bind total duration
- 28m3s Execute total duration
- 34,210 Number of events
- 3 Number of unique normalized events
- 34,092 Max number of times the same event was reported
- 0 Number of cancellation
- 438 Total number of automatic vacuums
- 482 Total number of automatic analyzes
- 6,674 Number temporary file
- 14.36 MiB Max size of temporary file
- 2.08 MiB Average size of temporary file
- 16,128 Total number of sessions
- 2 sessions at 2025-12-01 13:45:30 Session peak
- 1h2m49s Total duration of sessions
- 233ms Average duration of sessions
- 27 Average queries per session
- 110ms Average queries duration per session
- 122ms Average idle time per session
- 16,128 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,431 queries/s Query Peak
- 2025-12-01 06:00:03 Date
SELECT Traffic
Key values
- 1,425 queries/s Query Peak
- 2025-12-01 06:00:03 Date
INSERT/UPDATE/DELETE Traffic
Key values
- 1,224 queries/s Query Peak
- 2025-12-01 23:35:13 Date
Queries duration
Key values
- 29m49s 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) 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 Day Hour SELECT COPY TO Average Duration Latency Percentile(90) Latency Percentile(95) Latency Percentile(99) 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 Day Hour INSERT UPDATE DELETE COPY FROM Average Duration Latency Percentile(90) Latency Percentile(95) Latency Percentile(99) 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 Day Hour Prepare Bind Bind/Prepare Percentage of prepare 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% Day Hour Count Average / Second 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 Day Hour Count Average Duration Average idle time 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 -
Connections
Established Connections
Key values
- 15 connections Connection Peak
- 2025-12-01 17:02:04 Date
Connections per database
Key values
- celspac Main Database
- 16,128 connections Total
Connections per user
Key values
- tng_migration_user Main User
- 16,128 connections Total
-
Sessions
Simultaneous sessions
Key values
- 2 sessions Session Peak
- 2025-12-01 13:45:30 Date
Histogram of session times
Key values
- 15,643 0-500ms duration
Sessions per database
Key values
- celspac Main Database
- 16,128 sessions Total
Sessions per user
Key values
- tng_migration_user Main User
- 16,128 sessions Total
Sessions per host
Key values
- 127.0.0.1 Main Host
- 16,128 sessions Total
-
Checkpoints / Restartpoints
Checkpoints Buffers
Key values
- 9,383 buffers Checkpoint Peak
- 2025-12-01 17:08:59 Date
- 269.907 seconds Highest write time
- 0.435 seconds Sync time
Checkpoints Wal files
Key values
- 14 files Wal files usage Peak
- 2025-12-01 17:08:59 Date
Checkpoints distance
Key values
- 452.60 Mo Distance Peak
- 2025-12-01 05:08:48 Date
Checkpoints Activity
↑ Back to the top of the Checkpoint Activity tableDay Hour Written buffers Write time Sync time Total time 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 Day Hour Added Removed Recycled Synced files Longest sync Average sync 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 Day Hour Count Avg time (sec) 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 Day Hour Mean distance Mean estimate 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 -
Temporary Files
Size of temporary files
Key values
- 73.36 MiB Temp Files size Peak
- 2025-12-01 15:54:02 Date
Number of temporary files
Key values
- 36 per second Temp Files Peak
- 2025-12-01 09:18:02 Date
Temporary Files Activity
↑ Back to the top of the Temporary Files Activity tableDay Hour Count Total size Average size 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 Queries generating the most temporary files (N)
Rank Count Total size Min size Max size Avg size Query 1 6,641 13.44 GiB 688.00 KiB 10.52 MiB 2.07 MiB refresh materialized view core.mv_subject_form with data;-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-12-01 05:12:03 Duration: 1s817ms 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-01 16:06:03 Duration: 1s801ms 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-01 15:42:03 Duration: 1s729ms 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 8 12.19 MiB 8.00 KiB 3.33 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-01 05:02:04 Duration: 150ms 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-01 17:02:05 Duration: 129ms 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-01 05:02:04 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
3 8 1.96 MiB 8.00 KiB 816.00 KiB 251.00 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-12-01 17:02:19 Duration: 32ms 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-01 05:02:18 Duration: 30ms 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-01 05:02:18 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
4 6 42.07 MiB 2.49 MiB 14.36 MiB 7.01 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-01 05:02:18 Duration: 1s269ms 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-01 17:02:19 Duration: 1s223ms 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-01 05:02:18 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
5 5 43.98 MiB 2.76 MiB 11.91 MiB 8.80 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-01 17:11:44 Duration: 9m20s 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-01 05:02:57 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
6 4 35.89 MiB 7.70 MiB 10.25 MiB 8.97 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-01 05:02:04 Duration: 519ms 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-01 17:02:05 Duration: 499ms 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-01 05:02:04 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
7 2 7.55 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-12-01 17:02:21 Duration: 790ms 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-01 05:02:20 Duration: 764ms 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-01 05:02:20 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
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-01 05:02:18 - 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-01 17:02:19 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
3 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 ]
4 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 ]
5 10.52 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-12-01 10:18:02 ]
6 10.48 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-12-01 10:00:03 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
7 10.25 MiB /* {"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-01 17:02:05 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
8 9.86 MiB /* {"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-01 05:02:04 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
9 8.70 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 ]
10 8.70 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 ]
11 8.54 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-12-01 15:00:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
12 8.53 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-12-01 10:48:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
13 8.53 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-12-01 13:48:03 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
14 8.53 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-12-01 13:54:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
15 8.51 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-12-01 19:06:02 ]
16 8.49 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-12-01 21:42:02 ]
17 8.48 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-12-01 21:00:02 ]
18 8.42 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-12-01 08:36:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
19 8.32 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-12-01 14:48:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
20 8.30 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-12-01 22:24:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
-
Vacuums
Vacuums / Analyzes Distribution
Key values
- 1.19 sec Highest CPU-cost vacuum
Table dbt_stg.stg_celspac_admin__subject_inform_consent
Database celspac - 2025-12-01 05:02:28 Date
- 0 sec Highest CPU-cost analyze
Table
Database celspac - Date
Average Autovacuum Duration
Key values
- 1.19 sec Highest CPU-cost vacuum
Table dbt_stg.stg_celspac_admin__subject_inform_consent
Database celspac - 2025-12-01 05:02:28 Date
Analyzes per table
Key values
- core.mv_subject_form (188) Main table analyzed (database celspac)
- 482 analyzes Total
Table Number of analyzes celspac.core.mv_subject_form 188 celspac.core.mv_subject_event 126 celspac.public.scheduled_command 33 celspac.pg_catalog.pg_class 31 celspac.pg_catalog.pg_type 7 celspac.pg_catalog.pg_index 6 celspac.pg_catalog.pg_depend 5 celspac.pg_catalog.pg_attribute 5 postgres.pg_catalog.pg_shdepend 4 celspac.core.cohort 3 celspac.dbt_marts_dbt.export_proband_by_pilot__25 2 celspac.dbt_marts_dbt.export_proband_by_pilot__11 2 celspac.dbt_marts_dbt.export_proband_by_pilot__30 2 celspac.dbt_stg.stg_celspac_admin__inform_consent 2 celspac.dbt_marts_dbt.export_proband_by_pilot__22 2 celspac.dbt_marts_dbt_all.export_proband_all 2 celspac.dbt_marts_dbt.export_proband_by_pilot__17 2 celspac.dbt_marts_dbt.export_proband_by_pilot__20 2 celspac.dbt_marts_dbt.export_proband_by_pilot__12 2 celspac.dbt_marts_dbt.export_proband_by_pilot__15 2 celspac.dbt_marts_dbt.export_proband_by_pilot__19 2 celspac.dbt_stg.inte_unique_subject_extend_columns 2 celspac.dbt_marts_dbt.export_proband_by_pilot__36 2 celspac.dbt_marts_dbt.export_proband_by_pilot__1 2 celspac.dbt_stg.inte_unique_subject_extend 2 celspac.dbt_stg.inte_subject_extend 2 celspac.dbt_marts_dbt.export_proband_by_pilot__10 2 celspac.dbt_stg.stg_celspac_admin__subcohort_inform_consent 2 celspac.dbt_marts_dbt.export_proband_by_pilot__27 2 celspac.dbt_marts_dbt.export_proband_by_pilot__29 2 celspac.dbt_marts_dbt.export_proband_by_pilot__35 2 celspac.dbt_marts_dbt.export_proband_by_pilot__26 2 celspac.dbt_marts_dbt.export_proband_by_pilot__37 2 celspac.dbt_marts_dbt.export_proband_by_pilot__21 2 celspac.dbt_marts_dbt.export_proband_by_pilot__18 2 celspac.dbt_marts_dbt.export_proband_by_pilot__7 2 template1.pg_catalog.pg_shdepend 2 celspac.dbt_marts_dbt.export_proband_by_pilot__4 2 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 2 celspac.dbt_stg.inte_unique_subject_extend_array 2 celspac.dbt_stg.stg_celspac_admin__subcohort 2 celspac.dbt_marts_dbt.export_proband_by_pilot__23 2 celspac.dbt_marts_dbt.export_proband_by_pilot__9 2 celspac.dbt_stg.stg_celspac_admin__subject 2 celspac.dbt_marts_dbt.test_export 2 celspac.dbt_marts_dbt.export_proband_by_pilot__5 2 celspac.dbt_marts_dbt.export_proband_by_pilot__8 2 Total 482 Vacuums per table
Key values
- core.mv_subject_form (188) Main table vacuumed on database celspac
- 438 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 188 0 882,981 0 46,805 0 0 412,472 224 26,061,676 0 0 celspac.core.mv_subject_event 126 0 25,897 0 523 0 0 4,158 159 1,456,516 0 0 celspac.pg_catalog.pg_class 46 0 6,070 0 185 0 0 639 254 433,826 168 553 celspac.pg_catalog.pg_attribute 23 2 36,867 0 1,223 0 0 2,577 1,000 3,232,581 82 2,237 celspac.pg_catalog.pg_type 9 7 2,649 0 731 0 0 1,494 432 690,120 89 175 celspac.pg_catalog.pg_depend 5 5 7,296 0 588 0 0 1,268 373 625,230 90 643 celspac.pg_catalog.pg_statistic 3 0 2,634 0 1,309 0 0 1,443 540 410,283 107 358 celspac.pg_catalog.pg_index 3 3 1,152 0 667 0 0 1,133 319 264,196 6 6 celspac.dbt_marts_dbt.export_proband_by_pilot__20 2 0 760 0 81 0 0 6 0 552 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__26 2 0 580 0 126 0 0 6 0 552 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__17 2 0 740 0 86 0 0 6 0 552 0 0 celspac.dbt_marts_dbt_all.export_proband_all 2 0 7,741 0 3,187 0 0 2,170 1 136,485 0 0 postgres.pg_catalog.pg_shdepend 2 2 534 0 368 0 0 572 178 134,110 22 56 celspac.dbt_marts_dbt.export_proband_by_pilot__22 2 0 274 0 70 0 0 2 0 376 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__27 2 0 616 0 117 0 0 6 0 552 0 0 celspac.dbt_marts_dbt.test_export 2 0 84 0 36 0 0 20 1 9,575 0 0 celspac.dbt_stg.inte_subject_extend 2 0 5,331 0 5,208 0 0 5,202 2 323,570 0 0 celspac.dbt_stg.stg_celspac_admin__subject 2 0 9,049 0 8 0 0 4,440 2 278,612 0 0 celspac.dbt_stg.inte_unique_subject_extend 2 0 4,256 0 3,860 0 0 3,854 2 244,038 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__23 2 0 1,808 0 8 0 0 6 0 552 0 0 celspac.dbt_stg.inte_unique_subject_extend_array 2 0 7,353 0 7,266 0 0 7,260 2 444,992 0 0 celspac.dbt_stg.inte_unique_subject_extend_columns 2 0 3,214 0 1,436 0 0 1,436 2 101,316 0 0 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 2 0 21,370 0 9,621 0 0 10,549 2 639,043 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__19 2 0 7,104 0 2,257 0 0 3,678 2 233,760 0 0 template1.pg_catalog.pg_shdepend 1 1 296 0 140 0 0 256 103 79,777 46 80 celspac.pg_toast.pg_toast_2619 1 1 186 0 85 0 0 160 36 80,110 1 5 celspac.pg_toast.pg_toast_2618 1 1 128 0 90 0 0 153 31 26,846 0 0 Total 438 22 1,036,970 50,570 86,081 0 0 464,966 3,665 35,909,798 611 4,113 Vacuum throughput per table
Key values
- core.mv_subject_form (20.73) 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 20.73 celspac.core.mv_subject_event 0 0 0 celspac.pg_catalog.pg_class 0 0 0 celspac.pg_catalog.pg_attribute 0 0 1.2 celspac.pg_catalog.pg_type 0 0 0.24 celspac.pg_catalog.pg_depend 0 0 0.38 celspac.pg_catalog.pg_statistic 0 0 0.43 celspac.pg_catalog.pg_index 0 0 0.19 celspac.dbt_marts_dbt.export_proband_by_pilot__20 0 0 0.01 celspac.dbt_marts_dbt.export_proband_by_pilot__26 0 0 0.02 celspac.dbt_marts_dbt.export_proband_by_pilot__17 0 0 0.01 celspac.dbt_marts_dbt_all.export_proband_all 0 0 0.78 postgres.pg_catalog.pg_shdepend 0 0 0.09 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.02 celspac.dbt_marts_dbt.test_export 0 0 0 celspac.dbt_stg.inte_subject_extend 0 0 1.36 celspac.dbt_stg.stg_celspac_admin__subject 0 0 0.11 celspac.dbt_stg.inte_unique_subject_extend 0 0 1.01 celspac.dbt_marts_dbt.export_proband_by_pilot__23 0 0 0.02 celspac.dbt_stg.inte_unique_subject_extend_array 0 0 1.87 celspac.dbt_stg.inte_unique_subject_extend_columns 0 0 0.34 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 0 0 2.32 celspac.dbt_marts_dbt.export_proband_by_pilot__19 0 0 0.57 template1.pg_catalog.pg_shdepend 0 0 0.04 celspac.pg_toast.pg_toast_2619 0 0 0.02 celspac.pg_toast.pg_toast_2618 0 0 0.02 Total 0 0 31.79 Tuples removed per table
Key values
- pg_catalog.pg_attribute (25515) Main table with removed tuples on database celspac
- 50265 tuples Total removed
Index Tuples Pages Table Vacuums scans removed remain not yet removable removed remain celspac.pg_catalog.pg_attribute 23 2 25,515 1,705,216 141,415 0 277,288 celspac.pg_catalog.pg_statistic 3 0 15,099 431,988 7,351 0 121,896 celspac.pg_catalog.pg_class 46 0 4,529 87,392 1,854 0 206,080 celspac.pg_catalog.pg_depend 5 5 2,850 57,632 0 0 3,575 celspac.pg_catalog.pg_type 9 7 1,099 19,058 496 0 6,462 celspac.pg_catalog.pg_index 3 3 401 2,771 23 0 822 postgres.pg_catalog.pg_shdepend 2 2 300 2,018 0 0 204 celspac.pg_toast.pg_toast_2619 1 1 171 2,064 41 0 860 celspac.pg_toast.pg_toast_2618 1 1 153 520 0 0 581 template1.pg_catalog.pg_shdepend 1 1 148 1,009 0 0 102 celspac.dbt_marts_dbt.export_proband_by_pilot__20 2 0 0 2,688 0 110 146 celspac.dbt_marts_dbt.export_proband_by_pilot__26 2 0 0 4,372 0 20 236 celspac.dbt_marts_dbt.export_proband_by_pilot__17 2 0 0 2,928 0 100 156 celspac.dbt_marts_dbt_all.export_proband_all 2 0 0 100,203 0 0 4,352 celspac.dbt_marts_dbt.export_proband_by_pilot__22 2 0 0 2,394 0 0 128 celspac.core.mv_subject_event 126 0 0 285,162 0 252 3,780 celspac.dbt_marts_dbt.export_proband_by_pilot__27 2 0 0 4,476 0 38 218 celspac.dbt_marts_dbt.test_export 2 0 0 2,928 0 4 28 celspac.dbt_stg.inte_subject_extend 2 0 0 104,003 0 0 5,248 celspac.dbt_stg.stg_celspac_admin__subject 2 0 0 100,341 0 0 4,480 celspac.dbt_stg.inte_unique_subject_extend 2 0 0 100,249 0 0 3,968 celspac.dbt_marts_dbt.export_proband_by_pilot__23 2 0 0 15,346 0 122 646 celspac.dbt_stg.inte_unique_subject_extend_array 2 0 0 100,249 0 0 7,296 celspac.core.mv_subject_form 188 0 0 31,000,950 0 0 421,120 celspac.dbt_stg.inte_unique_subject_extend_columns 2 0 0 100,249 0 106 1,430 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 2 0 0 635,235 0 0 10,624 celspac.dbt_marts_dbt.export_proband_by_pilot__19 2 0 0 61,730 0 0 3,712 Total 438 22 50,265 34,933,171 151,180 752 1,085,438 Pages removed per table
Key values
- core.mv_subject_event (252) Main table with removed pages on database celspac
- 752 pages Total removed
Table Number of vacuums Index scans Tuples removed Pages removed celspac.core.mv_subject_event 126 0 0 252 celspac.dbt_marts_dbt.export_proband_by_pilot__23 2 0 0 122 celspac.dbt_marts_dbt.export_proband_by_pilot__20 2 0 0 110 celspac.dbt_stg.inte_unique_subject_extend_columns 2 0 0 106 celspac.dbt_marts_dbt.export_proband_by_pilot__17 2 0 0 100 celspac.dbt_marts_dbt.export_proband_by_pilot__27 2 0 0 38 celspac.dbt_marts_dbt.export_proband_by_pilot__26 2 0 0 20 celspac.dbt_marts_dbt.test_export 2 0 0 4 template1.pg_catalog.pg_shdepend 1 1 148 0 celspac.pg_catalog.pg_statistic 3 0 15099 0 celspac.pg_toast.pg_toast_2619 1 1 171 0 celspac.pg_toast.pg_toast_2618 1 1 153 0 celspac.dbt_marts_dbt_all.export_proband_all 2 0 0 0 postgres.pg_catalog.pg_shdepend 2 2 300 0 celspac.dbt_marts_dbt.export_proband_by_pilot__22 2 0 0 0 celspac.pg_catalog.pg_attribute 23 2 25515 0 celspac.dbt_stg.inte_subject_extend 2 0 0 0 celspac.dbt_stg.stg_celspac_admin__subject 2 0 0 0 celspac.dbt_stg.inte_unique_subject_extend 2 0 0 0 celspac.pg_catalog.pg_depend 5 5 2850 0 celspac.pg_catalog.pg_index 3 3 401 0 celspac.dbt_stg.inte_unique_subject_extend_array 2 0 0 0 celspac.pg_catalog.pg_class 46 0 4529 0 celspac.core.mv_subject_form 188 0 0 0 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 2 0 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__19 2 0 0 0 celspac.pg_catalog.pg_type 9 7 1099 0 Total 438 22 50,265 752 Autovacuum Activity
↑ Back to the top of the Autovacuum Activity tableDay Hour VACUUMs ANALYZEs 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 - 1.19 sec Highest CPU-cost vacuum
-
Locks
Locks by types
Key values
- unknown Main Lock Type
- 0 locks Total
Most frequent waiting queries (N)
Rank Count Total time Min time Max time Avg duration Query NO DATASET
Queries that waited the most
Rank Wait time Query NO DATASET
-
Queries
Queries by type
Key values
- 415,149 Total read queries
- 19,652 Total write queries
Queries by database
Key values
- celspac Main database
- 444,832 Requests
- 28m1s (celspac)
- Main time consuming database
Queries by user
Key values
- tng_migration_user Main user
- 717,710 Requests
User Request type Count Duration postgres Total 7,932 5s903ms select 7,932 5s903ms tng__dwh_celspac_fdw Total 11,753 3s227ms cursor 11,557 3s220ms others 140 6ms tcl 56 0ms tng_migration_user Total 717,710 51m9s cte 2,616 51s119ms ddl 736 39m40s insert 2,460 2s639ms others 22,511 8m35s select 669,765 1m40s tcl 14,975 10s412ms update 4,647 7s817ms Duration by user
Key values
- 51m9s (tng_migration_user) Main time consuming user
User Request type Count Duration postgres Total 7,932 5s903ms select 7,932 5s903ms tng__dwh_celspac_fdw Total 11,753 3s227ms cursor 11,557 3s220ms others 140 6ms tcl 56 0ms tng_migration_user Total 717,710 51m9s cte 2,616 51s119ms ddl 736 39m40s insert 2,460 2s639ms others 22,511 8m35s select 669,765 1m40s tcl 14,975 10s412ms update 4,647 7s817ms Queries by host
Key values
- 127.0.0.1 Main host
- 717,734 Requests
- 51m9s (127.0.0.1)
- Main time consuming host
Queries by application
Key values
- [unknown] Main application
- 439,759 Requests
- 22m19s (dbt)
- Main time consuming application
Application Request type Count Duration [unknown] Total 439,759 5m43s insert 1,439 1s665ms others 12,853 4m16s select 415,049 1m16s tcl 7,827 4s127ms update 2,591 4s490ms dbt Total 2,076 22m19s cte 1,308 25s474ms ddl 368 21m51s others 12 181ms select 76 758ms tcl 312 1s32ms pg_dumpall Total 24 4ms select 24 4ms postgres_fdw Total 5,877 1s614ms cursor 5,779 1s611ms others 70 3ms tcl 28 0ms Number of cancelled queries
Key values
- 0 per second Cancelled query Peak
- 2025-12-01 23:11:08 Date
Number of cancelled queries (5 minutes period)
NO DATASET
-
Top Queries
Histogram of query times
Key values
- 431,602 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 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 ]
3 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 ]
4 34s774ms /* {"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 17:03:00 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
5 12s17ms /* {"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 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
6 5s236ms /* {"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-01 05:02:35 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
7 5s207ms /* {"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-01 17:02:34 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
8 5s194ms /* {"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 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
9 4s777ms /* {"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 05:02:35 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
10 3s155ms /* {"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-01 17:02:26 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
11 3s116ms /* {"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-01 05:02:26 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
12 2s660ms /* {"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-01 05:02:27 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
13 2s610ms /* {"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-01 17:02:27 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
14 1s997ms /* {"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-01 17:02:27 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
15 1s931ms /* {"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 17:02:27 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
16 1s892ms /* {"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 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
17 1s818ms /* {"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 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
18 1s817ms REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-12-01 05:12:03 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] - Bind query: yes ]
19 1s801ms REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-12-01 16:06:03 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] - Bind query: yes ]
20 1s774ms /* {"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 17:02:24 - 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 18m55s 2 9m20s 9m35s 9m27s 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 Dec 01 05 1 9m35s 9m35s 17 1 9m20s 9m20s [ User: tng_migration_user - Total duration: 18m55s - Times executed: 2 ]
[ Application: dbt - Total duration: 18m55s - Times executed: 2 ]
-
/* {"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-01 17:11:44 Duration: 9m20s 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-01 05:02:57 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
2 3m57s 188 1s144ms 1s817ms 1s263ms refresh materialized view core.mv_subject_form with data;Times Reported Time consuming queries #2
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 3m57s - Times executed: 188 ]
[ Application: [unknown] - Total duration: 3m57s - Times executed: 188 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-12-01 05:12:03 Duration: 1s817ms 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-01 16:06:03 Duration: 1s801ms 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-01 15:42:03 Duration: 1s729ms 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 1m13s 2 34s774ms 39s78ms 36s926ms 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 Dec 01 05 1 39s78ms 39s78ms 17 1 34s774ms 34s774ms [ User: tng_migration_user - Total duration: 1m13s - Times executed: 2 ]
[ Application: dbt - Total duration: 1m13s - Times executed: 2 ]
-
/* {"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-01 17:03:00 Duration: 34s774ms 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 17s587ms 126 113ms 464ms 139ms refresh materialized view core.mv_subject_event with data;Times Reported Time consuming queries #4
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 17s587ms - Times executed: 126 ]
[ Application: [unknown] - Total duration: 17s587ms - Times executed: 126 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-12-01 16:32:02 Duration: 464ms 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-12-01 13:23:02 Duration: 432ms 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-12-01 17:41:02 Duration: 206ms 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 13s949ms 2 1s931ms 12s17ms 6s974ms 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 #5
Day Hour Count Duration Avg duration Dec 01 05 1 12s17ms 12s17ms 17 1 1s931ms 1s931ms [ User: tng_migration_user - Total duration: 13s949ms - Times executed: 2 ]
[ Application: dbt - Total duration: 13s949ms - Times executed: 2 ]
-
/* {"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-01 17:02:27 Duration: 1s931ms 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 13s53ms 160 33ms 250ms 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 Dec 01 05 80 6s608ms 82ms 17 80 6s445ms 80ms [ User: tng_migration_user - Total duration: 13s53ms - Times executed: 160 ]
[ Application: dbt - Total duration: 13s53ms - Times executed: 160 ]
-
/* {"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-01 17:02:23 Duration: 250ms 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-01 05:02:20 Duration: 219ms 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-01 17:02:24 Duration: 213ms 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 12s429ms 21,996 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 #7
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 12s429ms - Times executed: 21996 ]
[ Application: [unknown] - Total duration: 12s429ms - Times executed: 21996 ]
-
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 ('86') AND m0_.form_id IS NULL AND m0_.result_date <= '2021-12-17 20:00:01' AND m0_.use_alternative <> 't';
Date: 2025-12-01 20:00:03 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 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 ('171') AND m0_.form_id IS NULL AND m0_.result_date <= '2022-11-14 22:00:02' AND m0_.use_alternative <> 't';
Date: 2025-12-01 22:00:04 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
8 12s141ms 156 40ms 217ms 77ms 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 #8
Day Hour Count Duration Avg duration Dec 01 05 78 5s968ms 76ms 17 78 6s172ms 79ms [ User: tng_migration_user - Total duration: 12s141ms - Times executed: 156 ]
[ Application: dbt - Total duration: 12s141ms - Times executed: 156 ]
-
/* {"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-01 17:02:22 Duration: 190ms 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: 141ms 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 10s444ms 2 5s207ms 5s236ms 5s222ms 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 Dec 01 05 1 5s236ms 5s236ms 17 1 5s207ms 5s207ms [ User: tng_migration_user - Total duration: 10s444ms - Times executed: 2 ]
[ Application: dbt - Total duration: 10s444ms - Times executed: 2 ]
-
/* {"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-01 05:02:35 Duration: 5s236ms 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-01 17:02:34 Duration: 5s207ms 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 9s971ms 2 4s777ms 5s194ms 4s985ms 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 Dec 01 05 1 4s777ms 4s777ms 17 1 5s194ms 5s194ms [ User: tng_migration_user - Total duration: 9s971ms - Times executed: 2 ]
[ Application: dbt - Total duration: 9s971ms - Times executed: 2 ]
-
/* {"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
-
/* {"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 05:02:35 Duration: 4s777ms 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 6s922ms 4,914 1ms 7ms 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 #11
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 6s922ms - Times executed: 4914 ]
[ Application: [unknown] - Total duration: 6s922ms - Times executed: 4914 ]
-
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 = '46235' 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 08:10:52 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 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 = '38140' 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 07:54:34 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 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 = '50149' 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 11:11:54 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
12 6s863ms 56 10ms 211ms 122ms select distinct d0_.id as id_0, d0_.created_at as created_at_1 from core.document d0_ inner join core.document_subject_inform_consent d2_ on d0_.id = d2_.id_document inner join core.subject_inform_consent s1_ on s1_.id = d2_.id_subject_inform_consent inner join core.subject s3_ on s1_.subject_id = s3_.id inner join core.subcohort_inform_consent s4_ on s1_.subcohort_inform_consent_id = s4_.id inner join core.document_type d5_ on d0_.document_type = d5_.code inner join core.document_mimetype d6_ on d0_.document_mimetype_id = d6_.id left join core.amendment a7_ on d0_.amendment_id = a7_.id where d0_.id in ( select d8_.id from core.document d8_ inner join core.document_subject_inform_consent d10_ on d8_.id = d10_.id_document inner join core.subject_inform_consent s9_ on s9_.id = d10_.id_subject_inform_consent inner join core.subject s11_ on s9_.subject_id = s11_.id inner join core.subcohort_inform_consent s12_ on s9_.subcohort_inform_consent_id = s12_.id where lower(s11_.tng_id) like lower(? || ? || ?) and s12_.subcohort_id = ? and d8_.document_type in (...) and d8_.deleted = ? and d8_.is_draft = ?) order by d0_.created_at desc limit ?;Times Reported Time consuming queries #12
Day Hour Count Duration Avg duration Dec 01 10 1 10ms 10ms 13 2 139ms 69ms 18 32 3s515ms 109ms 19 7 893ms 127ms 20 10 1s564ms 156ms 21 3 591ms 197ms 22 1 147ms 147ms [ User: tng_migration_user - Total duration: 6s863ms - Times executed: 56 ]
[ Application: [unknown] - Total duration: 6s863ms - Times executed: 56 ]
-
SELECT DISTINCT d0_.id AS id_0, d0_.created_at AS created_at_1 FROM core.document d0_ INNER JOIN core.document_subject_inform_consent d2_ ON d0_.id = d2_.id_document INNER JOIN core.subject_inform_consent s1_ ON s1_.id = d2_.id_subject_inform_consent INNER JOIN core.subject s3_ ON s1_.subject_id = s3_.id INNER JOIN core.subcohort_inform_consent s4_ ON s1_.subcohort_inform_consent_id = s4_.id INNER JOIN core.document_type d5_ ON d0_.document_type = d5_.code INNER JOIN core.document_mimetype d6_ ON d0_.document_mimetype_id = d6_.id LEFT JOIN core.amendment a7_ ON d0_.amendment_id = a7_.id WHERE d0_.id IN ( SELECT d8_.id FROM core.document d8_ INNER JOIN core.document_subject_inform_consent d10_ ON d8_.id = d10_.id_document INNER JOIN core.subject_inform_consent s9_ ON s9_.id = d10_.id_subject_inform_consent INNER JOIN core.subject s11_ ON s9_.subject_id = s11_.id INNER JOIN core.subcohort_inform_consent s12_ ON s9_.subcohort_inform_consent_id = s12_.id WHERE LOWER(s11_.tng_id) LIKE LOWER('%' || 'cls-wogbzf' || '%') AND s12_.subcohort_id = '79' AND d8_.document_type IN ('DOCUMENT_EXAMINATION_RESULT_ALEX', 'DOCUMENT_EXAMINATION_RESULT_BLOOD', 'DOCUMENT_EXAMINATION_RESULT_DEXA', 'DOCUMENT_EXAMINATION_RESULT_DUST', 'DOCUMENT_EXAMINATION_RESULT_IDS', 'DOCUMENT_EXAMINATION_RESULT_INBODY', 'DOCUMENT_EXAMINATION_RESULT_MRI', 'DOCUMENT_EXAMINATION_RESULT_SPIRO') AND d8_.deleted = 'f' AND d8_.is_draft = 'f') ORDER BY d0_.created_at DESC LIMIT 10;
Date: 2025-12-01 20:32:45 Duration: 211ms 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 DISTINCT d0_.id AS id_0, d0_.created_at AS created_at_1 FROM core.document d0_ INNER JOIN core.document_subject_inform_consent d2_ ON d0_.id = d2_.id_document INNER JOIN core.subject_inform_consent s1_ ON s1_.id = d2_.id_subject_inform_consent INNER JOIN core.subject s3_ ON s1_.subject_id = s3_.id INNER JOIN core.subcohort_inform_consent s4_ ON s1_.subcohort_inform_consent_id = s4_.id INNER JOIN core.document_type d5_ ON d0_.document_type = d5_.code INNER JOIN core.document_mimetype d6_ ON d0_.document_mimetype_id = d6_.id LEFT JOIN core.amendment a7_ ON d0_.amendment_id = a7_.id WHERE d0_.id IN ( SELECT d8_.id FROM core.document d8_ INNER JOIN core.document_subject_inform_consent d10_ ON d8_.id = d10_.id_document INNER JOIN core.subject_inform_consent s9_ ON s9_.id = d10_.id_subject_inform_consent INNER JOIN core.subject s11_ ON s9_.subject_id = s11_.id INNER JOIN core.subcohort_inform_consent s12_ ON s9_.subcohort_inform_consent_id = s12_.id WHERE LOWER(s11_.tng_id) LIKE LOWER('%' || 'cls-gibinu' || '%') AND s12_.subcohort_id = '79' AND d8_.document_type IN ('DOCUMENT_EXAMINATION_RESULT_ALEX', 'DOCUMENT_EXAMINATION_RESULT_BLOOD', 'DOCUMENT_EXAMINATION_RESULT_DEXA', 'DOCUMENT_EXAMINATION_RESULT_DUST', 'DOCUMENT_EXAMINATION_RESULT_IDS', 'DOCUMENT_EXAMINATION_RESULT_INBODY', 'DOCUMENT_EXAMINATION_RESULT_MRI', 'DOCUMENT_EXAMINATION_RESULT_SPIRO') AND d8_.deleted = 'f' AND d8_.is_draft = 'f') ORDER BY d0_.created_at DESC LIMIT 10;
Date: 2025-12-01 20:21:40 Duration: 209ms 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 DISTINCT d0_.id AS id_0, d0_.created_at AS created_at_1 FROM core.document d0_ INNER JOIN core.document_subject_inform_consent d2_ ON d0_.id = d2_.id_document INNER JOIN core.subject_inform_consent s1_ ON s1_.id = d2_.id_subject_inform_consent INNER JOIN core.subject s3_ ON s1_.subject_id = s3_.id INNER JOIN core.subcohort_inform_consent s4_ ON s1_.subcohort_inform_consent_id = s4_.id INNER JOIN core.document_type d5_ ON d0_.document_type = d5_.code INNER JOIN core.document_mimetype d6_ ON d0_.document_mimetype_id = d6_.id LEFT JOIN core.amendment a7_ ON d0_.amendment_id = a7_.id WHERE d0_.id IN ( SELECT d8_.id FROM core.document d8_ INNER JOIN core.document_subject_inform_consent d10_ ON d8_.id = d10_.id_document INNER JOIN core.subject_inform_consent s9_ ON s9_.id = d10_.id_subject_inform_consent INNER JOIN core.subject s11_ ON s9_.subject_id = s11_.id INNER JOIN core.subcohort_inform_consent s12_ ON s9_.subcohort_inform_consent_id = s12_.id WHERE LOWER(s11_.tng_id) LIKE LOWER('%' || 'cls-hndywa' || '%') AND s12_.subcohort_id = '80' AND d8_.document_type IN ('DOCUMENT_EXAMINATION_RESULT_ALEX', 'DOCUMENT_EXAMINATION_RESULT_BLOOD', 'DOCUMENT_EXAMINATION_RESULT_DEXA', 'DOCUMENT_EXAMINATION_RESULT_DUST', 'DOCUMENT_EXAMINATION_RESULT_IDS', 'DOCUMENT_EXAMINATION_RESULT_INBODY', 'DOCUMENT_EXAMINATION_RESULT_MRI', 'DOCUMENT_EXAMINATION_RESULT_SPIRO') AND d8_.deleted = 'f' AND d8_.is_draft = 'f') ORDER BY d0_.created_at DESC LIMIT 10;
Date: 2025-12-01 18:22:50 Duration: 209ms 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 6s856ms 56 11ms 211ms 122ms select count(distinct d0_.id) as sclr_0 from core.document d0_ inner join core.document_subject_inform_consent d2_ on d0_.id = d2_.id_document inner join core.subject_inform_consent s1_ on s1_.id = d2_.id_subject_inform_consent inner join core.subject s3_ on s1_.subject_id = s3_.id inner join core.subcohort_inform_consent s4_ on s1_.subcohort_inform_consent_id = s4_.id inner join core.document_type d5_ on d0_.document_type = d5_.code inner join core.document_mimetype d6_ on d0_.document_mimetype_id = d6_.id left join core.amendment a7_ on d0_.amendment_id = a7_.id where d0_.id in ( select d8_.id from core.document d8_ inner join core.document_subject_inform_consent d10_ on d8_.id = d10_.id_document inner join core.subject_inform_consent s9_ on s9_.id = d10_.id_subject_inform_consent inner join core.subject s11_ on s9_.subject_id = s11_.id inner join core.subcohort_inform_consent s12_ on s9_.subcohort_inform_consent_id = s12_.id where lower(s11_.tng_id) like lower(? || ? || ?) and s12_.subcohort_id = ? and d8_.document_type in (...) and d8_.deleted = ? and d8_.is_draft = ?);Times Reported Time consuming queries #13
Day Hour Count Duration Avg duration Dec 01 10 1 12ms 12ms 13 2 154ms 77ms 18 32 3s513ms 109ms 19 7 905ms 129ms 20 10 1s553ms 155ms 21 3 563ms 187ms 22 1 153ms 153ms [ User: tng_migration_user - Total duration: 6s856ms - Times executed: 56 ]
[ Application: [unknown] - Total duration: 6s856ms - Times executed: 56 ]
-
SELECT count(DISTINCT d0_.id) AS sclr_0 FROM core.document d0_ INNER JOIN core.document_subject_inform_consent d2_ ON d0_.id = d2_.id_document INNER JOIN core.subject_inform_consent s1_ ON s1_.id = d2_.id_subject_inform_consent INNER JOIN core.subject s3_ ON s1_.subject_id = s3_.id INNER JOIN core.subcohort_inform_consent s4_ ON s1_.subcohort_inform_consent_id = s4_.id INNER JOIN core.document_type d5_ ON d0_.document_type = d5_.code INNER JOIN core.document_mimetype d6_ ON d0_.document_mimetype_id = d6_.id LEFT JOIN core.amendment a7_ ON d0_.amendment_id = a7_.id WHERE d0_.id IN ( SELECT d8_.id FROM core.document d8_ INNER JOIN core.document_subject_inform_consent d10_ ON d8_.id = d10_.id_document INNER JOIN core.subject_inform_consent s9_ ON s9_.id = d10_.id_subject_inform_consent INNER JOIN core.subject s11_ ON s9_.subject_id = s11_.id INNER JOIN core.subcohort_inform_consent s12_ ON s9_.subcohort_inform_consent_id = s12_.id WHERE LOWER(s11_.tng_id) LIKE LOWER('%' || 'cls-wogbzf' || '%') AND s12_.subcohort_id = '79' AND d8_.document_type IN ('DOCUMENT_EXAMINATION_RESULT_ALEX', 'DOCUMENT_EXAMINATION_RESULT_BLOOD', 'DOCUMENT_EXAMINATION_RESULT_DEXA', 'DOCUMENT_EXAMINATION_RESULT_DUST', 'DOCUMENT_EXAMINATION_RESULT_IDS', 'DOCUMENT_EXAMINATION_RESULT_INBODY', 'DOCUMENT_EXAMINATION_RESULT_MRI', 'DOCUMENT_EXAMINATION_RESULT_SPIRO') AND d8_.deleted = 'f' AND d8_.is_draft = 'f');
Date: 2025-12-01 20:32:44 Duration: 211ms 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(DISTINCT d0_.id) AS sclr_0 FROM core.document d0_ INNER JOIN core.document_subject_inform_consent d2_ ON d0_.id = d2_.id_document INNER JOIN core.subject_inform_consent s1_ ON s1_.id = d2_.id_subject_inform_consent INNER JOIN core.subject s3_ ON s1_.subject_id = s3_.id INNER JOIN core.subcohort_inform_consent s4_ ON s1_.subcohort_inform_consent_id = s4_.id INNER JOIN core.document_type d5_ ON d0_.document_type = d5_.code INNER JOIN core.document_mimetype d6_ ON d0_.document_mimetype_id = d6_.id LEFT JOIN core.amendment a7_ ON d0_.amendment_id = a7_.id WHERE d0_.id IN ( SELECT d8_.id FROM core.document d8_ INNER JOIN core.document_subject_inform_consent d10_ ON d8_.id = d10_.id_document INNER JOIN core.subject_inform_consent s9_ ON s9_.id = d10_.id_subject_inform_consent INNER JOIN core.subject s11_ ON s9_.subject_id = s11_.id INNER JOIN core.subcohort_inform_consent s12_ ON s9_.subcohort_inform_consent_id = s12_.id WHERE LOWER(s11_.tng_id) LIKE LOWER('%' || 'cls-gibinu' || '%') AND s12_.subcohort_id = '79' AND d8_.document_type IN ('DOCUMENT_EXAMINATION_RESULT_ALEX', 'DOCUMENT_EXAMINATION_RESULT_BLOOD', 'DOCUMENT_EXAMINATION_RESULT_DEXA', 'DOCUMENT_EXAMINATION_RESULT_DUST', 'DOCUMENT_EXAMINATION_RESULT_IDS', 'DOCUMENT_EXAMINATION_RESULT_INBODY', 'DOCUMENT_EXAMINATION_RESULT_MRI', 'DOCUMENT_EXAMINATION_RESULT_SPIRO') AND d8_.deleted = 'f' AND d8_.is_draft = 'f');
Date: 2025-12-01 20:21:40 Duration: 209ms 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(DISTINCT d0_.id) AS sclr_0 FROM core.document d0_ INNER JOIN core.document_subject_inform_consent d2_ ON d0_.id = d2_.id_document INNER JOIN core.subject_inform_consent s1_ ON s1_.id = d2_.id_subject_inform_consent INNER JOIN core.subject s3_ ON s1_.subject_id = s3_.id INNER JOIN core.subcohort_inform_consent s4_ ON s1_.subcohort_inform_consent_id = s4_.id INNER JOIN core.document_type d5_ ON d0_.document_type = d5_.code INNER JOIN core.document_mimetype d6_ ON d0_.document_mimetype_id = d6_.id LEFT JOIN core.amendment a7_ ON d0_.amendment_id = a7_.id WHERE d0_.id IN ( SELECT d8_.id FROM core.document d8_ INNER JOIN core.document_subject_inform_consent d10_ ON d8_.id = d10_.id_document INNER JOIN core.subject_inform_consent s9_ ON s9_.id = d10_.id_subject_inform_consent INNER JOIN core.subject s11_ ON s9_.subject_id = s11_.id INNER JOIN core.subcohort_inform_consent s12_ ON s9_.subcohort_inform_consent_id = s12_.id WHERE LOWER(s11_.tng_id) LIKE LOWER('%' || 'cls-hndywa' || '%') AND s12_.subcohort_id = '80' AND d8_.document_type IN ('DOCUMENT_EXAMINATION_RESULT_ALEX', 'DOCUMENT_EXAMINATION_RESULT_BLOOD', 'DOCUMENT_EXAMINATION_RESULT_DEXA', 'DOCUMENT_EXAMINATION_RESULT_DUST', 'DOCUMENT_EXAMINATION_RESULT_IDS', 'DOCUMENT_EXAMINATION_RESULT_INBODY', 'DOCUMENT_EXAMINATION_RESULT_MRI', 'DOCUMENT_EXAMINATION_RESULT_SPIRO') AND d8_.deleted = 'f' AND d8_.is_draft = 'f');
Date: 2025-12-01 18:22:50 Duration: 206ms 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 6s272ms 2 3s116ms 3s155ms 3s136ms 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 #14
Day Hour Count Duration Avg duration Dec 01 05 1 3s116ms 3s116ms 17 1 3s155ms 3s155ms [ User: tng_migration_user - Total duration: 6s272ms - Times executed: 2 ]
[ Application: dbt - Total duration: 6s272ms - Times executed: 2 ]
-
/* {"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-01 17:02:26 Duration: 3s155ms 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-01 05:02:26 Duration: 3s116ms 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 5s270ms 2 2s610ms 2s660ms 2s635ms 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 #15
Day Hour Count Duration Avg duration Dec 01 05 1 2s660ms 2s660ms 17 1 2s610ms 2s610ms [ User: tng_migration_user - Total duration: 5s270ms - Times executed: 2 ]
[ Application: dbt - Total duration: 5s270ms - Times executed: 2 ]
-
/* {"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-01 05:02:27 Duration: 2s660ms 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-01 17:02:27 Duration: 2s610ms 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 5s73ms 3,581 0ms 352ms 1ms commit;Times Reported Time consuming queries #16
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 5s73ms - Times executed: 3581 ]
[ Application: [unknown] - Total duration: 4s54ms - Times executed: 3487 ]
[ Application: dbt - Total duration: 1s18ms - Times executed: 94 ]
-
COMMIT;
Date: 2025-12-01 17:02:27 Duration: 352ms 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-01 05:02:17 Duration: 53ms 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-01 17:02:18 Duration: 43ms 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 4s251ms 687 0ms 23ms 6ms 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.user_id = ? limit ?;Times Reported Time consuming queries #17
Day Hour Count Duration Avg duration Dec 01 06 1 9ms 9ms 07 19 181ms 9ms 08 10 79ms 7ms 09 162 1s380ms 8ms 10 60 511ms 8ms 11 20 190ms 9ms 12 17 144ms 8ms 13 14 115ms 8ms 14 14 130ms 9ms 15 8 69ms 8ms 16 14 65ms 4ms 18 184 772ms 4ms 19 56 167ms 2ms 20 65 265ms 4ms 21 25 65ms 2ms 22 11 86ms 7ms 23 7 17ms 2ms [ User: tng_migration_user - Total duration: 4s251ms - Times executed: 687 ]
[ Application: [unknown] - Total duration: 4s251ms - Times executed: 687 ]
-
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.user_id = '1967' LIMIT 1;
Date: 2025-12-01 20:31:27 Duration: 23ms 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.user_id = '14777' LIMIT 1;
Date: 2025-12-01 09:44:07 Duration: 16ms 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.user_id = '15930' LIMIT 1;
Date: 2025-12-01 11:00:45 Duration: 16ms 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 3s666ms 2 1s774ms 1s892ms 1s833ms 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 #18
Day Hour Count Duration Avg duration Dec 01 05 1 1s892ms 1s892ms 17 1 1s774ms 1s774ms [ User: tng_migration_user - Total duration: 3s666ms - Times executed: 2 ]
[ Application: dbt - Total duration: 3s666ms - Times executed: 2 ]
-
/* {"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-01 17:02:24 Duration: 1s774ms 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 3s570ms 2 1s573ms 1s997ms 1s785ms 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 #19
Day Hour Count Duration Avg duration Dec 01 05 1 1s573ms 1s573ms 17 1 1s997ms 1s997ms [ User: tng_migration_user - Total duration: 3s570ms - Times executed: 2 ]
[ Application: dbt - Total duration: 3s570ms - Times executed: 2 ]
-
/* {"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-01 17:02:27 Duration: 1s997ms 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-01 05:02:29 Duration: 1s573ms 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 3s355ms 2 1s536ms 1s818ms 1s677ms 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 #20
Day Hour Count Duration Avg duration Dec 01 05 1 1s536ms 1s536ms 17 1 1s818ms 1s818ms [ User: tng_migration_user - Total duration: 3s355ms - Times executed: 2 ]
[ Application: dbt - Total duration: 3s355ms - Times executed: 2 ]
-
/* {"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-01 05:02:23 Duration: 1s536ms 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 64,246 1s185ms 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 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 [ User: tng_migration_user - Total duration: 1s185ms - Times executed: 64246 ]
[ Application: [unknown] - Total duration: 1s185ms - Times executed: 64246 ]
-
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-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
-
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 02:10: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
2 36,712 622ms 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 = ?;Times Reported Time consuming queries #2
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 622ms - Times executed: 36712 ]
[ Application: [unknown] - Total duration: 622ms - Times executed: 36712 ]
-
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
-
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-01 18:45: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 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 03:59: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
3 34,803 1s48ms 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.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 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 [ User: tng_migration_user - Total duration: 1s48ms - Times executed: 34803 ]
[ Application: [unknown] - Total duration: 1s48ms - Times executed: 34803 ]
-
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 = '61';
Date: 2025-12-01 19:45:36 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 = '86';
Date: 2025-12-01 18:24: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 = '66';
Date: 2025-12-01 16:42: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
4 21,996 12s429ms 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 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 [ User: tng_migration_user - Total duration: 12s429ms - Times executed: 21996 ]
[ Application: [unknown] - Total duration: 12s429ms - Times executed: 21996 ]
-
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 ('86') AND m0_.form_id IS NULL AND m0_.result_date <= '2021-12-17 20:00:01' AND m0_.use_alternative <> 't';
Date: 2025-12-01 20:00:03 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 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 ('171') AND m0_.form_id IS NULL AND m0_.result_date <= '2022-11-14 22:00:02' AND m0_.use_alternative <> 't';
Date: 2025-12-01 22:00:04 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
5 17,319 477ms 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 (...);Times Reported Time consuming queries #5
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 477ms - Times executed: 17319 ]
[ Application: [unknown] - Total duration: 477ms - Times executed: 17319 ]
-
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 ('41', '37', '11', '3');
Date: 2025-12-01 18:24:00 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_.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-01 19:49: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_.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-01 20:31:56 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 12,537 257ms 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 = ?;Times Reported Time consuming queries #6
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 257ms - Times executed: 12537 ]
[ Application: [unknown] - Total duration: 257ms - Times executed: 12537 ]
-
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 = '36231';
Date: 2025-12-01 18:23: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 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 = '48096';
Date: 2025-12-01 07: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 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 = '47248';
Date: 2025-12-01 20: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
7 11,985 128ms 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.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 #7
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 128ms - Times executed: 11985 ]
[ Application: [unknown] - Total duration: 128ms - Times executed: 11985 ]
-
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 = '642';
Date: 2025-12-01 09:22:30 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.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 = '601';
Date: 2025-12-01 18:49:28 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.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 = '567';
Date: 2025-12-01 07:14:07 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 11,906 430ms 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 = ? and t0.subcohort_inform_consent_id in (...) limit ?;Times Reported Time consuming queries #8
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 430ms - Times executed: 11906 ]
[ Application: [unknown] - Total duration: 430ms - Times executed: 11906 ]
-
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
-
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 = '50317' AND t0.subcohort_inform_consent_id IN ('627') LIMIT 1;
Date: 2025-12-01 09:30:51 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.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 = '2024' AND t0.subcohort_inform_consent_id IN ('591', '592') LIMIT 1;
Date: 2025-12-01 09:44:08 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
9 11,686 1s263ms 0ms 0ms 0ms set names ?;Times Reported Time consuming queries #9
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 1s263ms - Times executed: 11686 ]
[ Application: [unknown] - Total duration: 1s263ms - Times executed: 11686 ]
-
SET NAMES 'utf8';
Date: 2025-12-01 08:04:55 Duration: 0ms 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-01 10:28:56 Duration: 0ms 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-01 00:34:55 Duration: 0ms 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
10 10,061 337ms 0ms 0ms 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 #10
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 337ms - Times executed: 10061 ]
[ Application: [unknown] - Total duration: 337ms - Times executed: 10061 ]
-
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-01 10:29: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-01 05:26: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-01 00:00: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
11 9,433 136ms 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 #11
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 136ms - Times executed: 9433 ]
[ Application: [unknown] - Total duration: 136ms - Times executed: 9433 ]
-
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-01 15:17:55 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 12:25:56 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
12 9,105 180ms 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 #12
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 180ms - Times executed: 9105 ]
[ Application: [unknown] - Total duration: 180ms - Times executed: 9105 ]
-
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 = '131887';
Date: 2025-12-01 07:14:20 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 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 = '117260';
Date: 2025-12-01 07:05:36 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
13 8,639 1s676ms 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 #13
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 1s676ms - Times executed: 8639 ]
[ Application: [unknown] - Total duration: 1s676ms - Times executed: 8639 ]
-
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-24 02:41:25';
Date: 2025-12-01 02:41:25 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
14 8,639 1s47ms 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 #14
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 1s47ms - Times executed: 8639 ]
[ Application: [unknown] - Total duration: 1s47ms - Times executed: 8639 ]
-
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-12-01 15:55:55 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 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-12-01 17:01: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
15 8,639 151ms 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 #15
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 151ms - Times executed: 8639 ]
[ Application: [unknown] - Total duration: 151ms - Times executed: 8639 ]
-
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-01 07:12:56 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-01 15:05:55 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-01 15:26:55 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
16 7,851 247ms 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 #16
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 247ms - Times executed: 7851 ]
[ Application: [unknown] - Total duration: 247ms - Times executed: 7851 ]
-
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
-
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 = '1027' AND a0_.STRUCTURE_LEFT_TREE > '56' AND a0_.STRUCTURE_RIGHT_TREE < '59' ORDER BY a0_.STRUCTURE_LEFT_TREE ASC;
Date: 2025-12-01 16:06:14 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 = '1027' AND a0_.STRUCTURE_LEFT_TREE > '1' AND a0_.STRUCTURE_RIGHT_TREE < '60' ORDER BY a0_.STRUCTURE_LEFT_TREE ASC;
Date: 2025-12-01 10:29:09 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
17 5,717 85ms 0ms 0ms 0ms select t0.id as id_1, t0.domain as domain_2, t0.locale as locale_3, t0.key as key_4, t0.translation as translation_5 from public.translate t0 where t0.domain = ? and t0.key = ? and t0.locale = ? limit ?;Times Reported Time consuming queries #17
Day Hour Count Duration Avg duration Dec 01 05 7 0ms 0ms 06 7 0ms 0ms 07 196 2ms 0ms 08 185 2ms 0ms 09 1,413 22ms 0ms 10 612 9ms 0ms 11 111 1ms 0ms 12 273 4ms 0ms 13 392 5ms 0ms 14 453 6ms 0ms 15 34 0ms 0ms 16 180 2ms 0ms 18 873 12ms 0ms 19 288 3ms 0ms 20 408 5ms 0ms 21 138 1ms 0ms 22 75 1ms 0ms 23 72 1ms 0ms [ User: tng_migration_user - Total duration: 85ms - Times executed: 5717 ]
[ Application: [unknown] - Total duration: 85ms - Times executed: 5717 ]
-
SELECT t0.id AS id_1, t0.domain AS domain_2, t0.locale AS locale_3, t0.key AS key_4, t0.translation AS translation_5 FROM public.translate t0 WHERE t0.domain = 'edit_entity' AND t0.key = 'subjectExtend.childbirth' AND t0.locale = 'cs_CZ' LIMIT 1;
Date: 2025-12-01 12:37:56 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.domain AS domain_2, t0.locale AS locale_3, t0.key AS key_4, t0.translation AS translation_5 FROM public.translate t0 WHERE t0.domain = 'edit_entity' AND t0.key = 'subjectExtend.childId' AND t0.locale = 'cs_CZ' LIMIT 1;
Date: 2025-12-01 13:53: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 t0.id AS id_1, t0.domain AS domain_2, t0.locale AS locale_3, t0.key AS key_4, t0.translation AS translation_5 FROM public.translate t0 WHERE t0.domain = 'edit_entity' AND t0.key = 'subjectExtend.location' AND t0.locale = 'cs_CZ' LIMIT 1;
Date: 2025-12-01 18:49: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
18 5,686 1s595ms 0ms 1ms 0ms fetch ? from c1;Times Reported Time consuming queries #18
Day Hour Count Duration Avg duration Dec 01 23 5,686 1s595ms 0ms [ User: tng__dwh_celspac_fdw - Total duration: 1s595ms - Times executed: 5686 ]
[ Application: postgres_fdw - Total duration: 1s595ms - Times executed: 5686 ]
-
FETCH 100 FROM c1;
Date: 2025-12-01 23:35:17 Duration: 1ms 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-01 23:35:15 Duration: 1ms 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-01 23:35:15 Duration: 1ms 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
19 5,548 536ms 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 #19
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 536ms - Times executed: 5548 ]
[ Application: [unknown] - Total duration: 536ms - Times executed: 5548 ]
-
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-18 22:00:02' AND '2023-06-17 22:00:02');
Date: 2025-12-01 22: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-09-30 22:00:02' AND '2022-11-14 22:00:02');
Date: 2025-12-01 22: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 = '177' 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-09-30 22:00:02' AND '2022-11-14 22:00:02');
Date: 2025-12-01 22: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
20 5,040 71ms 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 (...) 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 #20
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 71ms - Times executed: 5040 ]
[ Application: [unknown] - Total duration: 71ms - Times executed: 5040 ]
-
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 ('117') 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-17 17:14:02' AND '2025-09-03 17:14:02');
Date: 2025-12-01 17:14: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 ('117') 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-17 15:59:01' AND '2025-09-03 15:59:01');
Date: 2025-12-01 15:59: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 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 ('117') 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-17 08:59:01' AND '2025-09-03 08:59:01');
Date: 2025-12-01 08: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
Normalized slowest queries (N)
Rank Min duration Max duration Avg duration Times executed Total duration Query 1 9m20s 9m35s 9m27s 2 18m55s 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 Dec 01 05 1 9m35s 9m35s 17 1 9m20s 9m20s [ User: tng_migration_user - Total duration: 18m55s - Times executed: 2 ]
[ Application: dbt - Total duration: 18m55s - Times executed: 2 ]
-
/* {"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-01 17:11:44 Duration: 9m20s 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-01 05:02:57 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
2 34s774ms 39s78ms 36s926ms 2 1m13s 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 #2
Day Hour Count Duration Avg duration Dec 01 05 1 39s78ms 39s78ms 17 1 34s774ms 34s774ms [ User: tng_migration_user - Total duration: 1m13s - Times executed: 2 ]
[ Application: dbt - Total duration: 1m13s - Times executed: 2 ]
-
/* {"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-01 17:03:00 Duration: 34s774ms 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 1s931ms 12s17ms 6s974ms 2 13s949ms 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 #3
Day Hour Count Duration Avg duration Dec 01 05 1 12s17ms 12s17ms 17 1 1s931ms 1s931ms [ User: tng_migration_user - Total duration: 13s949ms - Times executed: 2 ]
[ Application: dbt - Total duration: 13s949ms - Times executed: 2 ]
-
/* {"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-01 17:02:27 Duration: 1s931ms 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 5s207ms 5s236ms 5s222ms 2 10s444ms 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 Dec 01 05 1 5s236ms 5s236ms 17 1 5s207ms 5s207ms [ User: tng_migration_user - Total duration: 10s444ms - Times executed: 2 ]
[ Application: dbt - Total duration: 10s444ms - Times executed: 2 ]
-
/* {"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-01 05:02:35 Duration: 5s236ms 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-01 17:02:34 Duration: 5s207ms 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 4s777ms 5s194ms 4s985ms 2 9s971ms 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 Dec 01 05 1 4s777ms 4s777ms 17 1 5s194ms 5s194ms [ User: tng_migration_user - Total duration: 9s971ms - Times executed: 2 ]
[ Application: dbt - Total duration: 9s971ms - Times executed: 2 ]
-
/* {"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
-
/* {"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 05:02:35 Duration: 4s777ms 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 3s116ms 3s155ms 3s136ms 2 6s272ms 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 Dec 01 05 1 3s116ms 3s116ms 17 1 3s155ms 3s155ms [ User: tng_migration_user - Total duration: 6s272ms - Times executed: 2 ]
[ Application: dbt - Total duration: 6s272ms - Times executed: 2 ]
-
/* {"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-01 17:02:26 Duration: 3s155ms 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-01 05:02:26 Duration: 3s116ms 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 2s610ms 2s660ms 2s635ms 2 5s270ms 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 #7
Day Hour Count Duration Avg duration Dec 01 05 1 2s660ms 2s660ms 17 1 2s610ms 2s610ms [ User: tng_migration_user - Total duration: 5s270ms - Times executed: 2 ]
[ Application: dbt - Total duration: 5s270ms - Times executed: 2 ]
-
/* {"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-01 05:02:27 Duration: 2s660ms 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-01 17:02:27 Duration: 2s610ms 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 1s774ms 1s892ms 1s833ms 2 3s666ms 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 #8
Day Hour Count Duration Avg duration Dec 01 05 1 1s892ms 1s892ms 17 1 1s774ms 1s774ms [ User: tng_migration_user - Total duration: 3s666ms - Times executed: 2 ]
[ Application: dbt - Total duration: 3s666ms - Times executed: 2 ]
-
/* {"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-01 17:02:24 Duration: 1s774ms 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 1s997ms 1s785ms 2 3s570ms 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 Dec 01 05 1 1s573ms 1s573ms 17 1 1s997ms 1s997ms [ User: tng_migration_user - Total duration: 3s570ms - Times executed: 2 ]
[ Application: dbt - Total duration: 3s570ms - Times executed: 2 ]
-
/* {"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-01 17:02:27 Duration: 1s997ms 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-01 05:02:29 Duration: 1s573ms 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 1s536ms 1s818ms 1s677ms 2 3s355ms 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 #10
Day Hour Count Duration Avg duration Dec 01 05 1 1s536ms 1s536ms 17 1 1s818ms 1s818ms [ User: tng_migration_user - Total duration: 3s355ms - Times executed: 2 ]
[ Application: dbt - Total duration: 3s355ms - Times executed: 2 ]
-
/* {"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-01 05:02:23 Duration: 1s536ms 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 1s144ms 1s817ms 1s263ms 188 3m57s refresh materialized view core.mv_subject_form with data;Times Reported Time consuming queries #11
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 3m57s - Times executed: 188 ]
[ Application: [unknown] - Total duration: 3m57s - Times executed: 188 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-12-01 05:12:03 Duration: 1s817ms 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-01 16:06:03 Duration: 1s801ms 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-01 15:42:03 Duration: 1s729ms 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
12 113ms 464ms 139ms 126 17s587ms refresh materialized view core.mv_subject_event with data;Times Reported Time consuming queries #12
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 17s587ms - Times executed: 126 ]
[ Application: [unknown] - Total duration: 17s587ms - Times executed: 126 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-12-01 16:32:02 Duration: 464ms 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-12-01 13:23:02 Duration: 432ms 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-12-01 17:41:02 Duration: 206ms 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 10ms 211ms 122ms 56 6s863ms select distinct d0_.id as id_0, d0_.created_at as created_at_1 from core.document d0_ inner join core.document_subject_inform_consent d2_ on d0_.id = d2_.id_document inner join core.subject_inform_consent s1_ on s1_.id = d2_.id_subject_inform_consent inner join core.subject s3_ on s1_.subject_id = s3_.id inner join core.subcohort_inform_consent s4_ on s1_.subcohort_inform_consent_id = s4_.id inner join core.document_type d5_ on d0_.document_type = d5_.code inner join core.document_mimetype d6_ on d0_.document_mimetype_id = d6_.id left join core.amendment a7_ on d0_.amendment_id = a7_.id where d0_.id in ( select d8_.id from core.document d8_ inner join core.document_subject_inform_consent d10_ on d8_.id = d10_.id_document inner join core.subject_inform_consent s9_ on s9_.id = d10_.id_subject_inform_consent inner join core.subject s11_ on s9_.subject_id = s11_.id inner join core.subcohort_inform_consent s12_ on s9_.subcohort_inform_consent_id = s12_.id where lower(s11_.tng_id) like lower(? || ? || ?) and s12_.subcohort_id = ? and d8_.document_type in (...) and d8_.deleted = ? and d8_.is_draft = ?) order by d0_.created_at desc limit ?;Times Reported Time consuming queries #13
Day Hour Count Duration Avg duration Dec 01 10 1 10ms 10ms 13 2 139ms 69ms 18 32 3s515ms 109ms 19 7 893ms 127ms 20 10 1s564ms 156ms 21 3 591ms 197ms 22 1 147ms 147ms [ User: tng_migration_user - Total duration: 6s863ms - Times executed: 56 ]
[ Application: [unknown] - Total duration: 6s863ms - Times executed: 56 ]
-
SELECT DISTINCT d0_.id AS id_0, d0_.created_at AS created_at_1 FROM core.document d0_ INNER JOIN core.document_subject_inform_consent d2_ ON d0_.id = d2_.id_document INNER JOIN core.subject_inform_consent s1_ ON s1_.id = d2_.id_subject_inform_consent INNER JOIN core.subject s3_ ON s1_.subject_id = s3_.id INNER JOIN core.subcohort_inform_consent s4_ ON s1_.subcohort_inform_consent_id = s4_.id INNER JOIN core.document_type d5_ ON d0_.document_type = d5_.code INNER JOIN core.document_mimetype d6_ ON d0_.document_mimetype_id = d6_.id LEFT JOIN core.amendment a7_ ON d0_.amendment_id = a7_.id WHERE d0_.id IN ( SELECT d8_.id FROM core.document d8_ INNER JOIN core.document_subject_inform_consent d10_ ON d8_.id = d10_.id_document INNER JOIN core.subject_inform_consent s9_ ON s9_.id = d10_.id_subject_inform_consent INNER JOIN core.subject s11_ ON s9_.subject_id = s11_.id INNER JOIN core.subcohort_inform_consent s12_ ON s9_.subcohort_inform_consent_id = s12_.id WHERE LOWER(s11_.tng_id) LIKE LOWER('%' || 'cls-wogbzf' || '%') AND s12_.subcohort_id = '79' AND d8_.document_type IN ('DOCUMENT_EXAMINATION_RESULT_ALEX', 'DOCUMENT_EXAMINATION_RESULT_BLOOD', 'DOCUMENT_EXAMINATION_RESULT_DEXA', 'DOCUMENT_EXAMINATION_RESULT_DUST', 'DOCUMENT_EXAMINATION_RESULT_IDS', 'DOCUMENT_EXAMINATION_RESULT_INBODY', 'DOCUMENT_EXAMINATION_RESULT_MRI', 'DOCUMENT_EXAMINATION_RESULT_SPIRO') AND d8_.deleted = 'f' AND d8_.is_draft = 'f') ORDER BY d0_.created_at DESC LIMIT 10;
Date: 2025-12-01 20:32:45 Duration: 211ms 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 DISTINCT d0_.id AS id_0, d0_.created_at AS created_at_1 FROM core.document d0_ INNER JOIN core.document_subject_inform_consent d2_ ON d0_.id = d2_.id_document INNER JOIN core.subject_inform_consent s1_ ON s1_.id = d2_.id_subject_inform_consent INNER JOIN core.subject s3_ ON s1_.subject_id = s3_.id INNER JOIN core.subcohort_inform_consent s4_ ON s1_.subcohort_inform_consent_id = s4_.id INNER JOIN core.document_type d5_ ON d0_.document_type = d5_.code INNER JOIN core.document_mimetype d6_ ON d0_.document_mimetype_id = d6_.id LEFT JOIN core.amendment a7_ ON d0_.amendment_id = a7_.id WHERE d0_.id IN ( SELECT d8_.id FROM core.document d8_ INNER JOIN core.document_subject_inform_consent d10_ ON d8_.id = d10_.id_document INNER JOIN core.subject_inform_consent s9_ ON s9_.id = d10_.id_subject_inform_consent INNER JOIN core.subject s11_ ON s9_.subject_id = s11_.id INNER JOIN core.subcohort_inform_consent s12_ ON s9_.subcohort_inform_consent_id = s12_.id WHERE LOWER(s11_.tng_id) LIKE LOWER('%' || 'cls-gibinu' || '%') AND s12_.subcohort_id = '79' AND d8_.document_type IN ('DOCUMENT_EXAMINATION_RESULT_ALEX', 'DOCUMENT_EXAMINATION_RESULT_BLOOD', 'DOCUMENT_EXAMINATION_RESULT_DEXA', 'DOCUMENT_EXAMINATION_RESULT_DUST', 'DOCUMENT_EXAMINATION_RESULT_IDS', 'DOCUMENT_EXAMINATION_RESULT_INBODY', 'DOCUMENT_EXAMINATION_RESULT_MRI', 'DOCUMENT_EXAMINATION_RESULT_SPIRO') AND d8_.deleted = 'f' AND d8_.is_draft = 'f') ORDER BY d0_.created_at DESC LIMIT 10;
Date: 2025-12-01 20:21:40 Duration: 209ms 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 DISTINCT d0_.id AS id_0, d0_.created_at AS created_at_1 FROM core.document d0_ INNER JOIN core.document_subject_inform_consent d2_ ON d0_.id = d2_.id_document INNER JOIN core.subject_inform_consent s1_ ON s1_.id = d2_.id_subject_inform_consent INNER JOIN core.subject s3_ ON s1_.subject_id = s3_.id INNER JOIN core.subcohort_inform_consent s4_ ON s1_.subcohort_inform_consent_id = s4_.id INNER JOIN core.document_type d5_ ON d0_.document_type = d5_.code INNER JOIN core.document_mimetype d6_ ON d0_.document_mimetype_id = d6_.id LEFT JOIN core.amendment a7_ ON d0_.amendment_id = a7_.id WHERE d0_.id IN ( SELECT d8_.id FROM core.document d8_ INNER JOIN core.document_subject_inform_consent d10_ ON d8_.id = d10_.id_document INNER JOIN core.subject_inform_consent s9_ ON s9_.id = d10_.id_subject_inform_consent INNER JOIN core.subject s11_ ON s9_.subject_id = s11_.id INNER JOIN core.subcohort_inform_consent s12_ ON s9_.subcohort_inform_consent_id = s12_.id WHERE LOWER(s11_.tng_id) LIKE LOWER('%' || 'cls-hndywa' || '%') AND s12_.subcohort_id = '80' AND d8_.document_type IN ('DOCUMENT_EXAMINATION_RESULT_ALEX', 'DOCUMENT_EXAMINATION_RESULT_BLOOD', 'DOCUMENT_EXAMINATION_RESULT_DEXA', 'DOCUMENT_EXAMINATION_RESULT_DUST', 'DOCUMENT_EXAMINATION_RESULT_IDS', 'DOCUMENT_EXAMINATION_RESULT_INBODY', 'DOCUMENT_EXAMINATION_RESULT_MRI', 'DOCUMENT_EXAMINATION_RESULT_SPIRO') AND d8_.deleted = 'f' AND d8_.is_draft = 'f') ORDER BY d0_.created_at DESC LIMIT 10;
Date: 2025-12-01 18:22:50 Duration: 209ms 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 11ms 211ms 122ms 56 6s856ms select count(distinct d0_.id) as sclr_0 from core.document d0_ inner join core.document_subject_inform_consent d2_ on d0_.id = d2_.id_document inner join core.subject_inform_consent s1_ on s1_.id = d2_.id_subject_inform_consent inner join core.subject s3_ on s1_.subject_id = s3_.id inner join core.subcohort_inform_consent s4_ on s1_.subcohort_inform_consent_id = s4_.id inner join core.document_type d5_ on d0_.document_type = d5_.code inner join core.document_mimetype d6_ on d0_.document_mimetype_id = d6_.id left join core.amendment a7_ on d0_.amendment_id = a7_.id where d0_.id in ( select d8_.id from core.document d8_ inner join core.document_subject_inform_consent d10_ on d8_.id = d10_.id_document inner join core.subject_inform_consent s9_ on s9_.id = d10_.id_subject_inform_consent inner join core.subject s11_ on s9_.subject_id = s11_.id inner join core.subcohort_inform_consent s12_ on s9_.subcohort_inform_consent_id = s12_.id where lower(s11_.tng_id) like lower(? || ? || ?) and s12_.subcohort_id = ? and d8_.document_type in (...) and d8_.deleted = ? and d8_.is_draft = ?);Times Reported Time consuming queries #14
Day Hour Count Duration Avg duration Dec 01 10 1 12ms 12ms 13 2 154ms 77ms 18 32 3s513ms 109ms 19 7 905ms 129ms 20 10 1s553ms 155ms 21 3 563ms 187ms 22 1 153ms 153ms [ User: tng_migration_user - Total duration: 6s856ms - Times executed: 56 ]
[ Application: [unknown] - Total duration: 6s856ms - Times executed: 56 ]
-
SELECT count(DISTINCT d0_.id) AS sclr_0 FROM core.document d0_ INNER JOIN core.document_subject_inform_consent d2_ ON d0_.id = d2_.id_document INNER JOIN core.subject_inform_consent s1_ ON s1_.id = d2_.id_subject_inform_consent INNER JOIN core.subject s3_ ON s1_.subject_id = s3_.id INNER JOIN core.subcohort_inform_consent s4_ ON s1_.subcohort_inform_consent_id = s4_.id INNER JOIN core.document_type d5_ ON d0_.document_type = d5_.code INNER JOIN core.document_mimetype d6_ ON d0_.document_mimetype_id = d6_.id LEFT JOIN core.amendment a7_ ON d0_.amendment_id = a7_.id WHERE d0_.id IN ( SELECT d8_.id FROM core.document d8_ INNER JOIN core.document_subject_inform_consent d10_ ON d8_.id = d10_.id_document INNER JOIN core.subject_inform_consent s9_ ON s9_.id = d10_.id_subject_inform_consent INNER JOIN core.subject s11_ ON s9_.subject_id = s11_.id INNER JOIN core.subcohort_inform_consent s12_ ON s9_.subcohort_inform_consent_id = s12_.id WHERE LOWER(s11_.tng_id) LIKE LOWER('%' || 'cls-wogbzf' || '%') AND s12_.subcohort_id = '79' AND d8_.document_type IN ('DOCUMENT_EXAMINATION_RESULT_ALEX', 'DOCUMENT_EXAMINATION_RESULT_BLOOD', 'DOCUMENT_EXAMINATION_RESULT_DEXA', 'DOCUMENT_EXAMINATION_RESULT_DUST', 'DOCUMENT_EXAMINATION_RESULT_IDS', 'DOCUMENT_EXAMINATION_RESULT_INBODY', 'DOCUMENT_EXAMINATION_RESULT_MRI', 'DOCUMENT_EXAMINATION_RESULT_SPIRO') AND d8_.deleted = 'f' AND d8_.is_draft = 'f');
Date: 2025-12-01 20:32:44 Duration: 211ms 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(DISTINCT d0_.id) AS sclr_0 FROM core.document d0_ INNER JOIN core.document_subject_inform_consent d2_ ON d0_.id = d2_.id_document INNER JOIN core.subject_inform_consent s1_ ON s1_.id = d2_.id_subject_inform_consent INNER JOIN core.subject s3_ ON s1_.subject_id = s3_.id INNER JOIN core.subcohort_inform_consent s4_ ON s1_.subcohort_inform_consent_id = s4_.id INNER JOIN core.document_type d5_ ON d0_.document_type = d5_.code INNER JOIN core.document_mimetype d6_ ON d0_.document_mimetype_id = d6_.id LEFT JOIN core.amendment a7_ ON d0_.amendment_id = a7_.id WHERE d0_.id IN ( SELECT d8_.id FROM core.document d8_ INNER JOIN core.document_subject_inform_consent d10_ ON d8_.id = d10_.id_document INNER JOIN core.subject_inform_consent s9_ ON s9_.id = d10_.id_subject_inform_consent INNER JOIN core.subject s11_ ON s9_.subject_id = s11_.id INNER JOIN core.subcohort_inform_consent s12_ ON s9_.subcohort_inform_consent_id = s12_.id WHERE LOWER(s11_.tng_id) LIKE LOWER('%' || 'cls-gibinu' || '%') AND s12_.subcohort_id = '79' AND d8_.document_type IN ('DOCUMENT_EXAMINATION_RESULT_ALEX', 'DOCUMENT_EXAMINATION_RESULT_BLOOD', 'DOCUMENT_EXAMINATION_RESULT_DEXA', 'DOCUMENT_EXAMINATION_RESULT_DUST', 'DOCUMENT_EXAMINATION_RESULT_IDS', 'DOCUMENT_EXAMINATION_RESULT_INBODY', 'DOCUMENT_EXAMINATION_RESULT_MRI', 'DOCUMENT_EXAMINATION_RESULT_SPIRO') AND d8_.deleted = 'f' AND d8_.is_draft = 'f');
Date: 2025-12-01 20:21:40 Duration: 209ms 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(DISTINCT d0_.id) AS sclr_0 FROM core.document d0_ INNER JOIN core.document_subject_inform_consent d2_ ON d0_.id = d2_.id_document INNER JOIN core.subject_inform_consent s1_ ON s1_.id = d2_.id_subject_inform_consent INNER JOIN core.subject s3_ ON s1_.subject_id = s3_.id INNER JOIN core.subcohort_inform_consent s4_ ON s1_.subcohort_inform_consent_id = s4_.id INNER JOIN core.document_type d5_ ON d0_.document_type = d5_.code INNER JOIN core.document_mimetype d6_ ON d0_.document_mimetype_id = d6_.id LEFT JOIN core.amendment a7_ ON d0_.amendment_id = a7_.id WHERE d0_.id IN ( SELECT d8_.id FROM core.document d8_ INNER JOIN core.document_subject_inform_consent d10_ ON d8_.id = d10_.id_document INNER JOIN core.subject_inform_consent s9_ ON s9_.id = d10_.id_subject_inform_consent INNER JOIN core.subject s11_ ON s9_.subject_id = s11_.id INNER JOIN core.subcohort_inform_consent s12_ ON s9_.subcohort_inform_consent_id = s12_.id WHERE LOWER(s11_.tng_id) LIKE LOWER('%' || 'cls-hndywa' || '%') AND s12_.subcohort_id = '80' AND d8_.document_type IN ('DOCUMENT_EXAMINATION_RESULT_ALEX', 'DOCUMENT_EXAMINATION_RESULT_BLOOD', 'DOCUMENT_EXAMINATION_RESULT_DEXA', 'DOCUMENT_EXAMINATION_RESULT_DUST', 'DOCUMENT_EXAMINATION_RESULT_IDS', 'DOCUMENT_EXAMINATION_RESULT_INBODY', 'DOCUMENT_EXAMINATION_RESULT_MRI', 'DOCUMENT_EXAMINATION_RESULT_SPIRO') AND d8_.deleted = 'f' AND d8_.is_draft = 'f');
Date: 2025-12-01 18:22:50 Duration: 206ms 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 33ms 250ms 81ms 160 13s53ms 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 #15
Day Hour Count Duration Avg duration Dec 01 05 80 6s608ms 82ms 17 80 6s445ms 80ms [ User: tng_migration_user - Total duration: 13s53ms - Times executed: 160 ]
[ Application: dbt - Total duration: 13s53ms - Times executed: 160 ]
-
/* {"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-01 17:02:23 Duration: 250ms 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-01 05:02:20 Duration: 219ms 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-01 17:02:24 Duration: 213ms 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 40ms 217ms 77ms 156 12s141ms 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 #16
Day Hour Count Duration Avg duration Dec 01 05 78 5s968ms 76ms 17 78 6s172ms 79ms [ User: tng_migration_user - Total duration: 12s141ms - Times executed: 156 ]
[ Application: dbt - Total duration: 12s141ms - Times executed: 156 ]
-
/* {"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-01 17:02:22 Duration: 190ms 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: 141ms 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 0ms 23ms 6ms 687 4s251ms 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.user_id = ? limit ?;Times Reported Time consuming queries #17
Day Hour Count Duration Avg duration Dec 01 06 1 9ms 9ms 07 19 181ms 9ms 08 10 79ms 7ms 09 162 1s380ms 8ms 10 60 511ms 8ms 11 20 190ms 9ms 12 17 144ms 8ms 13 14 115ms 8ms 14 14 130ms 9ms 15 8 69ms 8ms 16 14 65ms 4ms 18 184 772ms 4ms 19 56 167ms 2ms 20 65 265ms 4ms 21 25 65ms 2ms 22 11 86ms 7ms 23 7 17ms 2ms [ User: tng_migration_user - Total duration: 4s251ms - Times executed: 687 ]
[ Application: [unknown] - Total duration: 4s251ms - Times executed: 687 ]
-
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.user_id = '1967' LIMIT 1;
Date: 2025-12-01 20:31:27 Duration: 23ms 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.user_id = '14777' LIMIT 1;
Date: 2025-12-01 09:44:07 Duration: 16ms 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.user_id = '15930' LIMIT 1;
Date: 2025-12-01 11:00:45 Duration: 16ms 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 0ms 352ms 1ms 3,581 5s73ms commit;Times Reported Time consuming queries #18
Day Hour Count Duration Avg duration 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 [ User: tng_migration_user - Total duration: 5s73ms - Times executed: 3581 ]
[ Application: [unknown] - Total duration: 4s54ms - Times executed: 3487 ]
[ Application: dbt - Total duration: 1s18ms - Times executed: 94 ]
-
COMMIT;
Date: 2025-12-01 17:02:27 Duration: 352ms 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-01 05:02:17 Duration: 53ms 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-01 17:02:18 Duration: 43ms 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 1ms 7ms 1ms 4,914 6s922ms 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 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 [ User: tng_migration_user - Total duration: 6s922ms - Times executed: 4914 ]
[ Application: [unknown] - Total duration: 6s922ms - Times executed: 4914 ]
-
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 = '46235' 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 08:10:52 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 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 = '38140' 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 07:54:34 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 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 = '50149' 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 11:11:54 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
20 0ms 4ms 0ms 21,996 12s429ms 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 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 [ User: tng_migration_user - Total duration: 12s429ms - Times executed: 21996 ]
[ Application: [unknown] - Total duration: 12s429ms - Times executed: 21996 ]
-
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 ('86') AND m0_.form_id IS NULL AND m0_.result_date <= '2021-12-17 20:00:01' AND m0_.use_alternative <> 't';
Date: 2025-12-01 20:00:03 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 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 ('171') AND m0_.form_id IS NULL AND m0_.result_date <= '2022-11-14 22:00:02' AND m0_.use_alternative <> 't';
Date: 2025-12-01 22:00:04 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
Time consuming prepare
Rank Total duration Times executed Min duration Max duration Avg duration Query 1 13s475ms 15,799 0ms 10ms 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 01 04 342 299ms 0ms 05 360 301ms 0ms 06 360 301ms 0ms 07 360 307ms 0ms 08 360 308ms 0ms 09 360 299ms 0ms 10 360 306ms 0ms 11 360 307ms 0ms 12 360 308ms 0ms 13 360 298ms 0ms 14 360 302ms 0ms 15 360 313ms 0ms 16 360 304ms 0ms 17 360 292ms 0ms 18 360 300ms 0ms 19 360 299ms 0ms 20 360 305ms 0ms 21 360 301ms 0ms 22 360 302ms 0ms 23 338 279ms 0ms Dec 01 00 360 317ms 0ms 01 360 315ms 0ms 02 360 316ms 0ms 03 360 311ms 0ms 04 360 300ms 0ms 05 360 320ms 0ms 06 360 308ms 0ms 07 360 309ms 0ms 08 360 304ms 0ms 09 360 304ms 0ms 10 360 308ms 0ms 11 359 316ms 0ms 12 360 315ms 0ms 13 360 311ms 0ms 14 360 302ms 0ms 15 360 313ms 0ms 16 360 318ms 0ms 17 360 306ms 0ms 18 360 298ms 0ms 19 360 308ms 0ms 20 360 305ms 0ms 21 360 309ms 0ms 22 360 306ms 0ms 23 360 302ms 0ms [ User: tng_migration_user - Total duration: 1s936ms - Times executed: 15799 ]
[ Application: [unknown] - Total duration: 1s936ms - Times executed: 15799 ]
-
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: 10ms 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-01 00:32:57 Duration: 9ms 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-01 02:41:25 Duration: 3ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
2 7s941ms 17,353 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 prepare #2
Day Hour Count Duration Avg duration 03 342 169ms 0ms 04 360 169ms 0ms 05 614 187ms 0ms 06 390 181ms 0ms 07 390 181ms 0ms 08 390 176ms 0ms 09 390 182ms 0ms 10 390 181ms 0ms 11 390 180ms 0ms 12 390 176ms 0ms 13 390 178ms 0ms 14 390 183ms 0ms 15 390 180ms 0ms 16 386 173ms 0ms 17 390 179ms 0ms 18 390 175ms 0ms 19 390 183ms 0ms 20 390 182ms 0ms 21 390 178ms 0ms 22 368 166ms 0ms 23 360 175ms 0ms 00 360 177ms 0ms 01 360 175ms 0ms 02 360 170ms 0ms 03 360 167ms 0ms 04 360 183ms 0ms 05 552 189ms 0ms 06 390 181ms 0ms 07 390 176ms 0ms 08 390 178ms 0ms 09 390 183ms 0ms 10 389 184ms 0ms 11 390 181ms 0ms 12 390 183ms 0ms 13 390 177ms 0ms 14 390 183ms 0ms 15 390 187ms 0ms 16 386 183ms 0ms 17 486 187ms 0ms 18 390 185ms 0ms 19 390 187ms 0ms 20 390 192ms 0ms 21 390 189ms 0ms 22 390 187ms 0ms [ User: tng_migration_user - Total duration: 230ms - Times executed: 17353 ]
[ Application: [unknown] - Total duration: 230ms - Times executed: 17353 ]
-
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]
-
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 00:32:57 Duration: 3ms 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-11-30 04:04:16 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
3 6s58ms 118,132 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_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,394 126ms 0ms 04 2,527 131ms 0ms 05 2,737 139ms 0ms 06 2,730 142ms 0ms 07 2,730 140ms 0ms 08 2,730 138ms 0ms 09 2,730 141ms 0ms 10 2,730 140ms 0ms 11 2,730 140ms 0ms 12 2,730 139ms 0ms 13 2,730 141ms 0ms 14 2,730 140ms 0ms 15 2,730 140ms 0ms 16 2,702 136ms 0ms 17 2,730 138ms 0ms 18 2,730 137ms 0ms 19 2,730 141ms 0ms 20 2,730 139ms 0ms 21 2,730 139ms 0ms 22 2,576 130ms 0ms 23 2,520 130ms 0ms 00 2,520 131ms 0ms 01 2,520 131ms 0ms 02 2,520 129ms 0ms 03 2,520 128ms 0ms 04 2,527 128ms 0ms 05 2,737 140ms 0ms 06 2,730 139ms 0ms 07 2,730 137ms 0ms 08 2,730 138ms 0ms 09 2,730 140ms 0ms 10 2,723 140ms 0ms 11 2,730 140ms 0ms 12 2,730 140ms 0ms 13 2,730 137ms 0ms 14 2,730 140ms 0ms 15 2,730 142ms 0ms 16 2,702 138ms 0ms 17 2,737 137ms 0ms 18 2,730 138ms 0ms 19 2,730 140ms 0ms 20 2,730 141ms 0ms 21 2,730 140ms 0ms 22 2,730 139ms 0ms [ User: tng_migration_user - Total duration: 2s189ms - Times executed: 118132 ]
[ Application: [unknown] - Total duration: 2s189ms - Times executed: 118132 ]
-
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-11-30 05:56: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.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-11-30 14:17:16 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_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-11-30 07:27:15 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
4 3s519ms 15,799 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 342 77ms 0ms 04 360 79ms 0ms 05 360 76ms 0ms 06 360 80ms 0ms 07 360 80ms 0ms 08 360 77ms 0ms 09 360 78ms 0ms 10 360 80ms 0ms 11 360 78ms 0ms 12 360 76ms 0ms 13 360 76ms 0ms 14 360 80ms 0ms 15 360 79ms 0ms 16 360 74ms 0ms 17 360 78ms 0ms 18 360 77ms 0ms 19 360 79ms 0ms 20 360 76ms 0ms 21 360 77ms 0ms 22 338 71ms 0ms 23 360 80ms 0ms 00 360 81ms 0ms 01 360 80ms 0ms 02 360 80ms 0ms 03 360 78ms 0ms 04 360 103ms 0ms 05 360 79ms 0ms 06 360 80ms 0ms 07 360 78ms 0ms 08 360 79ms 0ms 09 360 80ms 0ms 10 359 81ms 0ms 11 360 80ms 0ms 12 360 81ms 0ms 13 360 79ms 0ms 14 360 81ms 0ms 15 360 83ms 0ms 16 360 81ms 0ms 17 360 79ms 0ms 18 360 80ms 0ms 19 360 80ms 0ms 20 360 81ms 0ms 21 360 83ms 0ms 22 360 80ms 0ms [ User: tng_migration_user - Total duration: 2s928ms - Times executed: 15799 ]
[ Application: [unknown] - Total duration: 2s928ms - Times executed: 15799 ]
-
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-01 00:32:57 Duration: 1ms 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-11-30 08:37:16 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
5 3s339ms 64,764 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.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,540 75ms 0ms 05 1,541 77ms 0ms 06 1,626 83ms 0ms 07 1,542 76ms 0ms 08 1,541 80ms 0ms 09 1,556 79ms 0ms 10 1,598 82ms 0ms 11 1,542 78ms 0ms 12 1,615 82ms 0ms 13 1,547 77ms 0ms 14 1,729 94ms 0ms 15 1,540 76ms 0ms 16 1,386 70ms 0ms 17 1,577 77ms 0ms 18 1,541 74ms 0ms 19 1,540 79ms 0ms 20 1,594 81ms 0ms 21 1,866 93ms 0ms 22 1,540 79ms 0ms 04 1,386 72ms 0ms 05 1,540 78ms 0ms 06 1,627 87ms 0ms 07 1,626 84ms 0ms 08 2,234 129ms 0ms 09 1,952 104ms 0ms 10 1,585 79ms 0ms 11 1,621 85ms 0ms 12 1,555 78ms 0ms 13 1,570 80ms 0ms 14 1,606 78ms 0ms 15 1,835 99ms 0ms 16 1,386 78ms 0ms 17 3,370 174ms 0ms 18 2,151 109ms 0ms 19 2,362 120ms 0ms 20 1,932 100ms 0ms 21 1,721 85ms 0ms 22 1,744 89ms 0ms [ User: tng_migration_user - Total duration: 1s932ms - Times executed: 64764 ]
[ Application: [unknown] - Total duration: 1s932ms - Times executed: 64764 ]
-
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-11-30 21:06:01 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.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-01 05:24:01 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.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-11-30 17:24:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
6 3s279ms 18,401 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 = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;Times Reported Time consuming prepare #6
Day Hour Count Duration Avg duration 03 398 72ms 0ms 04 413 65ms 0ms 05 420 70ms 0ms 06 420 73ms 0ms 07 420 73ms 0ms 08 420 71ms 0ms 09 420 74ms 0ms 10 420 73ms 0ms 11 420 76ms 0ms 12 420 74ms 0ms 13 420 70ms 0ms 14 420 72ms 0ms 15 420 74ms 0ms 16 411 66ms 0ms 17 420 72ms 0ms 18 420 73ms 0ms 19 420 78ms 0ms 20 420 76ms 0ms 21 420 72ms 0ms 22 398 75ms 0ms 23 420 77ms 0ms 00 420 79ms 0ms 01 420 75ms 0ms 02 420 76ms 0ms 03 420 76ms 0ms 04 411 69ms 0ms 05 420 75ms 0ms 06 420 76ms 0ms 07 420 73ms 0ms 08 420 77ms 0ms 09 420 80ms 0ms 10 419 77ms 0ms 11 420 75ms 0ms 12 420 75ms 0ms 13 420 76ms 0ms 14 420 78ms 0ms 15 420 78ms 0ms 16 411 66ms 0ms 17 420 75ms 0ms 18 420 75ms 0ms 19 420 77ms 0ms 20 420 76ms 0ms 21 420 76ms 0ms 22 420 73ms 0ms [ User: tng_migration_user - Total duration: 644ms - Times executed: 18401 ]
[ Application: [unknown] - Total duration: 644ms - Times executed: 18401 ]
-
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]
-
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 17:32:01 Duration: 1ms 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-01 04:09:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
7 2s967ms 15,799 0ms 6ms 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 342 68ms 0ms 04 360 66ms 0ms 05 360 65ms 0ms 06 360 67ms 0ms 07 360 67ms 0ms 08 360 65ms 0ms 09 360 66ms 0ms 10 360 66ms 0ms 11 360 66ms 0ms 12 360 64ms 0ms 13 360 66ms 0ms 14 360 67ms 0ms 15 360 66ms 0ms 16 360 63ms 0ms 17 360 66ms 0ms 18 360 65ms 0ms 19 360 67ms 0ms 20 360 66ms 0ms 21 360 66ms 0ms 22 338 60ms 0ms 23 360 68ms 0ms 00 360 68ms 0ms 01 360 67ms 0ms 02 360 68ms 0ms 03 360 67ms 0ms 04 360 75ms 0ms 05 360 68ms 0ms 06 360 68ms 0ms 07 360 67ms 0ms 08 360 67ms 0ms 09 360 68ms 0ms 10 359 70ms 0ms 11 360 69ms 0ms 12 360 68ms 0ms 13 360 66ms 0ms 14 360 69ms 0ms 15 360 71ms 0ms 16 360 67ms 0ms 17 360 65ms 0ms 18 360 67ms 0ms 19 360 66ms 0ms 20 360 69ms 0ms 21 360 67ms 0ms 22 360 67ms 0ms [ User: tng_migration_user - Total duration: 278ms - Times executed: 15799 ]
[ Application: [unknown] - Total duration: 278ms - Times executed: 15799 ]
-
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-01 21:36:55 Duration: 1ms 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-11-30 04:31:14 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
8 2s577ms 67,504 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,368 53ms 0ms 04 1,444 55ms 0ms 05 1,564 59ms 0ms 06 1,560 60ms 0ms 07 1,560 60ms 0ms 08 1,560 59ms 0ms 09 1,560 60ms 0ms 10 1,560 59ms 0ms 11 1,560 59ms 0ms 12 1,560 59ms 0ms 13 1,560 59ms 0ms 14 1,560 59ms 0ms 15 1,560 59ms 0ms 16 1,544 57ms 0ms 17 1,560 58ms 0ms 18 1,560 58ms 0ms 19 1,560 59ms 0ms 20 1,560 59ms 0ms 21 1,560 59ms 0ms 22 1,472 55ms 0ms 23 1,440 54ms 0ms 00 1,440 55ms 0ms 01 1,440 55ms 0ms 02 1,440 54ms 0ms 03 1,440 54ms 0ms 04 1,444 55ms 0ms 05 1,564 59ms 0ms 06 1,560 59ms 0ms 07 1,560 58ms 0ms 08 1,560 59ms 0ms 09 1,560 58ms 0ms 10 1,556 59ms 0ms 11 1,560 59ms 0ms 12 1,560 59ms 0ms 13 1,560 58ms 0ms 14 1,560 60ms 0ms 15 1,560 60ms 0ms 16 1,544 59ms 0ms 17 1,564 59ms 0ms 18 1,560 59ms 0ms 19 1,560 59ms 0ms 20 1,560 60ms 0ms 21 1,560 59ms 0ms 22 1,560 59ms 0ms [ User: tng_migration_user - Total duration: 1s143ms - Times executed: 67504 ]
[ Application: [unknown] - Total duration: 1s143ms - Times executed: 67504 ]
-
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 08:18:14 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-01 17:04: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-12-01 05:56:57 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
9 2s169ms 44,109 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,170 57ms 0ms 05 1,170 56ms 0ms 06 1,170 58ms 0ms 07 1,170 57ms 0ms 08 1,170 57ms 0ms 09 1,170 57ms 0ms 10 1,170 59ms 0ms 11 1,170 59ms 0ms 12 1,170 57ms 0ms 13 1,170 55ms 0ms 14 1,170 56ms 0ms 15 1,170 57ms 0ms 16 1,053 52ms 0ms 17 1,170 57ms 0ms 18 1,170 55ms 0ms 19 1,170 56ms 0ms 20 1,170 56ms 0ms 21 1,170 57ms 0ms 22 1,170 57ms 0ms 04 1,053 50ms 0ms 05 1,170 57ms 0ms 06 1,170 59ms 0ms 07 1,170 59ms 0ms 08 1,170 56ms 0ms 09 1,170 57ms 0ms 10 1,170 58ms 0ms 11 1,170 56ms 0ms 12 1,170 56ms 0ms 13 1,170 58ms 0ms 14 1,170 57ms 0ms 15 1,170 57ms 0ms 16 1,053 52ms 0ms 17 1,170 56ms 0ms 18 1,170 58ms 0ms 19 1,170 58ms 0ms 20 1,170 57ms 0ms 21 1,170 57ms 0ms 22 1,170 58ms 0ms [ User: tng_migration_user - Total duration: 24s684ms - Times executed: 44109 ]
[ Application: [unknown] - Total duration: 24s684ms - Times executed: 44109 ]
-
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-11-30 11:54: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-01 11:48: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-11-30 09:54:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
10 1s775ms 22,309 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 419 29ms 0ms 05 555 44ms 0ms 06 523 41ms 0ms 07 519 40ms 0ms 08 516 38ms 0ms 09 517 38ms 0ms 10 521 40ms 0ms 11 518 39ms 0ms 12 524 42ms 0ms 13 522 40ms 0ms 14 531 43ms 0ms 15 511 39ms 0ms 16 511 36ms 0ms 17 513 38ms 0ms 18 512 36ms 0ms 19 511 39ms 0ms 20 513 36ms 0ms 21 525 40ms 0ms 22 511 38ms 0ms 04 381 29ms 0ms 05 508 38ms 0ms 06 509 45ms 0ms 07 739 57ms 0ms 08 2,098 182ms 0ms 09 1,193 101ms 0ms 10 592 48ms 0ms 11 606 51ms 0ms 12 468 36ms 0ms 13 767 62ms 0ms 14 474 37ms 0ms 15 644 54ms 0ms 16 463 34ms 0ms 17 594 47ms 0ms 18 478 35ms 0ms 19 488 41ms 0ms 20 478 38ms 0ms 21 469 36ms 0ms 22 588 48ms 0ms [ User: tng_migration_user - Total duration: 444ms - Times executed: 22309 ]
[ Application: [unknown] - Total duration: 444ms - Times executed: 22309 ]
-
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: 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-30 14:41:05 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-30 13:22:16 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
11 1s227ms 1,643 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 1 0ms 0ms 06 9 8ms 0ms 07 2 0ms 0ms 09 3 2ms 0ms 10 6 4ms 0ms 11 1 0ms 0ms 12 9 6ms 0ms 13 3 0ms 0ms 14 24 19ms 0ms 17 9 5ms 0ms 20 3 2ms 0ms 21 14 9ms 0ms 05 2 1ms 0ms 06 75 54ms 0ms 07 47 36ms 0ms 08 405 297ms 0ms 09 197 140ms 0ms 10 76 59ms 0ms 11 99 66ms 0ms 12 70 55ms 0ms 13 104 74ms 0ms 14 16 12ms 0ms 15 40 33ms 0ms 17 196 151ms 0ms 18 61 46ms 0ms 19 80 64ms 0ms 20 36 29ms 0ms 21 11 7ms 0ms 22 44 35ms 0ms [ User: tng_migration_user - Total duration: 95ms - Times executed: 1643 ]
[ Application: [unknown] - Total duration: 95ms - Times executed: 1643 ]
-
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 11:00:45 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-01 21:23:46 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-01 09:30:38 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
12 1s71ms 13,255 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 3 0ms 0ms 06 285 22ms 0ms 09 23 1ms 0ms 10 190 14ms 0ms 12 236 18ms 0ms 14 488 40ms 0ms 17 95 6ms 0ms 20 190 15ms 0ms 21 820 62ms 0ms 05 20 2ms 0ms 06 180 18ms 0ms 07 65 6ms 0ms 08 594 64ms 0ms 09 301 30ms 0ms 10 43 4ms 0ms 11 129 13ms 0ms 12 27 3ms 0ms 13 47 5ms 0ms 14 140 10ms 0ms 15 809 62ms 0ms 17 3,228 252ms 0ms 18 1,274 97ms 0ms 19 1,812 144ms 0ms 20 798 62ms 0ms 21 423 31ms 0ms 22 1,035 79ms 0ms [ User: tng_migration_user - Total duration: 464ms - Times executed: 13255 ]
[ Application: [unknown] - Total duration: 464ms - Times executed: 13255 ]
-
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]
-
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 07:14:17 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
13 883ms 19,152 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 #13
Day Hour Count Duration Avg duration 04 109 6ms 0ms 06 366 16ms 0ms 09 38 1ms 0ms 10 244 10ms 0ms 12 304 13ms 0ms 14 800 37ms 0ms 17 136 5ms 0ms 20 244 11ms 0ms 21 1,200 52ms 0ms 04 71 4ms 0ms 06 207 12ms 0ms 07 193 8ms 0ms 08 714 38ms 0ms 09 547 27ms 0ms 10 481 24ms 0ms 11 250 13ms 0ms 12 34 1ms 0ms 13 155 8ms 0ms 14 343 14ms 0ms 15 1,114 48ms 0ms 17 4,310 194ms 0ms 18 1,682 74ms 0ms 19 2,411 110ms 0ms 20 1,179 53ms 0ms 21 561 25ms 0ms 22 1,459 64ms 0ms [ User: tng_migration_user - Total duration: 375ms - Times executed: 19152 ]
[ Application: [unknown] - Total duration: 375ms - Times executed: 19152 ]
-
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-01 10:34:48 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-01 11:57:04 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-01 11:23:59 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
14 735ms 6,480 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.subject_inform_consent_state t0 WHERE t0.code = $1 LIMIT 1;Times Reported Time consuming prepare #14
Day Hour Count Duration Avg duration 04 40 5ms 0ms 05 68 10ms 0ms 06 104 13ms 0ms 07 68 9ms 0ms 08 72 12ms 0ms 09 76 10ms 0ms 10 92 13ms 0ms 11 72 10ms 0ms 12 96 12ms 0ms 13 84 11ms 0ms 14 144 18ms 0ms 15 68 10ms 0ms 16 60 8ms 0ms 17 92 11ms 0ms 18 72 10ms 0ms 19 68 11ms 0ms 20 84 11ms 0ms 21 112 14ms 0ms 22 68 10ms 0ms 04 36 5ms 0ms 05 68 10ms 0ms 06 252 26ms 0ms 07 176 20ms 0ms 08 900 86ms 0ms 09 564 53ms 0ms 10 232 25ms 0ms 11 332 34ms 0ms 12 152 18ms 0ms 13 260 28ms 0ms 14 116 15ms 0ms 15 196 23ms 0ms 16 60 10ms 0ms 17 560 50ms 0ms 18 240 23ms 0ms 19 320 29ms 0ms 20 164 18ms 0ms 21 124 15ms 0ms 22 188 20ms 0ms [ User: tng_migration_user - Total duration: 60ms - Times executed: 6480 ]
[ Application: [unknown] - Total duration: 60ms - Times executed: 6480 ]
-
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-30 19:50:01 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.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-01 17:12:01 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.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-30 20:14:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
15 706ms 18,661 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 #15
Day Hour Count Duration Avg duration 04 567 20ms 0ms 05 502 18ms 0ms 06 503 18ms 0ms 07 503 20ms 0ms 08 501 18ms 0ms 09 502 17ms 0ms 10 503 18ms 0ms 11 501 19ms 0ms 12 503 21ms 0ms 13 502 19ms 0ms 14 505 20ms 0ms 15 495 17ms 0ms 16 495 17ms 0ms 17 496 18ms 0ms 18 495 16ms 0ms 19 495 17ms 0ms 20 495 17ms 0ms 21 498 18ms 0ms 22 495 17ms 0ms 04 531 20ms 0ms 05 473 16ms 0ms 06 489 19ms 0ms 07 480 18ms 0ms 08 508 22ms 0ms 09 480 18ms 0ms 10 472 17ms 0ms 11 473 18ms 0ms 12 471 17ms 0ms 13 471 18ms 0ms 14 471 18ms 0ms 15 482 18ms 0ms 16 471 16ms 0ms 17 472 18ms 0ms 18 472 16ms 0ms 19 473 20ms 0ms 20 474 18ms 0ms 21 469 18ms 0ms 22 473 18ms 0ms [ User: tng_migration_user - Total duration: 293ms - Times executed: 18661 ]
[ Application: [unknown] - Total duration: 293ms - Times executed: 18661 ]
-
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-30 14:08:42 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-30 13:22:16 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
16 560ms 6,552 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) 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 16ms 0ms 07 182 15ms 0ms 08 182 15ms 0ms 09 182 15ms 0ms 10 182 14ms 0ms 11 182 15ms 0ms 12 182 15ms 0ms 13 182 15ms 0ms 14 182 15ms 0ms 15 182 16ms 0ms 16 182 14ms 0ms 17 182 15ms 0ms 18 182 14ms 0ms 19 182 16ms 0ms 20 182 14ms 0ms 21 182 14ms 0ms 22 182 16ms 0ms 05 182 15ms 0ms 06 182 16ms 0ms 07 182 16ms 0ms 08 182 17ms 0ms 09 182 15ms 0ms 10 182 15ms 0ms 11 182 15ms 0ms 12 182 16ms 0ms 13 182 15ms 0ms 14 182 16ms 0ms 15 182 15ms 0ms 16 182 15ms 0ms 17 182 14ms 0ms 18 182 14ms 0ms 19 182 16ms 0ms 20 182 15ms 0ms 21 182 15ms 0ms 22 182 15ms 0ms [ User: tng_migration_user - Total duration: 1s826ms - Times executed: 6552 ]
[ Application: [unknown] - Total duration: 1s826ms - Times executed: 6552 ]
-
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-12-01 13:14: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-12-01 09:05:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
17 550ms 8,568 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 16ms 0ms 07 238 14ms 0ms 08 238 15ms 0ms 09 238 15ms 0ms 10 238 15ms 0ms 11 238 15ms 0ms 12 238 15ms 0ms 13 238 15ms 0ms 14 238 15ms 0ms 15 238 16ms 0ms 16 238 14ms 0ms 17 238 15ms 0ms 18 238 14ms 0ms 19 238 16ms 0ms 20 238 14ms 0ms 21 238 14ms 0ms 22 238 15ms 0ms 05 238 15ms 0ms 06 238 15ms 0ms 07 238 15ms 0ms 08 238 16ms 0ms 09 238 15ms 0ms 10 238 14ms 0ms 11 238 15ms 0ms 12 238 15ms 0ms 13 238 15ms 0ms 14 238 16ms 0ms 15 238 15ms 0ms 16 238 15ms 0ms 17 238 14ms 0ms 18 238 14ms 0ms 19 238 15ms 0ms 20 238 15ms 0ms 21 238 14ms 0ms 22 238 14ms 0ms [ User: tng_migration_user - Total duration: 137ms - Times executed: 8568 ]
[ Application: [unknown] - Total duration: 137ms - Times executed: 8568 ]
-
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]
-
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-30 13:59:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
18 506ms 1,603 0ms 0ms 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 #18
Day Hour Count Duration Avg duration 06 10 3ms 0ms 09 4 1ms 0ms 10 7 2ms 0ms 12 9 3ms 0ms 14 26 8ms 0ms 17 12 3ms 0ms 20 4 1ms 0ms 21 15 4ms 0ms 05 3 0ms 0ms 06 62 20ms 0ms 07 49 15ms 0ms 08 369 118ms 0ms 09 176 56ms 0ms 10 76 25ms 0ms 11 85 26ms 0ms 12 71 21ms 0ms 13 93 29ms 0ms 14 18 5ms 0ms 15 45 14ms 0ms 17 216 65ms 0ms 18 69 21ms 0ms 19 86 27ms 0ms 20 40 12ms 0ms 21 13 3ms 0ms 22 45 14ms 0ms [ User: tng_migration_user - Total duration: 192ms - Times executed: 1603 ]
[ Application: [unknown] - Total duration: 192ms - Times executed: 1603 ]
-
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-01 09:29:10 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-01 10:54:22 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-01 12:47:44 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
19 503ms 5,014 0ms 1ms 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 100 8ms 0ms 05 100 8ms 0ms 06 298 36ms 0ms 07 412 38ms 0ms 08 634 64ms 0ms 09 733 77ms 0ms 10 1,247 121ms 0ms 11 857 86ms 0ms 12 103 10ms 0ms 13 124 13ms 0ms 14 101 9ms 0ms 22 305 28ms 0ms [ User: tng_migration_user - Total duration: 7s51ms - Times executed: 5014 ]
[ Application: [unknown] - Total duration: 7s51ms - Times executed: 5014 ]
-
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]
-
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:48:38 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:58:11 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
20 431ms 6,552 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, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);Times Reported Time consuming prepare #20
Day Hour Count Duration Avg duration 05 182 12ms 0ms 06 182 12ms 0ms 07 182 11ms 0ms 08 182 11ms 0ms 09 182 11ms 0ms 10 182 11ms 0ms 11 182 11ms 0ms 12 182 11ms 0ms 13 182 11ms 0ms 14 182 11ms 0ms 15 182 12ms 0ms 16 182 11ms 0ms 17 182 11ms 0ms 18 182 11ms 0ms 19 182 12ms 0ms 20 182 11ms 0ms 21 182 12ms 0ms 22 182 12ms 0ms 05 182 12ms 0ms 06 182 12ms 0ms 07 182 12ms 0ms 08 182 12ms 0ms 09 182 12ms 0ms 10 182 11ms 0ms 11 182 11ms 0ms 12 182 12ms 0ms 13 182 11ms 0ms 14 182 12ms 0ms 15 182 12ms 0ms 16 182 11ms 0ms 17 182 11ms 0ms 18 182 11ms 0ms 19 182 11ms 0ms 20 182 11ms 0ms 21 182 11ms 0ms 22 182 11ms 0ms [ User: tng_migration_user - Total duration: 216ms - Times executed: 6552 ]
[ Application: [unknown] - Total duration: 216ms - Times executed: 6552 ]
-
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]
-
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 06:14: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, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);
Date: 2025-11-30 22:41:01 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 14s470ms 118,132 0ms 8ms 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 01 04 2,394 303ms 0ms 05 2,527 309ms 0ms 06 2,737 330ms 0ms 07 2,730 336ms 0ms 08 2,730 335ms 0ms 09 2,730 328ms 0ms 10 2,730 336ms 0ms 11 2,730 333ms 0ms 12 2,730 333ms 0ms 13 2,730 330ms 0ms 14 2,730 334ms 0ms 15 2,730 334ms 0ms 16 2,730 333ms 0ms 17 2,702 321ms 0ms 18 2,730 332ms 0ms 19 2,730 329ms 0ms 20 2,730 337ms 0ms 21 2,730 333ms 0ms 22 2,730 333ms 0ms 23 2,576 311ms 0ms Dec 01 00 2,520 313ms 0ms 01 2,520 316ms 0ms 02 2,520 313ms 0ms 03 2,520 309ms 0ms 04 2,520 306ms 0ms 05 2,527 317ms 0ms 06 2,737 335ms 0ms 07 2,730 334ms 0ms 08 2,730 327ms 0ms 09 2,730 330ms 0ms 10 2,730 333ms 0ms 11 2,723 334ms 0ms 12 2,730 333ms 0ms 13 2,730 337ms 0ms 14 2,730 327ms 0ms 15 2,730 336ms 0ms 16 2,730 342ms 0ms 17 2,702 330ms 0ms 18 2,737 329ms 0ms 19 2,730 331ms 0ms 20 2,730 334ms 0ms 21 2,730 338ms 0ms 22 2,730 339ms 0ms 23 2,730 336ms 0ms [ User: tng_migration_user - Total duration: 2s189ms - Times executed: 118132 ]
[ Application: [unknown] - Total duration: 2s189ms - Times executed: 118132 ]
-
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'
-
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-11-30 10:51:15 Duration: 1ms 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-01 10:50:25 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR'
2 10s143ms 15,799 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 342 223ms 0ms 04 360 225ms 0ms 05 360 222ms 0ms 06 360 229ms 0ms 07 360 230ms 0ms 08 360 222ms 0ms 09 360 229ms 0ms 10 360 227ms 0ms 11 360 228ms 0ms 12 360 222ms 0ms 13 360 225ms 0ms 14 360 230ms 0ms 15 360 227ms 0ms 16 360 220ms 0ms 17 360 227ms 0ms 18 360 224ms 0ms 19 360 229ms 0ms 20 360 225ms 0ms 21 360 225ms 0ms 22 338 208ms 0ms 23 360 236ms 0ms 00 360 234ms 0ms 01 360 235ms 0ms 02 360 230ms 0ms 03 360 275ms 0ms 04 360 246ms 0ms 05 360 230ms 0ms 06 360 230ms 0ms 07 360 227ms 0ms 08 360 225ms 0ms 09 360 230ms 0ms 10 359 236ms 0ms 11 360 235ms 0ms 12 360 231ms 0ms 13 360 225ms 0ms 14 360 233ms 0ms 15 360 237ms 0ms 16 360 232ms 0ms 17 360 228ms 0ms 18 360 234ms 0ms 19 360 233ms 0ms 20 360 237ms 0ms 21 360 235ms 0ms 22 360 230ms 0ms [ User: tng_migration_user - Total duration: 1s936ms - Times executed: 15799 ]
[ Application: [unknown] - Total duration: 1s936ms - Times executed: 15799 ]
-
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-01 05:02:25 Duration: 15ms 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-01 00:32:57 Duration: 6ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
3 9s57ms 64,764 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.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,540 204ms 0ms 05 1,541 209ms 0ms 06 1,626 227ms 0ms 07 1,542 208ms 0ms 08 1,541 218ms 0ms 09 1,556 216ms 0ms 10 1,598 223ms 0ms 11 1,542 212ms 0ms 12 1,615 227ms 0ms 13 1,547 210ms 0ms 14 1,729 256ms 0ms 15 1,540 206ms 0ms 16 1,386 189ms 0ms 17 1,577 207ms 0ms 18 1,541 204ms 0ms 19 1,540 214ms 0ms 20 1,594 219ms 0ms 21 1,866 253ms 0ms 22 1,540 217ms 0ms 04 1,386 194ms 0ms 05 1,540 209ms 0ms 06 1,627 233ms 0ms 07 1,626 229ms 0ms 08 2,234 353ms 0ms 09 1,952 287ms 0ms 10 1,585 215ms 0ms 11 1,621 232ms 0ms 12 1,555 211ms 0ms 13 1,570 219ms 0ms 14 1,606 213ms 0ms 15 1,835 273ms 0ms 16 1,386 212ms 0ms 17 3,370 473ms 0ms 18 2,151 296ms 0ms 19 2,362 327ms 0ms 20 1,932 272ms 0ms 21 1,721 231ms 0ms 22 1,744 242ms 0ms [ User: tng_migration_user - Total duration: 1s932ms - Times executed: 64764 ]
[ Application: [unknown] - Total duration: 1s932ms - Times executed: 64764 ]
-
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-01 16:24:54 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '150'
-
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-11-30 12:06:02 Duration: 1ms 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-01 17:12:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13'
4 5s759ms 67,504 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 bind #4
Day Hour Count Duration Avg duration 03 1,368 119ms 0ms 04 1,444 124ms 0ms 05 1,564 132ms 0ms 06 1,560 134ms 0ms 07 1,560 133ms 0ms 08 1,560 130ms 0ms 09 1,560 133ms 0ms 10 1,560 133ms 0ms 11 1,560 132ms 0ms 12 1,560 132ms 0ms 13 1,560 132ms 0ms 14 1,560 131ms 0ms 15 1,560 132ms 0ms 16 1,544 130ms 0ms 17 1,560 132ms 0ms 18 1,560 131ms 0ms 19 1,560 134ms 0ms 20 1,560 132ms 0ms 21 1,560 132ms 0ms 22 1,472 124ms 0ms 23 1,440 123ms 0ms 00 1,440 125ms 0ms 01 1,440 125ms 0ms 02 1,440 123ms 0ms 03 1,440 123ms 0ms 04 1,444 123ms 0ms 05 1,564 133ms 0ms 06 1,560 132ms 0ms 07 1,560 130ms 0ms 08 1,560 132ms 0ms 09 1,560 132ms 0ms 10 1,556 133ms 0ms 11 1,560 133ms 0ms 12 1,560 133ms 0ms 13 1,560 131ms 0ms 14 1,560 133ms 0ms 15 1,560 134ms 0ms 16 1,544 131ms 0ms 17 1,564 131ms 0ms 18 1,560 131ms 0ms 19 1,560 132ms 0ms 20 1,560 134ms 0ms 21 1,560 133ms 0ms 22 1,560 133ms 0ms [ User: tng_migration_user - Total duration: 1s143ms - Times executed: 67504 ]
[ Application: [unknown] - Total duration: 1s143ms - Times executed: 67504 ]
-
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'
-
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 13:20:15 Duration: 0ms 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-30 17:19:15 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'EMAIL_SENDED'
5 4s766ms 15,799 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 342 107ms 0ms 04 360 108ms 0ms 05 360 107ms 0ms 06 360 109ms 0ms 07 360 108ms 0ms 08 360 105ms 0ms 09 360 109ms 0ms 10 360 109ms 0ms 11 360 107ms 0ms 12 360 106ms 0ms 13 360 106ms 0ms 14 360 110ms 0ms 15 360 109ms 0ms 16 360 105ms 0ms 17 360 109ms 0ms 18 360 106ms 0ms 19 360 108ms 0ms 20 360 108ms 0ms 21 360 109ms 0ms 22 338 100ms 0ms 23 360 111ms 0ms 00 360 113ms 0ms 01 360 112ms 0ms 02 360 110ms 0ms 03 360 108ms 0ms 04 360 137ms 0ms 05 360 105ms 0ms 06 360 105ms 0ms 07 360 102ms 0ms 08 360 102ms 0ms 09 360 104ms 0ms 10 359 105ms 0ms 11 360 104ms 0ms 12 360 106ms 0ms 13 360 102ms 0ms 14 360 105ms 0ms 15 360 107ms 0ms 16 360 113ms 0ms 17 360 107ms 0ms 18 360 107ms 0ms 19 360 109ms 0ms 20 360 109ms 0ms 21 360 111ms 0ms 22 360 108ms 0ms [ User: tng_migration_user - Total duration: 2s928ms - Times executed: 15799 ]
[ Application: [unknown] - Total duration: 2s928ms - Times executed: 15799 ]
-
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-30 17:00:15 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR', $2 = '2025-11-23 17:00:15'
6 3s476ms 44,109 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,170 92ms 0ms 05 1,170 91ms 0ms 06 1,170 93ms 0ms 07 1,170 91ms 0ms 08 1,170 91ms 0ms 09 1,170 92ms 0ms 10 1,170 95ms 0ms 11 1,170 95ms 0ms 12 1,170 91ms 0ms 13 1,170 89ms 0ms 14 1,170 91ms 0ms 15 1,170 92ms 0ms 16 1,053 84ms 0ms 17 1,170 93ms 0ms 18 1,170 88ms 0ms 19 1,170 90ms 0ms 20 1,170 90ms 0ms 21 1,170 90ms 0ms 22 1,170 90ms 0ms 04 1,053 82ms 0ms 05 1,170 91ms 0ms 06 1,170 94ms 0ms 07 1,170 95ms 0ms 08 1,170 90ms 0ms 09 1,170 92ms 0ms 10 1,170 93ms 0ms 11 1,170 91ms 0ms 12 1,170 90ms 0ms 13 1,170 93ms 0ms 14 1,170 92ms 0ms 15 1,170 92ms 0ms 16 1,053 85ms 0ms 17 1,170 90ms 0ms 18 1,170 93ms 0ms 19 1,170 92ms 0ms 20 1,170 91ms 0ms 21 1,170 92ms 0ms 22 1,170 92ms 0ms [ User: tng_migration_user - Total duration: 24s684ms - Times executed: 44109 ]
[ Application: [unknown] - Total duration: 24s684ms - Times executed: 44109 ]
-
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-01 21:06:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13', $2 = '2025-03-17 21:06: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-11-30 11:54:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13', $2 = '2025-03-16 11:54: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-01 14:12:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13', $2 = '2025-03-17 14:12:01', $3 = 't'
7 3s354ms 5,014 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 100 51ms 0ms 05 100 62ms 0ms 06 298 192ms 0ms 07 412 274ms 0ms 08 634 430ms 0ms 09 733 496ms 0ms 10 1,247 832ms 0ms 11 857 587ms 0ms 12 103 69ms 0ms 13 124 85ms 0ms 14 101 72ms 0ms 22 305 198ms 0ms [ User: tng_migration_user - Total duration: 7s51ms - Times executed: 5014 ]
[ Application: [unknown] - Total duration: 7s51ms - Times executed: 5014 ]
-
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-01 15:00:48 Duration: 3ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '1188'
-
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:48:39 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '50330'
8 3s186ms 17,353 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_state t0 WHERE t0.code = $1 LIMIT 1;Times Reported Time consuming bind #8
Day Hour Count Duration Avg duration 03 342 67ms 0ms 04 360 67ms 0ms 05 614 83ms 0ms 06 390 73ms 0ms 07 390 73ms 0ms 08 390 71ms 0ms 09 390 73ms 0ms 10 390 73ms 0ms 11 390 73ms 0ms 12 390 72ms 0ms 13 390 72ms 0ms 14 390 73ms 0ms 15 390 74ms 0ms 16 386 69ms 0ms 17 390 73ms 0ms 18 390 71ms 0ms 19 390 74ms 0ms 20 390 73ms 0ms 21 390 72ms 0ms 22 368 68ms 0ms 23 360 69ms 0ms 00 360 69ms 0ms 01 360 68ms 0ms 02 360 68ms 0ms 03 360 67ms 0ms 04 360 74ms 0ms 05 552 80ms 0ms 06 390 72ms 0ms 07 390 70ms 0ms 08 390 71ms 0ms 09 390 73ms 0ms 10 389 74ms 0ms 11 390 73ms 0ms 12 390 74ms 0ms 13 390 71ms 0ms 14 390 73ms 0ms 15 390 75ms 0ms 16 386 69ms 0ms 17 486 75ms 0ms 18 390 70ms 0ms 19 390 70ms 0ms 20 390 73ms 0ms 21 390 72ms 0ms 22 390 71ms 0ms [ User: tng_migration_user - Total duration: 230ms - Times executed: 17353 ]
[ Application: [unknown] - Total duration: 230ms - Times executed: 17353 ]
-
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'
-
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 18:36:56 Duration: 0ms 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-01 00:32:57 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR'
9 3s14ms 19,152 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 bind #9
Day Hour Count Duration Avg duration 04 109 21ms 0ms 06 366 55ms 0ms 09 38 5ms 0ms 10 244 36ms 0ms 12 304 46ms 0ms 14 800 127ms 0ms 17 136 19ms 0ms 20 244 39ms 0ms 21 1,200 177ms 0ms 04 71 14ms 0ms 06 207 43ms 0ms 07 193 31ms 0ms 08 714 130ms 0ms 09 547 95ms 0ms 10 481 85ms 0ms 11 250 46ms 0ms 12 34 6ms 0ms 13 155 29ms 0ms 14 343 51ms 0ms 15 1,114 167ms 0ms 17 4,310 664ms 0ms 18 1,682 254ms 0ms 19 2,411 376ms 0ms 20 1,179 181ms 0ms 21 561 84ms 0ms 22 1,459 220ms 0ms [ User: tng_migration_user - Total duration: 375ms - Times executed: 19152 ]
[ Application: [unknown] - Total duration: 375ms - Times executed: 19152 ]
-
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-01 14:25:13 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '78'
-
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-01 07:21:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '78'
-
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-01 10:34:48 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '79'
10 2s921ms 13,255 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.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 #10
Day Hour Count Duration Avg duration 05 3 1ms 0ms 06 285 59ms 0ms 09 23 4ms 0ms 10 190 37ms 0ms 12 236 48ms 0ms 14 488 105ms 0ms 17 95 17ms 0ms 20 190 41ms 0ms 21 820 162ms 0ms 05 20 6ms 0ms 06 180 58ms 0ms 07 65 22ms 0ms 08 594 210ms 0ms 09 301 94ms 0ms 10 43 13ms 0ms 11 129 45ms 0ms 12 27 10ms 0ms 13 47 16ms 0ms 14 140 31ms 0ms 15 809 169ms 0ms 17 3,228 665ms 0ms 18 1,274 256ms 0ms 19 1,812 378ms 0ms 20 798 168ms 0ms 21 423 85ms 0ms 22 1,035 208ms 0ms [ User: tng_migration_user - Total duration: 464ms - Times executed: 13255 ]
[ Application: [unknown] - Total duration: 464ms - Times executed: 13255 ]
-
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'
-
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:18:26 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '48326', $2 = '419', $3 = '418'
11 2s759ms 18,401 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 = $1 AND t0.locked = $2 ORDER BY t0.priority DESC;Times Reported Time consuming bind #11
Day Hour Count Duration Avg duration 03 398 63ms 0ms 04 413 57ms 0ms 05 420 61ms 0ms 06 420 63ms 0ms 07 420 62ms 0ms 08 420 61ms 0ms 09 420 63ms 0ms 10 420 63ms 0ms 11 420 64ms 0ms 12 420 63ms 0ms 13 420 60ms 0ms 14 420 62ms 0ms 15 420 64ms 0ms 16 411 55ms 0ms 17 420 59ms 0ms 18 420 60ms 0ms 19 420 63ms 0ms 20 420 62ms 0ms 21 420 60ms 0ms 22 398 62ms 0ms 23 420 63ms 0ms 00 420 63ms 0ms 01 420 63ms 0ms 02 420 62ms 0ms 03 420 61ms 0ms 04 411 58ms 0ms 05 420 63ms 0ms 06 420 63ms 0ms 07 420 61ms 0ms 08 420 64ms 0ms 09 420 66ms 0ms 10 419 65ms 0ms 11 420 63ms 0ms 12 420 64ms 0ms 13 420 63ms 0ms 14 420 64ms 0ms 15 420 65ms 0ms 16 411 57ms 0ms 17 420 63ms 0ms 18 420 63ms 0ms 19 420 64ms 0ms 20 420 64ms 0ms 21 420 64ms 0ms 22 420 63ms 0ms [ User: tng_migration_user - Total duration: 644ms - Times executed: 18401 ]
[ Application: [unknown] - Total duration: 644ms - Times executed: 18401 ]
-
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-01 02:10:01 Duration: 1ms 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-01 00:10:01 Duration: 1ms 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-01 23:19:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = 'f'
12 2s689ms 22,309 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.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 #12
Day Hour Count Duration Avg duration 04 419 42ms 0ms 05 555 66ms 0ms 06 523 61ms 0ms 07 519 60ms 0ms 08 516 54ms 0ms 09 517 55ms 0ms 10 521 59ms 0ms 11 518 57ms 0ms 12 524 65ms 0ms 13 522 60ms 0ms 14 531 66ms 0ms 15 511 57ms 0ms 16 511 52ms 0ms 17 513 55ms 0ms 18 512 53ms 0ms 19 511 57ms 0ms 20 513 52ms 0ms 21 525 60ms 0ms 22 511 55ms 0ms 04 381 41ms 0ms 05 508 58ms 0ms 06 509 78ms 0ms 07 739 88ms 0ms 08 2,098 294ms 0ms 09 1,193 161ms 0ms 10 592 77ms 0ms 11 606 83ms 0ms 12 468 53ms 0ms 13 767 94ms 0ms 14 474 56ms 0ms 15 644 84ms 0ms 16 463 49ms 0ms 17 594 73ms 0ms 18 478 51ms 0ms 19 488 61ms 0ms 20 478 56ms 0ms 21 469 54ms 0ms 22 588 73ms 0ms [ User: tng_migration_user - Total duration: 444ms - Times executed: 22309 ]
[ Application: [unknown] - Total duration: 444ms - Times executed: 22309 ]
-
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-11-30 13:22:16 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '42063'
-
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 14:08:42 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '42006'
13 2s58ms 1,598 0ms 3ms 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 06 10 15ms 1ms 09 4 4ms 1ms 10 7 8ms 1ms 12 9 11ms 1ms 14 26 34ms 1ms 17 12 14ms 1ms 20 4 4ms 1ms 21 15 17ms 1ms 05 3 3ms 1ms 06 62 86ms 1ms 07 48 62ms 1ms 08 369 479ms 1ms 09 175 223ms 1ms 10 76 98ms 1ms 11 84 106ms 1ms 12 71 89ms 1ms 13 92 120ms 1ms 14 18 22ms 1ms 15 45 57ms 1ms 17 216 273ms 1ms 18 69 84ms 1ms 19 86 113ms 1ms 20 40 51ms 1ms 21 13 15ms 1ms 22 44 58ms 1ms [ User: tng_migration_user - Total duration: 226ms - Times executed: 1598 ]
[ Application: [unknown] - Total duration: 226ms - Times executed: 1598 ]
-
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-11-30 18:45:11 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '16031'
-
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 10:48:16 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '8539'
14 1s669ms 8,568 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 50ms 0ms 07 238 45ms 0ms 08 238 46ms 0ms 09 238 46ms 0ms 10 238 45ms 0ms 11 238 45ms 0ms 12 238 45ms 0ms 13 238 45ms 0ms 14 238 46ms 0ms 15 238 49ms 0ms 16 238 45ms 0ms 17 238 45ms 0ms 18 238 45ms 0ms 19 238 49ms 0ms 20 238 44ms 0ms 21 238 45ms 0ms 22 238 47ms 0ms 05 238 45ms 0ms 06 238 46ms 0ms 07 238 47ms 0ms 08 238 49ms 0ms 09 238 48ms 0ms 10 238 45ms 0ms 11 238 45ms 0ms 12 238 47ms 0ms 13 238 45ms 0ms 14 238 48ms 0ms 15 238 47ms 0ms 16 238 45ms 0ms 17 238 44ms 0ms 18 238 44ms 0ms 19 238 45ms 0ms 20 238 45ms 0ms 21 238 44ms 0ms 22 238 44ms 0ms [ User: tng_migration_user - Total duration: 137ms - Times executed: 8568 ]
[ Application: [unknown] - Total duration: 137ms - Times executed: 8568 ]
-
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-30 22:32:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '95', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = '2026-03-11 22:32:02', $7 = '2026-03-15 22: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_.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 = '113', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = '2025-04-18 09:05:01', $7 = '2025-04-22 09:05:01'
15 1s573ms 1,643 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 #15
Day Hour Count Duration Avg duration 05 1 0ms 0ms 06 9 10ms 1ms 07 2 0ms 0ms 09 3 2ms 0ms 10 6 5ms 0ms 11 1 0ms 0ms 12 9 8ms 0ms 13 3 1ms 0ms 14 24 23ms 0ms 17 9 7ms 0ms 20 3 2ms 0ms 21 14 12ms 0ms 05 2 1ms 0ms 06 75 70ms 0ms 07 47 46ms 0ms 08 405 382ms 0ms 09 197 181ms 0ms 10 76 76ms 1ms 11 99 86ms 0ms 12 70 69ms 0ms 13 104 95ms 0ms 14 16 16ms 1ms 15 40 43ms 1ms 17 196 194ms 0ms 18 61 58ms 0ms 19 80 82ms 1ms 20 36 36ms 1ms 21 11 10ms 0ms 22 44 44ms 1ms [ User: tng_migration_user - Total duration: 95ms - Times executed: 1643 ]
[ Application: [unknown] - Total duration: 95ms - Times executed: 1643 ]
-
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'
16 1s401ms 15,799 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 #16
Day Hour Count Duration Avg duration 03 342 31ms 0ms 04 360 30ms 0ms 05 360 30ms 0ms 06 360 31ms 0ms 07 360 31ms 0ms 08 360 30ms 0ms 09 360 31ms 0ms 10 360 30ms 0ms 11 360 30ms 0ms 12 360 30ms 0ms 13 360 30ms 0ms 14 360 31ms 0ms 15 360 31ms 0ms 16 360 30ms 0ms 17 360 31ms 0ms 18 360 31ms 0ms 19 360 32ms 0ms 20 360 32ms 0ms 21 360 31ms 0ms 22 338 30ms 0ms 23 360 32ms 0ms 00 360 33ms 0ms 01 360 32ms 0ms 02 360 32ms 0ms 03 360 32ms 0ms 04 360 32ms 0ms 05 360 31ms 0ms 06 360 32ms 0ms 07 360 31ms 0ms 08 360 31ms 0ms 09 360 31ms 0ms 10 359 32ms 0ms 11 360 32ms 0ms 12 360 32ms 0ms 13 360 32ms 0ms 14 360 32ms 0ms 15 360 33ms 0ms 16 360 31ms 0ms 17 360 32ms 0ms 18 360 32ms 0ms 19 360 32ms 0ms 20 360 32ms 0ms 21 360 31ms 0ms 22 360 32ms 0ms [ User: tng_migration_user - Total duration: 278ms - Times executed: 15799 ]
[ Application: [unknown] - Total duration: 278ms - Times executed: 15799 ]
-
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-11-30 04:31:14 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-01 14:00:25 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-01 21:57:55 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = '0'
17 1s326ms 6,552 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 39ms 0ms 07 182 35ms 0ms 08 182 36ms 0ms 09 182 37ms 0ms 10 182 36ms 0ms 11 182 35ms 0ms 12 182 36ms 0ms 13 182 36ms 0ms 14 182 36ms 0ms 15 182 38ms 0ms 16 182 36ms 0ms 17 182 36ms 0ms 18 182 36ms 0ms 19 182 39ms 0ms 20 182 34ms 0ms 21 182 36ms 0ms 22 182 39ms 0ms 05 182 37ms 0ms 06 182 36ms 0ms 07 182 37ms 0ms 08 182 40ms 0ms 09 182 37ms 0ms 10 182 36ms 0ms 11 182 36ms 0ms 12 182 38ms 0ms 13 182 35ms 0ms 14 182 37ms 0ms 15 182 38ms 0ms 16 182 36ms 0ms 17 182 34ms 0ms 18 182 34ms 0ms 19 182 36ms 0ms 20 182 36ms 0ms 21 182 35ms 0ms 22 182 36ms 0ms [ User: tng_migration_user - Total duration: 216ms - Times executed: 6552 ]
[ Application: [unknown] - Total duration: 216ms - Times executed: 6552 ]
-
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-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'
-
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 06:14:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '111', $2 = 'READY', $3 = 'AWAITING', $4 = 'MISSED', $5 = 'DONE', $6 = 'CANCELED', $7 = 't', $8 = '2025-08-01 06:14:02', $9 = '2025-08-12 06:14:02'
18 1s316ms 6,552 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) 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 39ms 0ms 07 182 35ms 0ms 08 182 36ms 0ms 09 182 36ms 0ms 10 182 35ms 0ms 11 182 35ms 0ms 12 182 35ms 0ms 13 182 36ms 0ms 14 182 36ms 0ms 15 182 38ms 0ms 16 182 35ms 0ms 17 182 35ms 0ms 18 182 36ms 0ms 19 182 39ms 0ms 20 182 34ms 0ms 21 182 35ms 0ms 22 182 38ms 0ms 05 182 36ms 0ms 06 182 36ms 0ms 07 182 37ms 0ms 08 182 37ms 0ms 09 182 37ms 0ms 10 182 35ms 0ms 11 182 36ms 0ms 12 182 37ms 0ms 13 182 36ms 0ms 14 182 37ms 0ms 15 182 38ms 0ms 16 182 36ms 0ms 17 182 35ms 0ms 18 182 34ms 0ms 19 182 36ms 0ms 20 182 36ms 0ms 21 182 35ms 0ms 22 182 35ms 0ms [ User: tng_migration_user - Total duration: 1s826ms - Times executed: 6552 ]
[ Application: [unknown] - Total duration: 1s826ms - Times executed: 6552 ]
-
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 13:14:01 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-10 13:14: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-01 07:23:01 Duration: 0ms 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-10 07:23: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-11-30 23:50:01 Duration: 0ms 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-09 23:50:01'
19 1s126ms 1,603 0ms 1ms 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 06 10 8ms 0ms 09 4 2ms 0ms 10 7 4ms 0ms 12 9 6ms 0ms 14 26 19ms 0ms 17 12 7ms 0ms 20 4 2ms 0ms 21 15 9ms 0ms 05 3 2ms 0ms 06 62 45ms 0ms 07 49 35ms 0ms 08 369 255ms 0ms 09 176 127ms 0ms 10 76 55ms 0ms 11 85 57ms 0ms 12 71 48ms 0ms 13 93 65ms 0ms 14 18 12ms 0ms 15 45 31ms 0ms 17 216 149ms 0ms 18 69 48ms 0ms 19 86 61ms 0ms 20 40 27ms 0ms 21 13 8ms 0ms 22 45 30ms 0ms [ User: tng_migration_user - Total duration: 192ms - Times executed: 1603 ]
[ Application: [unknown] - Total duration: 192ms - Times executed: 1603 ]
-
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-01 10:50:21 Duration: 1ms 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-01 07:01:14 Duration: 1ms 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-01 18:36:05 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '3'
20 955ms 18,661 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 567 26ms 0ms 05 502 25ms 0ms 06 503 25ms 0ms 07 503 26ms 0ms 08 501 24ms 0ms 09 502 23ms 0ms 10 503 25ms 0ms 11 501 24ms 0ms 12 503 27ms 0ms 13 502 25ms 0ms 14 505 27ms 0ms 15 495 23ms 0ms 16 495 24ms 0ms 17 496 24ms 0ms 18 495 22ms 0ms 19 495 22ms 0ms 20 495 22ms 0ms 21 498 25ms 0ms 22 495 22ms 0ms 04 531 26ms 0ms 05 473 21ms 0ms 06 489 28ms 0ms 07 480 25ms 0ms 08 508 38ms 0ms 09 480 26ms 0ms 10 472 24ms 0ms 11 473 24ms 0ms 12 471 22ms 0ms 13 471 24ms 0ms 14 471 24ms 0ms 15 482 26ms 0ms 16 471 23ms 0ms 17 472 24ms 0ms 18 472 22ms 0ms 19 473 26ms 0ms 20 474 25ms 0ms 21 469 23ms 0ms 22 473 25ms 0ms [ User: tng_migration_user - Total duration: 293ms - Times executed: 18661 ]
[ Application: [unknown] - Total duration: 293ms - Times executed: 18661 ]
-
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 14:08:42 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '137273'
-
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:22:16 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '138048'
-
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:59:41 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '137278'
-
Events
Log levels
Key values
- 2,265,414 Event entries
- (EVENTLOG entries are formaly LOG level entries that are not queries)
Events distribution (except queries)
Key values
- 0 PANIC entries
- 34092 FATAL entries
- 0 ERROR entries
- 102 WARNING entries
- 16 EVENTLOG entries
Most Frequent Errors/Events
Key values
- 34,092 Max number of times the same event was reported
- 34,210 Total events found
Rank Times reported Error 1 34,092 FATAL: password authentication failed for user "..."
Times Reported Most Frequent Error / Event #1
Day Hour Count 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 - 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-12-01 04:05:30 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 102 WARNING: there is already a transaction in progress
Times Reported Most Frequent Error / Event #2
Day Hour Count Dec 01 05 51 17 51 3 16 LOG: could not receive data from client: Connection reset by peer
Times Reported Most Frequent Error / Event #3
Day Hour Count Dec 01 01 2 23 14