-
Global information
- Generated on Mon Dec 1 04:33:14 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 2,690,928 log entries in 33m12s
- Log start from 2025-11-30 00:00:01 to 2025-11-30 23:59:58
-
Overview
Global Stats
- 562 Number of unique normalized queries
- 316,818 Number of queries
- 24m25s Total query duration
- 2025-11-30 00:00:01 First query
- 2025-11-30 23:59:56 Last query
- 1,500 queries/s at 2025-11-30 12:00:03 Query peak
- 24m25s Total query duration
- 29s536ms Prepare/parse total duration
- 38s888ms Bind total duration
- 23m17s Execute total duration
- 34,176 Number of events
- 3 Number of unique normalized events
- 34,058 Max number of times the same event was reported
- 0 Number of cancellation
- 434 Total number of automatic vacuums
- 487 Total number of automatic analyzes
- 6,689 Number temporary file
- 14.36 MiB Max size of temporary file
- 2.09 MiB Average size of temporary file
- 14,611 Total number of sessions
- 3 sessions at 2025-11-30 03:34:33 Session peak
- 49m23s Total duration of sessions
- 202ms Average duration of sessions
- 21 Average queries per session
- 100ms Average queries duration per session
- 102ms Average idle time per session
- 14,611 Total number of connections
- 15 connections/s at 2025-11-30 05:02:08 Connection peak
- 3 Total number of databases
SQL Traffic
Key values
- 1,500 queries/s Query Peak
- 2025-11-30 12:00:03 Date
SELECT Traffic
Key values
- 1,500 queries/s Query Peak
- 2025-11-30 12:00:03 Date
INSERT/UPDATE/DELETE Traffic
Key values
- 1,287 queries/s Query Peak
- 2025-11-30 23:35:16 Date
Queries duration
Key values
- 24m25s Total query duration
Prepared queries ratio
Key values
- 0.00 Ratio of bind vs prepare
- 0.00 % Ratio between prepared and "usual" statements
General Activity
↑ Back to the top of the General Activity tableDay Hour Count Min duration Max duration Avg duration Latency Percentile(90) Latency Percentile(95) Latency Percentile(99) Nov 30 00 7,552 0ms 36ms 0ms 7ms 37ms 996ms 01 6,444 0ms 29ms 0ms 6ms 7ms 127ms 02 6,420 0ms 1ms 0ms 7ms 7ms 7ms 03 6,420 0ms 1ms 0ms 7ms 7ms 8ms 04 6,420 0ms 1ms 0ms 7ms 7ms 8ms 05 16,201 0ms 6m6s 28ms 1s329ms 3s174ms 6m6s 06 15,132 0ms 1s364ms 1ms 1s299ms 1s359ms 1s515ms 07 15,035 0ms 1s368ms 1ms 1s335ms 1s416ms 1s490ms 08 13,742 0ms 1s567ms 1ms 1s341ms 1s553ms 1s676ms 09 13,766 0ms 1s500ms 1ms 1s326ms 1s409ms 1s597ms 10 13,932 0ms 1s352ms 1ms 1s316ms 1s407ms 1s494ms 11 14,604 0ms 1s569ms 1ms 1s351ms 1s455ms 1s666ms 12 13,779 0ms 1s527ms 1ms 1s341ms 1s473ms 1s628ms 13 14,847 0ms 1s459ms 1ms 1s326ms 1s493ms 1s558ms 14 13,959 0ms 1s243ms 1ms 1s280ms 1s321ms 1s464ms 15 17,341 0ms 1s410ms 0ms 1s362ms 1s455ms 1s583ms 16 13,704 0ms 1s351ms 1ms 1s322ms 1s372ms 1s531ms 17 14,248 0ms 9m19s 46ms 1s428ms 2s339ms 9m19s 18 14,499 0ms 1s300ms 1ms 1s350ms 1s363ms 1s458ms 19 13,759 0ms 1s333ms 1ms 1s327ms 1s386ms 1s430ms 20 13,704 0ms 1s459ms 1ms 1s348ms 1s503ms 1s555ms 21 14,444 0ms 1s423ms 1ms 1s317ms 1s416ms 1s526ms 22 17,660 0ms 1s358ms 0ms 1s300ms 1s404ms 1s567ms 23 19,206 0ms 2s845ms 1ms 1s416ms 2s137ms 2s938ms Day Hour SELECT COPY TO Average Duration Latency Percentile(90) Latency Percentile(95) Latency Percentile(99) Nov 30 00 6,818 0 0ms 6ms 6ms 18ms 01 6,024 0 0ms 5ms 6ms 6ms 02 6,000 0 0ms 6ms 6ms 6ms 03 6,000 0 0ms 5ms 6ms 6ms 04 6,000 0 0ms 6ms 6ms 7ms 05 12,732 0 0ms 83ms 90ms 420ms 06 13,544 0 0ms 65ms 86ms 90ms 07 14,137 0 0ms 28ms 88ms 113ms 08 12,891 0 0ms 21ms 89ms 100ms 09 12,913 0 0ms 21ms 87ms 107ms 10 13,076 0 0ms 21ms 88ms 96ms 11 13,722 0 0ms 22ms 87ms 125ms 12 12,922 0 0ms 19ms 91ms 112ms 13 13,942 0 0ms 22ms 85ms 108ms 14 13,064 0 0ms 20ms 86ms 88ms 15 16,365 0 0ms 51ms 93ms 176ms 16 12,861 0 0ms 22ms 88ms 99ms 17 12,450 0 0ms 18ms 88ms 224ms 18 13,612 0 0ms 44ms 88ms 226ms 19 12,903 0 0ms 20ms 87ms 90ms 20 12,861 0 0ms 23ms 87ms 99ms 21 13,591 0 0ms 19ms 86ms 95ms 22 16,754 0 0ms 30ms 86ms 101ms 23 12,509 0 0ms 23ms 86ms 88ms Day Hour INSERT UPDATE DELETE COPY FROM Average Duration Latency Percentile(90) Latency Percentile(95) Latency Percentile(99) Nov 30 00 102 1 0 0 0ms 0ms 0ms 1ms 01 0 0 0 0 0ms 0ms 0ms 0ms 02 0 0 0 0 0ms 0ms 0ms 0ms 03 0 0 0 0 0ms 0ms 0ms 0ms 04 0 0 0 0 0ms 0ms 0ms 0ms 05 623 195 0 0 1ms 0ms 2ms 191ms 06 154 216 0 0 0ms 3ms 3ms 55ms 07 18 100 0 0 1ms 3ms 4ms 6ms 08 12 94 0 0 1ms 3ms 3ms 4ms 09 12 95 0 0 1ms 3ms 3ms 4ms 10 11 96 0 0 1ms 3ms 3ms 6ms 11 16 98 0 0 1ms 3ms 4ms 7ms 12 13 95 0 0 1ms 3ms 3ms 4ms 13 20 100 0 0 1ms 3ms 4ms 7ms 14 21 98 0 0 1ms 3ms 3ms 6ms 15 30 107 0 0 1ms 3ms 4ms 13ms 16 10 94 0 0 1ms 3ms 3ms 4ms 17 9 86 0 0 1ms 3ms 3ms 5ms 18 11 102 0 0 1ms 3ms 4ms 6ms 19 12 96 0 0 1ms 3ms 3ms 4ms 20 10 94 0 0 1ms 3ms 4ms 4ms 21 10 96 0 0 1ms 3ms 3ms 5ms 22 19 100 0 0 1ms 3ms 3ms 5ms 23 10 94 0 0 1ms 3ms 4ms 4ms Day Hour Prepare Bind Bind/Prepare Percentage of prepare Nov 30 00 6,741 6,741 1.00 94.58% 01 5,820 5,820 1.00 96.61% 02 5,820 5,820 1.00 97.00% 03 5,820 5,820 1.00 97.00% 04 5,820 5,820 1.00 97.00% 05 13,342 13,342 1.00 84.65% 06 13,751 13,751 1.00 93.88% 07 14,092 14,092 1.00 96.93% 08 12,834 12,834 1.00 96.82% 09 12,857 12,857 1.00 96.81% 10 13,020 13,020 1.00 96.85% 11 13,673 13,673 1.00 96.90% 12 12,867 12,867 1.00 96.80% 13 13,899 13,899 1.00 96.86% 14 13,020 13,020 1.00 96.67% 15 16,339 16,339 1.00 97.12% 16 12,802 12,802 1.00 96.84% 17 12,343 12,343 1.00 89.62% 18 13,565 13,565 1.00 96.90% 19 12,848 12,848 1.00 96.79% 20 12,802 12,802 1.00 96.84% 21 13,534 13,534 1.00 96.98% 22 16,710 16,710 1.00 97.39% 23 12,466 12,466 1.00 66.76% Day Hour Count Average / Second Nov 30 00 605 0.17/s 01 602 0.17/s 02 600 0.17/s 03 600 0.17/s 04 600 0.17/s 05 646 0.18/s 06 601 0.17/s 07 613 0.17/s 08 602 0.17/s 09 601 0.17/s 10 604 0.17/s 11 609 0.17/s 12 602 0.17/s 13 614 0.17/s 14 607 0.17/s 15 634 0.18/s 16 600 0.17/s 17 644 0.18/s 18 612 0.17/s 19 601 0.17/s 20 600 0.17/s 21 604 0.17/s 22 618 0.17/s 23 592 0.16/s Day Hour Count Average Duration Average idle time Nov 30 00 605 23ms 20ms 01 602 18ms 17ms 02 600 18ms 18ms 03 600 18ms 17ms 04 600 19ms 18ms 05 646 1s542ms 831ms 06 601 98ms 72ms 07 613 56ms 31ms 08 602 52ms 26ms 09 601 52ms 26ms 10 604 54ms 29ms 11 609 57ms 31ms 12 602 53ms 27ms 13 614 58ms 33ms 14 607 52ms 28ms 15 634 64ms 39ms 16 600 52ms 26ms 17 644 2s20ms 982ms 18 612 61ms 36ms 19 601 51ms 26ms 20 600 52ms 27ms 21 604 55ms 29ms 22 618 57ms 33ms 23 592 66ms 33ms -
Connections
Established Connections
Key values
- 15 connections Connection Peak
- 2025-11-30 05:02:08 Date
Connections per database
Key values
- celspac Main Database
- 14,611 connections Total
Connections per user
Key values
- tng_migration_user Main User
- 14,611 connections Total
-
Sessions
Simultaneous sessions
Key values
- 3 sessions Session Peak
- 2025-11-30 03:34:33 Date
Histogram of session times
Key values
- 14,321 0-500ms duration
Sessions per database
Key values
- celspac Main Database
- 14,611 sessions Total
Sessions per user
Key values
- tng_migration_user Main User
- 14,611 sessions Total
Sessions per host
Key values
- 127.0.0.1 Main Host
- 14,611 sessions Total
-
Checkpoints / Restartpoints
Checkpoints Buffers
Key values
- 8,262 buffers Checkpoint Peak
- 2025-11-30 17:08:40 Date
- 269.950 seconds Highest write time
- 0.041 seconds Sync time
Checkpoints Wal files
Key values
- 16 files Wal files usage Peak
- 2025-11-30 05:08:33 Date
Checkpoints distance
Key values
- 461.89 Mo Distance Peak
- 2025-11-30 05:08:33 Date
Checkpoints Activity
↑ Back to the top of the Checkpoint Activity tableDay Hour Written buffers Write time Sync time Total time Nov 30 00 2,435 243.35s 0.024s 243.404s 01 0 0s 0s 0s 02 0 0s 0s 0s 03 0 0s 0s 0s 04 0 0s 0s 0s 05 19,308 1,914.332s 0.097s 1,914.558s 06 20,316 2,384.277s 0.115s 2,384.574s 07 20,339 2,365.978s 0.107s 2,366.234s 08 20,295 2,358.169s 0.107s 2,358.414s 09 20,125 2,367.241s 0.108s 2,367.472s 10 20,174 2,371.032s 0.122s 2,372.283s 11 20,045 2,357.156s 0.115s 2,357.455s 12 20,286 2,380.273s 0.132s 2,380.604s 13 20,067 2,359.204s 0.124s 2,359.491s 14 20,136 2,391.165s 0.134s 2,391.471s 15 19,872 2,354.142s 0.125s 2,354.444s 16 20,368 2,407.783s 0.129s 2,408.093s 17 27,081 2,240.153s 0.166s 2,240.502s 18 20,444 2,405.97s 0.138s 2,406.268s 19 18,158 2,183.88s 0.111s 2,184.122s 20 20,386 2,411.518s 0.126s 2,411.777s 21 20,319 2,431.464s 0.158s 2,431.767s 22 18,060 2,186.763s 0.126s 2,187.211s 23 18,294 2,214.308s 0.139s 2,214.6s Day Hour Added Removed Recycled Synced files Longest sync Average sync Nov 30 00 0 0 0 122 0.004s 0.002s 01 0 0 0 0 0s 0s 02 0 0 0 0 0s 0s 03 0 0 0 0 0s 0s 04 0 0 0 0 0s 0s 05 0 0 34 742 0.003s 0.008s 06 0 8 13 790 0.008s 0.012s 07 0 3 18 730 0.005s 0.012s 08 0 1 20 725 0.005s 0.012s 09 0 0 21 726 0.004s 0.012s 10 0 0 20 728 0.005s 0.012s 11 0 1 20 737 0.004s 0.012s 12 0 0 21 744 0.008s 0.012s 13 0 0 21 742 0.006s 0.012s 14 0 0 21 774 0.008s 0.012s 15 0 1 20 726 0.007s 0.011s 16 0 0 21 694 0.012s 0.012s 17 0 0 32 862 0.028s 0.013s 18 0 6 14 722 0.008s 0.012s 19 0 2 19 693 0.006s 0.011s 20 0 0 21 686 0.005s 0.012s 21 0 0 21 726 0.012s 0.012s 22 0 0 21 715 0.010s 0.011s 23 0 0 21 709 0.009s 0.012s Day Hour Count Avg time (sec) Nov 30 00 0 0s 01 0 0s 02 0 0s 03 0 0s 04 0 0s 05 0 0s 06 0 0s 07 0 0s 08 0 0s 09 0 0s 10 0 0s 11 0 0s 12 0 0s 13 0 0s 14 0 0s 15 0 0s 16 0 0s 17 0 0s 18 0 0s 19 0 0s 20 0 0s 21 0 0s 22 0 0s 23 0 0s Day Hour Mean distance Mean estimate Nov 30 00 17,357.00 kB 52,814.00 kB 01 0.00 kB 0.00 kB 02 0.00 kB 0.00 kB 03 0.00 kB 0.00 kB 04 0.00 kB 0.00 kB 05 69,019.12 kB 181,974.88 kB 06 28,567.58 kB 87,267.25 kB 07 28,429.42 kB 45,074.58 kB 08 28,426.00 kB 34,147.17 kB 09 28,439.17 kB 33,641.50 kB 10 28,470.50 kB 33,668.75 kB 11 28,452.67 kB 33,659.00 kB 12 28,484.75 kB 33,647.83 kB 13 28,479.33 kB 33,667.17 kB 14 28,552.33 kB 33,823.92 kB 15 31,076.55 kB 34,011.73 kB 16 28,499.75 kB 33,748.67 kB 17 43,494.00 kB 143,480.33 kB 18 28,503.00 kB 66,136.42 kB 19 31,095.55 kB 45,018.64 kB 20 28,508.08 kB 47,118.08 kB 21 28,507.17 kB 34,647.33 kB 22 31,062.18 kB 39,479.73 kB 23 28,548.50 kB 52,969.25 kB -
Temporary Files
Size of temporary files
Key values
- 73.35 MiB Temp Files size Peak
- 2025-11-30 16:06:02 Date
Number of temporary files
Key values
- 36 per second Temp Files Peak
- 2025-11-30 09:54:02 Date
Temporary Files Activity
↑ Back to the top of the Temporary Files Activity tableDay Hour Count Total size Average size Nov 30 00 0 0 0 01 0 0 0 02 0 0 0 03 0 0 0 04 0 0 0 05 371 782.19 MiB 2.11 MiB 06 348 732.24 MiB 2.10 MiB 07 354 732.44 MiB 2.07 MiB 08 351 732.32 MiB 2.09 MiB 09 354 732.29 MiB 2.07 MiB 10 354 732.23 MiB 2.07 MiB 11 348 732.16 MiB 2.10 MiB 12 357 732.62 MiB 2.05 MiB 13 351 732.38 MiB 2.09 MiB 14 353 729.73 MiB 2.07 MiB 15 354 732.35 MiB 2.07 MiB 16 348 732.05 MiB 2.10 MiB 17 327 727.05 MiB 2.22 MiB 18 357 732.25 MiB 2.05 MiB 19 343 727.31 MiB 2.12 MiB 20 348 732.27 MiB 2.10 MiB 21 357 732.27 MiB 2.05 MiB 22 357 732.25 MiB 2.05 MiB 23 357 732.26 MiB 2.05 MiB Queries generating the most temporary files (N)
Rank Count Total size Min size Max size Avg size Query 1 6,659 13.51 GiB 632.00 KiB 8.54 MiB 2.08 MiB refresh materialized view core.mv_subject_form with data;-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-30 23:48:04 Duration: 2s845ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-30 23:54:04 Duration: 2s67ms 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-11-30 17:12:04 Duration: 2s53ms 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 1.97 MiB 8.00 KiB 768.00 KiB 252.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-11-30 05:02:23 Duration: 94ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ ALTER TABLE "celspac"."dbt_stg"."stg_celspac_admin__subject" ADD PRIMARY KEY (id);
Date: 2025-11-30 17:02:18 Duration: 26ms 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-11-30 05:02:23 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
3 8 12.19 MiB 8.00 KiB 3.28 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-11-30 05:02:09 Duration: 169ms 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-11-30 17:02:04 Duration: 144ms 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-11-30 05:02:09 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-11-30 17:02:18 Duration: 1s233ms 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-11-30 05:02:23 Duration: 1s209ms 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-11-30 05:02:23 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
5 4 35.87 MiB 7.77 MiB 10.16 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-11-30 05:02:09 Duration: 595ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.inte_unique_subject_extend_array"} */ create table "celspac"."dbt_stg"."inte_unique_subject_extend_array__dbt_tmp" as ( SELECT subject_id, array_agg(extend_template ORDER BY subcohort_id ) AS extend_template, array_agg(extend ORDER BY subcohort_id ) AS extend, array_agg(description ORDER BY subcohort_id ) AS description, array_agg(description_internal ORDER BY subcohort_id ) AS description_internal, array_agg(subcohort_id ORDER BY subcohort_id ) AS subcohort_id, array_agg(subcohort_name ORDER BY subcohort_id ) AS subcohort_name, array_agg(column_prefix ORDER BY subcohort_id ) AS column_prefix FROM "celspac"."dbt_stg"."inte_subject_extend" GROUP BY subject_id );
Date: 2025-11-30 17:02:04 Duration: 337ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.inte_unique_subject_extend_array"} */ create table "celspac"."dbt_stg"."inte_unique_subject_extend_array__dbt_tmp" as ( SELECT subject_id, array_agg(extend_template ORDER BY subcohort_id ) AS extend_template, array_agg(extend ORDER BY subcohort_id ) AS extend, array_agg(description ORDER BY subcohort_id ) AS description, array_agg(description_internal ORDER BY subcohort_id ) AS description_internal, array_agg(subcohort_id ORDER BY subcohort_id ) AS subcohort_id, array_agg(subcohort_name ORDER BY subcohort_id ) AS subcohort_name, array_agg(column_prefix ORDER BY subcohort_id ) AS column_prefix FROM "celspac"."dbt_stg"."inte_subject_extend" GROUP BY subject_id );
Date: 2025-11-30 05:02:09 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
6 2 20.61 MiB 8.70 MiB 11.91 MiB 10.31 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-11-30 17:11:42 Duration: 9m19s 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-11-30 05:08:31 Duration: 6m6s 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 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-11-30 17:02:19 Duration: 822ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_all"} */ create table "celspac"."dbt_marts_dbt_all"."export_proband_all__dbt_tmp" as ( SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, ct.* FROM ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code || ';' || subject_role_code || ';' || activity_state_code AS state_role FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01'), ('celspac_pr_zajemci_p01'), ('covid_p01'), ('covid_p02'), ('covid_p03'), ('dust_p01_tng_p09'), ('dust_p01_tng_p10'), ('dust_p01_tng_p11'), ('hapiee_p01'), ('hapiee_p02'), ('hba_p01'), ('horpark'), ('horpark_patients'), ('parents_p01'), ('parents_p02'), ('psycap_p01_hba_p01'), ('psycap_p01_ya_p01'), ('psycap_p01_ya_p02'), ('psycap_p01_ya_p03'), ('psycap_p02_new_hba_p01'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_hba_p01'), ('psycap_p02_old_ya_p01'), ('psycap_p02_old_ya_p02'), ('psycap_p02_old_ya_p03'), ('tng_4mi_p1'), ('tng_4mi_p2'), ('tng_children_p1'), ('tng_children_p1_chibra'), ('tng__monitor'), ('tng_p01'), ('tng_p02'), ('tng_p03'), ('tng_p04'), ('tng_p05'), ('tng_p06'), ('tng_p07'), ('tng_p08'), ('tng_p08_test'), ('tng_p09'), ('tng_p10'), ('tng_p10_test_tp'), ('tng_p11'), ('tng_p11_monitor'), ('tng_p12'), ('tng_p12_monitor'), ('tng_p13'), ('tng_p13_monitor'), ('tng_pilot_8__monitor'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor'), ('vulde'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2'), ('ya_p04') $$ ) AS state_role ("subject_id" int, "celspac_pr_celspac_p01" text, "celspac_pr_elspac_p01" text, "celspac_pr_zajemci_p01" text, "covid_p01" text, "covid_p02" text, "covid_p03" text, "dust_p01_tng_p09" text, "dust_p01_tng_p10" text, "dust_p01_tng_p11" text, "hapiee_p01" text, "hapiee_p02" text, "hba_p01" text, "horpark" text, "horpark_patients" text, "parents_p01" text, "parents_p02" text, "psycap_p01_hba_p01" text, "psycap_p01_ya_p01" text, "psycap_p01_ya_p02" text, "psycap_p01_ya_p03" text, "psycap_p02_new_hba_p01" text, "psycap_p02_new_ya_p03" text, "psycap_p02_old_hba_p01" text, "psycap_p02_old_ya_p01" text, "psycap_p02_old_ya_p02" text, "psycap_p02_old_ya_p03" text, "tng_4mi_p1" text, "tng_4mi_p2" text, "tng_children_p1" text, "tng_children_p1_chibra" text, "tng__monitor" text, "tng_p01" text, "tng_p02" text, "tng_p03" text, "tng_p04" text, "tng_p05" text, "tng_p06" text, "tng_p07" text, "tng_p08" text, "tng_p08_test" text, "tng_p09" text, "tng_p10" text, "tng_p10_test_tp" text, "tng_p11" text, "tng_p11_monitor" text, "tng_p12" text, "tng_p12_monitor" text, "tng_p13" text, "tng_p13_monitor" text, "tng_pilot_8__monitor" text, "tng_pilot_9__form_fix_2019_06" text, "tng_pilot_9__form_fix_mm38p01_v2_v2" text, "tng_pilot_9__form_fix_mm38p02_v2_v2" text, "tng_pilot_9__form_fix_mm38p03_v2_v2" text, "tng_pilot_9__form_fix_mm38p04_v2_v2" text, "tng_pilot_9__monitor" text, "vulde" text, "ya_p01" text, "ya_p01_digi_ya03v2" text, "ya_p01_digi_ya04v2" text, "ya_p01_digi_ya05v2" text, "ya_p01_test" text, "ya_p02" text, "ya_p02_digi_ya03v2" text, "ya_p02_digi_ya04v2" text, "ya_p02_digi_ya05v2" text, "ya_p02_test" text, "ya_p03" text, "ya_p03_digi_ya03v2" text, "ya_p03_digi_ya04v2" text, "ya_p03_digi_ya05v2" text, "ya_p04" text)) ct JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj ON sbj.id = ct.subject_id );
Date: 2025-11-30 05:02:24 Duration: 821ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_all"} */ create table "celspac"."dbt_marts_dbt_all"."export_proband_all__dbt_tmp" as ( SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, ct.* FROM ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code || ';' || subject_role_code || ';' || activity_state_code AS state_role FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' ORDER BY 1, 2 $$, $$ VALUES ('celspac_pr_celspac_p01'), ('celspac_pr_elspac_p01'), ('celspac_pr_zajemci_p01'), ('covid_p01'), ('covid_p02'), ('covid_p03'), ('dust_p01_tng_p09'), ('dust_p01_tng_p10'), ('dust_p01_tng_p11'), ('hapiee_p01'), ('hapiee_p02'), ('hba_p01'), ('horpark'), ('horpark_patients'), ('parents_p01'), ('parents_p02'), ('psycap_p01_hba_p01'), ('psycap_p01_ya_p01'), ('psycap_p01_ya_p02'), ('psycap_p01_ya_p03'), ('psycap_p02_new_hba_p01'), ('psycap_p02_new_ya_p03'), ('psycap_p02_old_hba_p01'), ('psycap_p02_old_ya_p01'), ('psycap_p02_old_ya_p02'), ('psycap_p02_old_ya_p03'), ('tng_4mi_p1'), ('tng_4mi_p2'), ('tng_children_p1'), ('tng_children_p1_chibra'), ('tng__monitor'), ('tng_p01'), ('tng_p02'), ('tng_p03'), ('tng_p04'), ('tng_p05'), ('tng_p06'), ('tng_p07'), ('tng_p08'), ('tng_p08_test'), ('tng_p09'), ('tng_p10'), ('tng_p10_test_tp'), ('tng_p11'), ('tng_p11_monitor'), ('tng_p12'), ('tng_p12_monitor'), ('tng_p13'), ('tng_p13_monitor'), ('tng_pilot_8__monitor'), ('tng_pilot_9__form_fix_2019_06'), ('tng_pilot_9__form_fix_mm38p01_v2_v2'), ('tng_pilot_9__form_fix_mm38p02_v2_v2'), ('tng_pilot_9__form_fix_mm38p03_v2_v2'), ('tng_pilot_9__form_fix_mm38p04_v2_v2'), ('tng_pilot_9__monitor'), ('vulde'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test'), ('ya_p02'), ('ya_p02_digi_ya03v2'), ('ya_p02_digi_ya04v2'), ('ya_p02_digi_ya05v2'), ('ya_p02_test'), ('ya_p03'), ('ya_p03_digi_ya03v2'), ('ya_p03_digi_ya04v2'), ('ya_p03_digi_ya05v2'), ('ya_p04') $$ ) AS state_role ("subject_id" int, "celspac_pr_celspac_p01" text, "celspac_pr_elspac_p01" text, "celspac_pr_zajemci_p01" text, "covid_p01" text, "covid_p02" text, "covid_p03" text, "dust_p01_tng_p09" text, "dust_p01_tng_p10" text, "dust_p01_tng_p11" text, "hapiee_p01" text, "hapiee_p02" text, "hba_p01" text, "horpark" text, "horpark_patients" text, "parents_p01" text, "parents_p02" text, "psycap_p01_hba_p01" text, "psycap_p01_ya_p01" text, "psycap_p01_ya_p02" text, "psycap_p01_ya_p03" text, "psycap_p02_new_hba_p01" text, "psycap_p02_new_ya_p03" text, "psycap_p02_old_hba_p01" text, "psycap_p02_old_ya_p01" text, "psycap_p02_old_ya_p02" text, "psycap_p02_old_ya_p03" text, "tng_4mi_p1" text, "tng_4mi_p2" text, "tng_children_p1" text, "tng_children_p1_chibra" text, "tng__monitor" text, "tng_p01" text, "tng_p02" text, "tng_p03" text, "tng_p04" text, "tng_p05" text, "tng_p06" text, "tng_p07" text, "tng_p08" text, "tng_p08_test" text, "tng_p09" text, "tng_p10" text, "tng_p10_test_tp" text, "tng_p11" text, "tng_p11_monitor" text, "tng_p12" text, "tng_p12_monitor" text, "tng_p13" text, "tng_p13_monitor" text, "tng_pilot_8__monitor" text, "tng_pilot_9__form_fix_2019_06" text, "tng_pilot_9__form_fix_mm38p01_v2_v2" text, "tng_pilot_9__form_fix_mm38p02_v2_v2" text, "tng_pilot_9__form_fix_mm38p03_v2_v2" text, "tng_pilot_9__form_fix_mm38p04_v2_v2" text, "tng_pilot_9__monitor" text, "vulde" text, "ya_p01" text, "ya_p01_digi_ya03v2" text, "ya_p01_digi_ya04v2" text, "ya_p01_digi_ya05v2" text, "ya_p01_test" text, "ya_p02" text, "ya_p02_digi_ya03v2" text, "ya_p02_digi_ya04v2" text, "ya_p02_digi_ya05v2" text, "ya_p02_test" text, "ya_p03" text, "ya_p03_digi_ya03v2" text, "ya_p03_digi_ya04v2" text, "ya_p03_digi_ya05v2" text, "ya_p04" text)) ct JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj ON sbj.id = ct.subject_id );
Date: 2025-11-30 05:02:24 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-11-30 05:02:23 - 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-11-30 17:02:18 - 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-11-30 17:11:42 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
4 10.16 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-11-30 17:02:04 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
5 9.99 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-11-30 05:02:09 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
6 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-11-30 17:11:42 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
7 8.54 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-30 09:54:02 ]
8 8.54 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-30 15:12:02 ]
9 8.54 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-30 20:12:02 ]
10 8.53 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-30 05:18:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
11 8.53 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-30 12:54:02 ]
12 8.53 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-30 13: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-11-30 18:48:02 - 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-11-30 21:06:02 ]
15 8.52 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-30 22:36:02 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
16 8.49 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-30 18:12:02 ]
17 8.43 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-30 14:48:02 ]
18 8.41 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-30 06:30:03 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
19 8.40 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-30 10:30:03 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] ]
20 8.40 MiB REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-30 18:30:02 ]
-
Vacuums
Vacuums / Analyzes Distribution
Key values
- 1.12 sec Highest CPU-cost vacuum
Table dbt_stg.stg_celspac_admin__subject_inform_consent
Database celspac - 2025-11-30 17:02:56 Date
- 0 sec Highest CPU-cost analyze
Table
Database celspac - Date
Average Autovacuum Duration
Key values
- 1.12 sec Highest CPU-cost vacuum
Table dbt_stg.stg_celspac_admin__subject_inform_consent
Database celspac - 2025-11-30 17:02:56 Date
Analyzes per table
Key values
- core.mv_subject_form (189) Main table analyzed (database celspac)
- 487 analyzes Total
Table Number of analyzes celspac.core.mv_subject_form 189 celspac.core.mv_subject_event 126 celspac.pg_catalog.pg_class 36 celspac.public.scheduled_command 33 celspac.pg_catalog.pg_type 7 celspac.pg_catalog.pg_index 6 celspac.pg_catalog.pg_depend 5 celspac.pg_catalog.pg_attribute 5 template1.pg_catalog.pg_shdepend 4 celspac.dbt_marts_dbt.export_proband_by_pilot__25 2 celspac.dbt_marts_dbt.export_proband_by_pilot__19 2 celspac.dbt_marts_dbt.export_proband_by_pilot__30 2 celspac.dbt_marts_dbt.export_proband_by_pilot__15 2 celspac.dbt_stg.stg_celspac_admin__subcohort_inform_consent 2 celspac.dbt_marts_dbt.export_proband_by_pilot__22 2 celspac.dbt_marts_dbt.export_proband_by_pilot__9 2 celspac.dbt_stg.stg_celspac_admin__subcohort 2 celspac.dbt_marts_dbt.export_proband_by_pilot__37 2 celspac.dbt_stg.stg_celspac_admin__inform_consent 2 celspac.dbt_marts_dbt.export_proband_by_pilot__26 2 celspac.dbt_marts_dbt.export_proband_by_pilot__5 2 celspac.dbt_marts_dbt.export_proband_by_pilot__36 2 celspac.dbt_stg.inte_unique_subject_extend_array 2 celspac.dbt_marts_dbt.export_proband_by_pilot__29 2 celspac.dbt_stg.inte_subject_extend 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.test_export 2 celspac.dbt_marts_dbt.export_proband_by_pilot__12 2 celspac.dbt_marts_dbt.export_proband_by_pilot__20 2 celspac.dbt_marts_dbt.export_proband_by_pilot__8 2 celspac.dbt_marts_dbt.export_proband_by_pilot__4 2 celspac.dbt_marts_dbt.export_proband_by_pilot__23 2 celspac.dbt_marts_dbt.export_proband_by_pilot__35 2 celspac.dbt_marts_dbt_all.export_proband_all 2 celspac.dbt_stg.stg_celspac_admin__subject 2 celspac.dbt_marts_dbt.export_proband_by_pilot__1 2 celspac.dbt_stg.inte_unique_subject_extend_columns 2 celspac.dbt_marts_dbt.export_proband_by_pilot__11 2 celspac.dbt_stg.inte_unique_subject_extend 2 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 2 celspac.dbt_marts_dbt.export_proband_by_pilot__17 2 celspac.dbt_marts_dbt.export_proband_by_pilot__10 2 celspac.dbt_marts_dbt.export_proband_by_pilot__27 2 celspac.dbt_marts_dbt.export_proband_by_pilot__7 2 celspac.pg_catalog.pg_shdepend 1 celspac.pg_catalog.pg_rewrite 1 postgres.pg_catalog.pg_shdepend 1 celspac.core.cohort 1 Total 487 Vacuums per table
Key values
- core.mv_subject_form (189) Main table vacuumed on database celspac
- 434 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 189 0 887,668 0 43,082 0 0 414,666 227 26,153,989 0 0 celspac.core.mv_subject_event 126 0 25,941 0 530 0 0 4,158 162 1,455,128 0 0 celspac.pg_catalog.pg_class 41 1 7,637 0 366 0 0 1,095 377 982,271 172 420 celspac.pg_catalog.pg_attribute 20 2 34,281 0 1,320 0 0 3,077 1,222 3,381,532 7 101 celspac.pg_catalog.pg_type 12 7 3,137 0 514 0 0 1,408 416 613,960 90 180 celspac.pg_catalog.pg_depend 6 6 9,120 0 468 0 0 1,452 473 933,482 87 624 template1.pg_catalog.pg_shdepend 3 3 1,047 0 442 0 0 932 307 225,455 92 160 celspac.pg_catalog.pg_index 3 3 1,401 0 557 0 0 1,143 318 262,586 3 3 celspac.dbt_marts_dbt_all.export_proband_all 2 0 7,123 0 4,344 0 0 4,338 2 272,594 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__22 2 0 274 0 6 0 0 2 0 376 0 0 celspac.dbt_stg.stg_celspac_admin__subject 2 0 9,050 0 8 0 0 4,443 2 278,789 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__20 2 0 760 0 8 0 0 6 0 552 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__23 2 0 1,808 0 347 0 0 6 0 552 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__19 2 0 6,485 0 2,256 0 0 3,678 3 234,732 0 0 celspac.dbt_stg.inte_unique_subject_extend_array 2 0 11,000 0 3,637 0 0 7,260 2 444,992 0 0 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 2 0 18,065 0 8,151 0 0 10,555 2 639,397 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__17 2 0 740 0 8 0 0 6 0 552 0 0 celspac.dbt_stg.inte_subject_extend 2 0 7,773 0 4,690 0 0 5,202 2 323,570 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__27 2 0 616 0 8 0 0 6 0 552 0 0 celspac.dbt_marts_dbt.test_export 2 0 68 0 36 0 0 34 2 18,598 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__26 2 0 580 0 8 0 0 6 0 552 0 0 celspac.dbt_stg.inte_unique_subject_extend_columns 2 0 2,463 0 1,438 0 0 1,436 2 101,316 0 0 celspac.dbt_stg.inte_unique_subject_extend 2 0 4,102 0 3,860 0 0 3,854 2 244,038 0 0 celspac.pg_catalog.pg_statistic 2 1 4,567 0 1,693 0 0 2,916 1,171 1,189,730 68 220 celspac.pg_toast.pg_toast_2618 1 1 106 0 96 0 0 141 34 33,572 0 0 celspac.pg_toast.pg_toast_2619 1 1 193 0 79 0 0 160 32 65,714 0 0 Total 434 25 1,046,005 52,891 77,952 0 0 471,980 4,758 37,858,581 519 1,708 Vacuum throughput per table
Key values
- core.mv_subject_form (19.95) 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 19.95 celspac.core.mv_subject_event 0 0 0.01 celspac.pg_catalog.pg_class 0 0 0.08 celspac.pg_catalog.pg_attribute 0 0 1.05 celspac.pg_catalog.pg_type 0 0 0.13 celspac.pg_catalog.pg_depend 0 0 0.38 template1.pg_catalog.pg_shdepend 0 0 0.11 celspac.pg_catalog.pg_index 0 0 0.14 celspac.dbt_marts_dbt_all.export_proband_all 0 0 1.03 celspac.dbt_marts_dbt.export_proband_by_pilot__22 0 0 0 celspac.dbt_stg.stg_celspac_admin__subject 0 0 0.1 celspac.dbt_marts_dbt.export_proband_by_pilot__20 0 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__23 0 0 0.08 celspac.dbt_marts_dbt.export_proband_by_pilot__19 0 0 0.57 celspac.dbt_stg.inte_unique_subject_extend_array 0 0 0.97 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 0 0 2.06 celspac.dbt_marts_dbt.export_proband_by_pilot__17 0 0 0 celspac.dbt_stg.inte_subject_extend 0 0 1.14 celspac.dbt_marts_dbt.export_proband_by_pilot__27 0 0 0 celspac.dbt_marts_dbt.test_export 0 0 0 celspac.dbt_marts_dbt.export_proband_by_pilot__26 0 0 0 celspac.dbt_stg.inte_unique_subject_extend_columns 0 0 0.35 celspac.dbt_stg.inte_unique_subject_extend 0 0 0.96 celspac.pg_catalog.pg_statistic 0 0 0.94 celspac.pg_toast.pg_toast_2618 0 0 0.1 celspac.pg_toast.pg_toast_2619 0 0 0.02 Total 0 0 30.17 Tuples removed per table
Key values
- pg_catalog.pg_attribute (26571) Main table with removed tuples on database celspac
- 52315 tuples Total removed
Index Tuples Pages Table Vacuums scans removed remain not yet removable removed remain celspac.pg_catalog.pg_attribute 20 2 26,571 1,317,935 110,097 0 241,120 celspac.pg_catalog.pg_statistic 2 1 15,163 289,697 11,787 0 81,264 celspac.pg_catalog.pg_class 41 1 5,105 62,863 630 0 183,680 celspac.pg_catalog.pg_depend 6 6 3,186 73,698 156 0 4,290 celspac.pg_catalog.pg_type 12 7 1,105 20,218 1,158 0 8,616 template1.pg_catalog.pg_shdepend 3 3 414 3,027 0 0 306 celspac.pg_catalog.pg_index 3 3 406 2,749 25 0 822 celspac.pg_toast.pg_toast_2619 1 1 212 2,057 50 0 860 celspac.pg_toast.pg_toast_2618 1 1 153 503 0 0 581 celspac.dbt_marts_dbt_all.export_proband_all 2 0 0 100,202 0 0 4,352 celspac.dbt_marts_dbt.export_proband_by_pilot__22 2 0 0 2,394 0 0 128 celspac.dbt_stg.stg_celspac_admin__subject 2 0 0 100,340 0 0 4,480 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__23 2 0 0 15,346 0 122 646 celspac.core.mv_subject_form 189 0 0 31,160,619 0 0 423,360 celspac.dbt_marts_dbt.export_proband_by_pilot__19 2 0 0 61,730 0 0 3,712 celspac.dbt_stg.inte_unique_subject_extend_array 2 0 0 100,248 0 0 7,296 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 2 0 0 635,234 0 0 10,624 celspac.dbt_marts_dbt.export_proband_by_pilot__17 2 0 0 2,928 0 100 156 celspac.dbt_stg.inte_subject_extend 2 0 0 104,002 0 0 5,248 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.core.mv_subject_event 126 0 0 284,508 0 252 3,780 celspac.dbt_marts_dbt.export_proband_by_pilot__26 2 0 0 4,372 0 20 236 celspac.dbt_stg.inte_unique_subject_extend_columns 2 0 0 100,248 0 106 1,430 celspac.dbt_stg.inte_unique_subject_extend 2 0 0 100,248 0 0 3,968 Total 434 25 52,315 34,555,258 123,903 752 991,347 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 celspac.dbt_marts_dbt_all.export_proband_all 2 0 0 0 celspac.pg_toast.pg_toast_2618 1 1 153 0 template1.pg_catalog.pg_shdepend 3 3 414 0 celspac.pg_catalog.pg_class 41 1 5105 0 celspac.dbt_marts_dbt.export_proband_by_pilot__22 2 0 0 0 celspac.dbt_stg.stg_celspac_admin__subject 2 0 0 0 celspac.core.mv_subject_form 189 0 0 0 celspac.pg_catalog.pg_type 12 7 1105 0 celspac.dbt_marts_dbt.export_proband_by_pilot__19 2 0 0 0 celspac.dbt_stg.inte_unique_subject_extend_array 2 0 0 0 celspac.dbt_stg.stg_celspac_admin__subject_inform_consent 2 0 0 0 celspac.pg_catalog.pg_depend 6 6 3186 0 celspac.dbt_stg.inte_subject_extend 2 0 0 0 celspac.pg_catalog.pg_attribute 20 2 26571 0 celspac.pg_toast.pg_toast_2619 1 1 212 0 celspac.pg_catalog.pg_index 3 3 406 0 celspac.dbt_stg.inte_unique_subject_extend 2 0 0 0 celspac.pg_catalog.pg_statistic 2 1 15163 0 Total 434 25 52,315 752 Autovacuum Activity
↑ Back to the top of the Autovacuum Activity tableDay Hour VACUUMs ANALYZEs Nov 30 00 0 0 01 0 0 02 0 0 03 0 0 04 0 0 05 46 55 06 19 21 07 20 21 08 19 23 09 21 21 10 20 21 11 19 22 12 20 24 13 18 21 14 22 23 15 19 21 16 21 22 17 51 62 18 19 21 19 19 21 20 21 22 21 20 22 22 19 21 23 21 23 - 1.12 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
- 287,691 Total read queries
- 17,704 Total write queries
Queries by database
Key values
- celspac Main database
- 313,916 Requests
- 23m15s (celspac)
- Main time consuming database
Queries by user
Key values
- tng_migration_user Main user
- 593,475 Requests
User Request type Count Duration postgres Total 7,917 5s708ms select 7,917 5s708ms tng__dwh_celspac_fdw Total 11,752 3s338ms cursor 11,556 3s331ms others 140 6ms tcl 56 0ms tng_migration_user Total 593,475 50m11s cte 2,616 51s91ms ddl 736 39m31s insert 2,107 1s616ms others 21,082 8m36s select 549,052 54s828ms tcl 13,779 10s590ms update 4,103 6s300ms Duration by user
Key values
- 50m11s (tng_migration_user) Main time consuming user
User Request type Count Duration postgres Total 7,917 5s708ms select 7,917 5s708ms tng__dwh_celspac_fdw Total 11,752 3s338ms cursor 11,556 3s331ms others 140 6ms tcl 56 0ms tng_migration_user Total 593,475 50m11s cte 2,616 51s91ms ddl 736 39m31s insert 2,107 1s616ms others 21,082 8m36s select 549,052 54s828ms tcl 13,779 10s590ms update 4,103 6s300ms Queries by host
Key values
- 127.0.0.1 Main host
- 593,499 Requests
- 50m11s (127.0.0.1)
- Main time consuming host
Queries by application
Key values
- [unknown] Main application
- 308,842 Requests
- 18m17s (dbt)
- Main time consuming application
Application Request type Count Duration [unknown] Total 308,842 4m58s insert 1,123 993ms others 11,341 4m19s select 287,591 30s871ms tcl 6,730 4s9ms update 2,057 3s363ms dbt Total 2,076 18m17s cte 1,308 25s644ms ddl 368 17m48s others 12 163ms select 76 800ms tcl 312 1s481ms pg_dumpall Total 24 119ms select 24 119ms postgres_fdw Total 5,876 1s612ms cursor 5,778 1s609ms others 70 3ms tcl 28 0ms Number of cancelled queries
Key values
- 0 per second Cancelled query Peak
- 2025-11-30 02:20:15 Date
Number of cancelled queries (5 minutes period)
NO DATASET
-
Top Queries
Histogram of query times
Key values
- 308,024 0-1ms duration
Slowest individual queries
Rank Duration Query 1 9m19s /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-11-30 17:11:42 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
2 6m6s /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__19"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( -- suject (proband) patrici do kohorty COVID-19: Imunita, Pilot ID: 19 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01'), ('covid_p02'), ('covid_p03') $$ ) AS paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 19 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('covid_p01_ic_venous_blood_proband'), ('covid_p02_ic_venous_blood_proband'), ('covid_p03_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 19 -- Pilot ID );[ Date: 2025-11-30 05:08:31 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
3 34s291ms /* {"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-11-30 17:02:58 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
4 25s998ms /* {"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-11-30 05:02:50 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
5 5s369ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__27"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... HAPIEE Pilot II, Pilot ID: 27 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_dl_hapiee'), ('hapiee_p02_ic_dl_statistics'), ('hapiee_p02_ic_examination'), ('hapiee_p02_ic_health_qs'), ('hapiee_p02_ic_samples_storage') $$ ) AS extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 27 -- Pilot ID );[ Date: 2025-11-30 17:02:33 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
6 4s901ms /* {"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-11-30 17:02:32 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
7 4s774ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__27"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... HAPIEE Pilot II, Pilot ID: 27 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_dl_hapiee'), ('hapiee_p02_ic_dl_statistics'), ('hapiee_p02_ic_examination'), ('hapiee_p02_ic_health_qs'), ('hapiee_p02_ic_samples_storage') $$ ) AS extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 27 -- Pilot ID );[ Date: 2025-11-30 05:02:38 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
8 4s190ms /* {"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-11-30 05:02:36 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
9 3s259ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__17"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot X, Pilot ID: 17 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dust_mother'), ('tng_p10_ic_buccal_swab_child'), ('tng_p10_ic_buccal_swab_mother'), ('tng_p10_ic_cord_blood_mother'), ('tng_p10_ic_drop_blood_child'), ('tng_p10_ic_stool_child'), ('tng_p10_ic_urine_mother'), ('tng_p10_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dl_celpac_studies'), ('dust_p01_tng_p10_ic_survey'), ('tng_p10_ic_follow_up_studies'), ('tng_p10_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 17 -- Pilot ID );[ Date: 2025-11-30 17:02:24 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
10 2s845ms REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-30 23:48:04 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] - Bind query: yes ]
11 2s642ms /* {"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-11-30 17:02:25 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
12 2s301ms /* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__17"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot X, Pilot ID: 17 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dust_mother'), ('tng_p10_ic_buccal_swab_child'), ('tng_p10_ic_buccal_swab_mother'), ('tng_p10_ic_cord_blood_mother'), ('tng_p10_ic_drop_blood_child'), ('tng_p10_ic_stool_child'), ('tng_p10_ic_urine_mother'), ('tng_p10_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dl_celpac_studies'), ('dust_p01_tng_p10_ic_survey'), ('tng_p10_ic_follow_up_studies'), ('tng_p10_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 17 -- Pilot ID );[ Date: 2025-11-30 05:02:30 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
13 2s83ms /* {"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-11-30 17:02:26 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
14 2s67ms REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-30 23:54:04 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] - Bind query: yes ]
15 2s65ms /* {"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-11-30 05:02:33 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
16 2s53ms REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-30 17:12:04 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] - Bind query: yes ]
17 2s41ms REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;[ Date: 2025-11-30 23:42:03 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: [unknown] - Bind query: yes ]
18 1s768ms /* {"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-11-30 17:02:22 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
19 1s756ms /* {"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-11-30 17:02:25 - Database: celspac - User: tng_migration_user - Remote: 127.0.0.1 - Application: dbt ]
20 1s687ms /* {"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-11-30 17:02:21 - 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 15m25s 2 6m6s 9m19s 7m42s create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #1
Day Hour Count Duration Avg duration Nov 30 05 1 6m6s 6m6s 17 1 9m19s 9m19s [ User: tng_migration_user - Total duration: 15m25s - Times executed: 2 ]
[ Application: dbt - Total duration: 15m25s - 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-11-30 17:11:42 Duration: 9m19s 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-11-30 05:08:31 Duration: 6m6s Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
2 3m59s 189 1s132ms 2s845ms 1s268ms refresh materialized view core.mv_subject_form with data;Times Reported Time consuming queries #2
Day Hour Count Duration Avg duration Nov 30 05 10 12s248ms 1s224ms 06 10 12s168ms 1s216ms 07 10 12s340ms 1s234ms 08 10 12s951ms 1s295ms 09 10 12s504ms 1s250ms 10 10 12s434ms 1s243ms 11 10 12s654ms 1s265ms 12 10 12s843ms 1s284ms 13 10 12s741ms 1s274ms 14 10 11s926ms 1s192ms 15 10 12s588ms 1s258ms 16 10 12s364ms 1s236ms 17 9 12s226ms 1s358ms 18 10 12s286ms 1s228ms 19 10 12s322ms 1s232ms 20 10 12s665ms 1s266ms 21 10 12s493ms 1s249ms 22 10 12s371ms 1s237ms 23 10 15s540ms 1s554ms [ User: tng_migration_user - Total duration: 3m59s - Times executed: 189 ]
[ Application: [unknown] - Total duration: 3m59s - Times executed: 189 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-30 23:48:04 Duration: 2s845ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-30 23:54:04 Duration: 2s67ms 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-11-30 17:12:04 Duration: 2s53ms 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 1m 2 25s998ms 34s291ms 30s145ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__23__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "celspac_pr_celspac_p01__role" text, "celspac_pr_elspac_p01__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as role ("subject_id" int, "celspac_pr_celspac_p01__state" text, "celspac_pr_elspac_p01__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as activity ("subject_id" int, "celspac_pr_celspac_p01__activity_state" text, "celspac_pr_elspac_p01__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as created_at ("subject_id" int, "celspac_pr_celspac_p01__created_at" text, "celspac_pr_elspac_p01__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as accepted_at ("subject_id" int, "celspac_pr_celspac_p01__accepted_at" text, "celspac_pr_elspac_p01__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as cancelled_at ("subject_id" int, "celspac_pr_celspac_p01__cancelled_at" text, "celspac_pr_elspac_p01__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as revoked_at ("subject_id" int, "celspac_pr_celspac_p01__revoked_at" text, "celspac_pr_elspac_p01__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?) $$ ) as paused_at ("subject_id" int, "celspac_pr_celspac_p01__paused_at" text, "celspac_pr_elspac_p01__paused_at" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.celspac_pr_celspac_p01__role, psc_role.celspac_pr_elspac_p01__role, psc_state.celspac_pr_celspac_p01__state, psc_state.celspac_pr_elspac_p01__state, psc_activity_state.celspac_pr_celspac_p01__activity_state, psc_activity_state.celspac_pr_elspac_p01__activity_state, psc_created_at.celspac_pr_celspac_p01__created_at, psc_created_at.celspac_pr_elspac_p01__created_at, psc_accepted_at.celspac_pr_celspac_p01__accepted_at, psc_accepted_at.celspac_pr_elspac_p01__accepted_at, psc_cancelled_at.celspac_pr_celspac_p01__cancelled_at, psc_cancelled_at.celspac_pr_elspac_p01__cancelled_at, psc_revoked_at.celspac_pr_celspac_p01__revoked_at, psc_revoked_at.celspac_pr_elspac_p01__revoked_at, psc_paused_at.celspac_pr_celspac_p01__paused_at, psc_paused_at.celspac_pr_elspac_p01__paused_at from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #3
Day Hour Count Duration Avg duration Nov 30 05 1 25s998ms 25s998ms 17 1 34s291ms 34s291ms [ User: tng_migration_user - Total duration: 1m - Times executed: 2 ]
[ Application: dbt - Total duration: 1m - 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-11-30 17:02:58 Duration: 34s291ms 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-11-30 05:02:50 Duration: 25s998ms 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 18s251ms 126 114ms 495ms 144ms refresh materialized view core.mv_subject_event with data;Times Reported Time consuming queries #4
Day Hour Count Duration Avg duration Nov 30 06 7 1s113ms 159ms 07 7 1s317ms 188ms 08 7 917ms 131ms 09 7 979ms 139ms 10 7 881ms 125ms 11 7 1s162ms 166ms 12 7 966ms 138ms 13 7 959ms 137ms 14 7 944ms 134ms 15 7 979ms 139ms 16 7 962ms 137ms 17 7 1s 142ms 18 7 977ms 139ms 19 7 920ms 131ms 20 7 980ms 140ms 21 7 1s263ms 180ms 22 7 931ms 133ms 23 7 992ms 141ms [ User: tng_migration_user - Total duration: 18s251ms - Times executed: 126 ]
[ Application: [unknown] - Total duration: 18s251ms - Times executed: 126 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-30 07:14:02 Duration: 495ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-30 21:05:02 Duration: 477ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-30 11:50:01 Duration: 367ms 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 13s548ms 160 33ms 252ms 84ms 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 #5
Day Hour Count Duration Avg duration Nov 30 05 80 6s723ms 84ms 17 80 6s824ms 85ms [ User: tng_migration_user - Total duration: 13s548ms - Times executed: 160 ]
[ Application: dbt - Total duration: 13s548ms - 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-11-30 05:02:24 Duration: 252ms 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-11-30 17:02:22 Duration: 244ms 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-11-30 17:02:22 Duration: 235ms 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 12s255ms 22,113 0ms 3ms 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 #6
Day Hour Count Duration Avg duration Nov 30 05 1,170 636ms 0ms 06 1,170 642ms 0ms 07 1,170 658ms 0ms 08 1,170 668ms 0ms 09 1,170 654ms 0ms 10 1,170 646ms 0ms 11 1,170 670ms 0ms 12 1,170 680ms 0ms 13 1,170 651ms 0ms 14 1,170 627ms 0ms 15 1,170 644ms 0ms 16 1,170 655ms 0ms 17 1,053 587ms 0ms 18 1,170 648ms 0ms 19 1,170 634ms 0ms 20 1,170 644ms 0ms 21 1,170 627ms 0ms 22 1,170 651ms 0ms 23 1,170 623ms 0ms [ User: tng_migration_user - Total duration: 12s255ms - Times executed: 22113 ]
[ Application: [unknown] - Total duration: 12s255ms - Times executed: 22113 ]
-
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-16 12:48:01' AND m0_.use_alternative <> 't';
Date: 2025-11-30 12:48: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 ('80') AND m0_.form_id IS NULL AND m0_.result_date <= '2020-12-16 11:54:02' AND m0_.use_alternative <> 't';
Date: 2025-11-30 11:54: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 ('175') AND m0_.form_id IS NULL AND m0_.result_date <= '2022-11-13 12:48:01' AND m0_.use_alternative <> 't';
Date: 2025-11-30 12:48: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
7 11s848ms 156 37ms 272ms 75ms with values as ( select label as value from "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" where pilot_id = ? group by label order by ? ) select value from values;Times Reported Time consuming queries #7
Day Hour Count Duration Avg duration Nov 30 05 78 5s536ms 70ms 17 78 6s311ms 80ms [ User: tng_migration_user - Total duration: 11s848ms - Times executed: 156 ]
[ Application: dbt - Total duration: 11s848ms - 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-11-30 17:02:23 Duration: 272ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__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-11-30 17:02:20 Duration: 146ms 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-11-30 17:02:23 Duration: 130ms 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 10s144ms 2 4s774ms 5s369ms 5s72ms 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 #8
Day Hour Count Duration Avg duration Nov 30 05 1 4s774ms 4s774ms 17 1 5s369ms 5s369ms [ User: tng_migration_user - Total duration: 10s144ms - Times executed: 2 ]
[ Application: dbt - Total duration: 10s144ms - 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-11-30 17:02:33 Duration: 5s369ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__27"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... HAPIEE Pilot II, Pilot ID: 27 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_dl_hapiee'), ('hapiee_p02_ic_dl_statistics'), ('hapiee_p02_ic_examination'), ('hapiee_p02_ic_health_qs'), ('hapiee_p02_ic_samples_storage') $$ ) AS extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 27 -- Pilot ID );
Date: 2025-11-30 05:02:38 Duration: 4s774ms 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 9s92ms 2 4s190ms 4s901ms 4s546ms 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 #9
Day Hour Count Duration Avg duration Nov 30 05 1 4s190ms 4s190ms 17 1 4s901ms 4s901ms [ User: tng_migration_user - Total duration: 9s92ms - Times executed: 2 ]
[ Application: dbt - Total duration: 9s92ms - 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-11-30 17:02:32 Duration: 4s901ms 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-11-30 05:02:36 Duration: 4s190ms 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 5s560ms 2 2s301ms 3s259ms 2s780ms 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 #10
Day Hour Count Duration Avg duration Nov 30 05 1 2s301ms 2s301ms 17 1 3s259ms 3s259ms [ User: tng_migration_user - Total duration: 5s560ms - Times executed: 2 ]
[ Application: dbt - Total duration: 5s560ms - 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-11-30 17:02:24 Duration: 3s259ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__17"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot X, Pilot ID: 17 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dust_mother'), ('tng_p10_ic_buccal_swab_child'), ('tng_p10_ic_buccal_swab_mother'), ('tng_p10_ic_cord_blood_mother'), ('tng_p10_ic_drop_blood_child'), ('tng_p10_ic_stool_child'), ('tng_p10_ic_urine_mother'), ('tng_p10_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dl_celpac_studies'), ('dust_p01_tng_p10_ic_survey'), ('tng_p10_ic_follow_up_studies'), ('tng_p10_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 17 -- Pilot ID );
Date: 2025-11-30 05:02:30 Duration: 2s301ms 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 5s406ms 3,032 0ms 401ms 1ms commit;Times Reported Time consuming queries #11
Day Hour Count Duration Avg duration Nov 30 00 103 237ms 2ms 05 650 1s364ms 2ms 06 343 346ms 1ms 07 118 101ms 0ms 08 106 91ms 0ms 09 107 117ms 1ms 10 107 149ms 1ms 11 114 245ms 2ms 12 108 158ms 1ms 13 120 179ms 1ms 14 119 200ms 1ms 15 137 192ms 1ms 16 104 159ms 1ms 17 142 1s152ms 8ms 18 113 128ms 1ms 19 108 95ms 0ms 20 104 105ms 1ms 21 106 146ms 1ms 22 119 109ms 0ms 23 104 125ms 1ms [ User: tng_migration_user - Total duration: 5s406ms - Times executed: 3032 ]
[ Application: [unknown] - Total duration: 3s944ms - Times executed: 2938 ]
[ Application: dbt - Total duration: 1s462ms - Times executed: 94 ]
-
COMMIT;
Date: 2025-11-30 17:02:33 Duration: 401ms 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-11-30 05:02:29 Duration: 186ms 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-11-30 17:02:58 Duration: 145ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
12 4s231ms 2 1s589ms 2s642ms 2s115ms 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 #12
Day Hour Count Duration Avg duration Nov 30 05 1 1s589ms 1s589ms 17 1 2s642ms 2s642ms [ User: tng_migration_user - Total duration: 4s231ms - Times executed: 2 ]
[ Application: dbt - Total duration: 4s231ms - 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-11-30 17:02:25 Duration: 2s642ms 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-11-30 05:02:30 Duration: 1s589ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
13 4s148ms 2 2s65ms 2s83ms 2s74ms 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 #13
Day Hour Count Duration Avg duration Nov 30 05 1 2s65ms 2s65ms 17 1 2s83ms 2s83ms [ User: tng_migration_user - Total duration: 4s148ms - Times executed: 2 ]
[ Application: dbt - Total duration: 4s148ms - 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-11-30 17:02:26 Duration: 2s83ms 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-11-30 05:02:33 Duration: 2s65ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
14 2s819ms 2 1s50ms 1s768ms 1s409ms 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 #14
Day Hour Count Duration Avg duration Nov 30 05 1 1s50ms 1s50ms 17 1 1s768ms 1s768ms [ User: tng_migration_user - Total duration: 2s819ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s819ms - 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-11-30 17:02:22 Duration: 1s768ms 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-11-30 05:02:28 Duration: 1s50ms 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 2s718ms 2 1s31ms 1s687ms 1s359ms 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 #15
Day Hour Count Duration Avg duration Nov 30 05 1 1s31ms 1s31ms 17 1 1s687ms 1s687ms [ User: tng_migration_user - Total duration: 2s718ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s718ms - 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-11-30 17:02:21 Duration: 1s687ms 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-11-30 05:02:27 Duration: 1s31ms 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 2s649ms 2 893ms 1s756ms 1s324ms 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 #16
Day Hour Count Duration Avg duration Nov 30 05 1 893ms 893ms 17 1 1s756ms 1s756ms [ User: tng_migration_user - Total duration: 2s649ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s649ms - 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-11-30 17:02:25 Duration: 1s756ms 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-11-30 05:02:31 Duration: 893ms 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 2s505ms 2 890ms 1s615ms 1s252ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__12__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_p01__role" text, "psycap_p02_old_ya_p01__role" text, "ya_p01__role" text, "ya_p01_digi_ya03v2__role" text, "ya_p01_digi_ya04v2__role" text, "ya_p01_digi_ya05v2__role" text, "ya_p01_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_p01__state" text, "psycap_p02_old_ya_p01__state" text, "ya_p01__state" text, "ya_p01_digi_ya03v2__state" text, "ya_p01_digi_ya04v2__state" text, "ya_p01_digi_ya05v2__state" text, "ya_p01_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_p01__activity_state" text, "psycap_p02_old_ya_p01__activity_state" text, "ya_p01__activity_state" text, "ya_p01_digi_ya03v2__activity_state" text, "ya_p01_digi_ya04v2__activity_state" text, "ya_p01_digi_ya05v2__activity_state" text, "ya_p01_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_p01__created_at" text, "psycap_p02_old_ya_p01__created_at" text, "ya_p01__created_at" text, "ya_p01_digi_ya03v2__created_at" text, "ya_p01_digi_ya04v2__created_at" text, "ya_p01_digi_ya05v2__created_at" text, "ya_p01_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_p01__accepted_at" text, "psycap_p02_old_ya_p01__accepted_at" text, "ya_p01__accepted_at" text, "ya_p01_digi_ya03v2__accepted_at" text, "ya_p01_digi_ya04v2__accepted_at" text, "ya_p01_digi_ya05v2__accepted_at" text, "ya_p01_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_p01__cancelled_at" text, "psycap_p02_old_ya_p01__cancelled_at" text, "ya_p01__cancelled_at" text, "ya_p01_digi_ya03v2__cancelled_at" text, "ya_p01_digi_ya04v2__cancelled_at" text, "ya_p01_digi_ya05v2__cancelled_at" text, "ya_p01_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_p01__revoked_at" text, "psycap_p02_old_ya_p01__revoked_at" text, "ya_p01__revoked_at" text, "ya_p01_digi_ya03v2__revoked_at" text, "ya_p01_digi_ya04v2__revoked_at" text, "ya_p01_digi_ya05v2__revoked_at" text, "ya_p01_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_p01__paused_at" text, "psycap_p02_old_ya_p01__paused_at" text, "ya_p01__paused_at" text, "ya_p01_digi_ya03v2__paused_at" text, "ya_p01_digi_ya04v2__paused_at" text, "ya_p01_digi_ya05v2__paused_at" text, "ya_p01_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_p01_ic_buccal_swab_proband" text, "ya_p01_ic_urine_proband" text, "ya_p01_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_p01_ic_anam_qs" text, "ya_p01_ic_aneurysm" text, "ya_p01_ic_anthropometry" text, "ya_p01_ic_arch_foot" text, "ya_p01_ic_basic_qs" text, "ya_p01_ic_blood_pressure" text, "ya_p01_ic_braces_piercing_iud" text, "ya_p01_ic_cognition_test" text, "ya_p01_ic_da_health_registry" text, "ya_p01_ic_dexa" text, "ya_p01_ic_enviro_qs" text, "ya_p01_ic_follow_up_studies" text, "ya_p01_ic_fracture_lower_body_last_3m" text, "ya_p01_ic_fracture_upper_body_last_3m" text, "ya_p01_ic_hand_grip" text, "ya_p01_ic_hearing_vision_impairment" text, "ya_p01_ic_heart_disease" text, "ya_p01_ic_hemoptysis_ns" text, "ya_p01_ic_hernia" text, "ya_p01_ic_hyperthyroidism" text, "ya_p01_ic_inability_hold_pencil" text, "ya_p01_ic_inability_stand_both_legs" text, "ya_p01_ic_inability_talk_cze" text, "ya_p01_ic_inability_walk" text, "ya_p01_ic_inbody" text, "ya_p01_ic_infectious_resp_diseases" text, "ya_p01_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p01_ic_knee_stability" text, "ya_p01_ic_med_find" text, "ya_p01_ic_nutri_qs" text, "ya_p01_ic_over_weight_200_height_195" text, "ya_p01_ic_pacemaker_defibrillator" text, "ya_p01_ic_pneumothorax" text, "ya_p01_ic_pregnancy" text, "ya_p01_ic_recent_eye_abdominal_chest_surgery" text, "ya_p01_ic_recent_myocardial_infarction" text, "ya_p01_ic_spirometry" text, "ya_p01_ic_surgical_metal_body" text, "ya_p01_ic_unstable_angina_pectoris" text, "ya_p01_ic_ya_dl_elspac" 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_p01__role, psc_role.psycap_p02_old_ya_p01__role, psc_role.ya_p01__role, psc_role.ya_p01_digi_ya03v2__role, psc_role.ya_p01_digi_ya04v2__role, psc_role.ya_p01_digi_ya05v2__role, psc_role.ya_p01_test__role, psc_state.psycap_p01_ya_p01__state, psc_state.psycap_p02_old_ya_p01__state, psc_state.ya_p01__state, psc_state.ya_p01_digi_ya03v2__state, psc_state.ya_p01_digi_ya04v2__state, psc_state.ya_p01_digi_ya05v2__state, psc_state.ya_p01_test__state, psc_activity_state.psycap_p01_ya_p01__activity_state, psc_activity_state.psycap_p02_old_ya_p01__activity_state, psc_activity_state.ya_p01__activity_state, psc_activity_state.ya_p01_digi_ya03v2__activity_state, psc_activity_state.ya_p01_digi_ya04v2__activity_state, psc_activity_state.ya_p01_digi_ya05v2__activity_state, psc_activity_state.ya_p01_test__activity_state, psc_created_at.psycap_p01_ya_p01__created_at, psc_created_at.psycap_p02_old_ya_p01__created_at, psc_created_at.ya_p01__created_at, psc_created_at.ya_p01_digi_ya03v2__created_at, psc_created_at.ya_p01_digi_ya04v2__created_at, psc_created_at.ya_p01_digi_ya05v2__created_at, psc_created_at.ya_p01_test__created_at, psc_accepted_at.psycap_p01_ya_p01__accepted_at, psc_accepted_at.psycap_p02_old_ya_p01__accepted_at, psc_accepted_at.ya_p01__accepted_at, psc_accepted_at.ya_p01_digi_ya03v2__accepted_at, psc_accepted_at.ya_p01_digi_ya04v2__accepted_at, psc_accepted_at.ya_p01_digi_ya05v2__accepted_at, psc_accepted_at.ya_p01_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p01__cancelled_at, psc_cancelled_at.ya_p01__cancelled_at, psc_cancelled_at.ya_p01_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p01_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p01__revoked_at, psc_revoked_at.psycap_p02_old_ya_p01__revoked_at, psc_revoked_at.ya_p01__revoked_at, psc_revoked_at.ya_p01_digi_ya03v2__revoked_at, psc_revoked_at.ya_p01_digi_ya04v2__revoked_at, psc_revoked_at.ya_p01_digi_ya05v2__revoked_at, psc_revoked_at.ya_p01_test__revoked_at, psc_paused_at.psycap_p01_ya_p01__paused_at, psc_paused_at.psycap_p02_old_ya_p01__paused_at, psc_paused_at.ya_p01__paused_at, psc_paused_at.ya_p01_digi_ya03v2__paused_at, psc_paused_at.ya_p01_digi_ya04v2__paused_at, psc_paused_at.ya_p01_digi_ya05v2__paused_at, psc_paused_at.ya_p01_test__paused_at, ya_p01_ic_buccal_swab_proband, ya_p01_ic_urine_proband, ya_p01_ic_venous_blood_proband, ya_p01_ic_anam_qs, ya_p01_ic_aneurysm, ya_p01_ic_anthropometry, ya_p01_ic_arch_foot, ya_p01_ic_basic_qs, ya_p01_ic_blood_pressure, ya_p01_ic_braces_piercing_iud, ya_p01_ic_cognition_test, ya_p01_ic_da_health_registry, ya_p01_ic_dexa, ya_p01_ic_enviro_qs, ya_p01_ic_follow_up_studies, ya_p01_ic_fracture_lower_body_last_3m, ya_p01_ic_fracture_upper_body_last_3m, ya_p01_ic_hand_grip, ya_p01_ic_hearing_vision_impairment, ya_p01_ic_heart_disease, ya_p01_ic_hemoptysis_ns, ya_p01_ic_hernia, ya_p01_ic_hyperthyroidism, ya_p01_ic_inability_hold_pencil, ya_p01_ic_inability_stand_both_legs, ya_p01_ic_inability_talk_cze, ya_p01_ic_inability_walk, ya_p01_ic_inbody, ya_p01_ic_infectious_resp_diseases, ya_p01_ic_iodine_barium_radioisotopes_last_7d, ya_p01_ic_knee_stability, ya_p01_ic_med_find, ya_p01_ic_nutri_qs, ya_p01_ic_over_weight_200_height_195, ya_p01_ic_pacemaker_defibrillator, ya_p01_ic_pneumothorax, ya_p01_ic_pregnancy, ya_p01_ic_recent_eye_abdominal_chest_surgery, ya_p01_ic_recent_myocardial_infarction, ya_p01_ic_spirometry, ya_p01_ic_surgical_metal_body, ya_p01_ic_unstable_angina_pectoris, ya_p01_ic_ya_dl_elspac from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #17
Day Hour Count Duration Avg duration Nov 30 05 1 890ms 890ms 17 1 1s615ms 1s615ms [ User: tng_migration_user - Total duration: 2s505ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s505ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__12"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__12__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA Pilot I, Pilot ID: 12 -- 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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p01__role" text, "psycap_p02_old_ya_p01__role" text, "ya_p01__role" text, "ya_p01_digi_ya03v2__role" text, "ya_p01_digi_ya04v2__role" text, "ya_p01_digi_ya05v2__role" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p01__state" text, "psycap_p02_old_ya_p01__state" text, "ya_p01__state" text, "ya_p01_digi_ya03v2__state" text, "ya_p01_digi_ya04v2__state" text, "ya_p01_digi_ya05v2__state" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p01__activity_state" text, "psycap_p02_old_ya_p01__activity_state" text, "ya_p01__activity_state" text, "ya_p01_digi_ya03v2__activity_state" text, "ya_p01_digi_ya04v2__activity_state" text, "ya_p01_digi_ya05v2__activity_state" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p01__created_at" text, "psycap_p02_old_ya_p01__created_at" text, "ya_p01__created_at" text, "ya_p01_digi_ya03v2__created_at" text, "ya_p01_digi_ya04v2__created_at" text, "ya_p01_digi_ya05v2__created_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p01__accepted_at" text, "psycap_p02_old_ya_p01__accepted_at" text, "ya_p01__accepted_at" text, "ya_p01_digi_ya03v2__accepted_at" text, "ya_p01_digi_ya04v2__accepted_at" text, "ya_p01_digi_ya05v2__accepted_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p01__cancelled_at" text, "psycap_p02_old_ya_p01__cancelled_at" text, "ya_p01__cancelled_at" text, "ya_p01_digi_ya03v2__cancelled_at" text, "ya_p01_digi_ya04v2__cancelled_at" text, "ya_p01_digi_ya05v2__cancelled_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p01__revoked_at" text, "psycap_p02_old_ya_p01__revoked_at" text, "ya_p01__revoked_at" text, "ya_p01_digi_ya03v2__revoked_at" text, "ya_p01_digi_ya04v2__revoked_at" text, "ya_p01_digi_ya05v2__revoked_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p01__paused_at" text, "psycap_p02_old_ya_p01__paused_at" text, "ya_p01__paused_at" text, "ya_p01_digi_ya03v2__paused_at" text, "ya_p01_digi_ya04v2__paused_at" text, "ya_p01_digi_ya05v2__paused_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p01_ic_buccal_swab_proband'), ('ya_p01_ic_urine_proband'), ('ya_p01_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p01_ic_buccal_swab_proband" text, "ya_p01_ic_urine_proband" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p01_ic_anam_qs'), ('ya_p01_ic_aneurysm'), ('ya_p01_ic_anthropometry'), ('ya_p01_ic_arch_foot'), ('ya_p01_ic_basic_qs'), ('ya_p01_ic_blood_pressure'), ('ya_p01_ic_braces_piercing_iud'), ('ya_p01_ic_cognition_test'), ('ya_p01_ic_da_health_registry'), ('ya_p01_ic_dexa'), ('ya_p01_ic_enviro_qs'), ('ya_p01_ic_follow_up_studies'), ('ya_p01_ic_fracture_lower_body_last_3m'), ('ya_p01_ic_fracture_upper_body_last_3m'), ('ya_p01_ic_hand_grip'), ('ya_p01_ic_hearing_vision_impairment'), ('ya_p01_ic_heart_disease'), ('ya_p01_ic_hemoptysis_ns'), ('ya_p01_ic_hernia'), ('ya_p01_ic_hyperthyroidism'), ('ya_p01_ic_inability_hold_pencil'), ('ya_p01_ic_inability_stand_both_legs'), ('ya_p01_ic_inability_talk_cze'), ('ya_p01_ic_inability_walk'), ('ya_p01_ic_inbody'), ('ya_p01_ic_infectious_resp_diseases'), ('ya_p01_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p01_ic_knee_stability'), ('ya_p01_ic_med_find'), ('ya_p01_ic_nutri_qs'), ('ya_p01_ic_over_weight_200_height_195'), ('ya_p01_ic_pacemaker_defibrillator'), ('ya_p01_ic_pneumothorax'), ('ya_p01_ic_pregnancy'), ('ya_p01_ic_recent_eye_abdominal_chest_surgery'), ('ya_p01_ic_recent_myocardial_infarction'), ('ya_p01_ic_spirometry'), ('ya_p01_ic_surgical_metal_body'), ('ya_p01_ic_unstable_angina_pectoris'), ('ya_p01_ic_ya_dl_elspac') $$ ) AS extra_state ("subject_id" int, "ya_p01_ic_anam_qs" text, "ya_p01_ic_aneurysm" text, "ya_p01_ic_anthropometry" text, "ya_p01_ic_arch_foot" text, "ya_p01_ic_basic_qs" text, "ya_p01_ic_blood_pressure" text, "ya_p01_ic_braces_piercing_iud" text, "ya_p01_ic_cognition_test" text, "ya_p01_ic_da_health_registry" text, "ya_p01_ic_dexa" text, "ya_p01_ic_enviro_qs" text, "ya_p01_ic_follow_up_studies" text, "ya_p01_ic_fracture_lower_body_last_3m" text, "ya_p01_ic_fracture_upper_body_last_3m" text, "ya_p01_ic_hand_grip" text, "ya_p01_ic_hearing_vision_impairment" text, "ya_p01_ic_heart_disease" text, "ya_p01_ic_hemoptysis_ns" text, "ya_p01_ic_hernia" text, "ya_p01_ic_hyperthyroidism" text, "ya_p01_ic_inability_hold_pencil" text, "ya_p01_ic_inability_stand_both_legs" text, "ya_p01_ic_inability_talk_cze" text, "ya_p01_ic_inability_walk" text, "ya_p01_ic_inbody" text, "ya_p01_ic_infectious_resp_diseases" text, "ya_p01_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p01_ic_knee_stability" text, "ya_p01_ic_med_find" text, "ya_p01_ic_nutri_qs" text, "ya_p01_ic_over_weight_200_height_195" text, "ya_p01_ic_pacemaker_defibrillator" text, "ya_p01_ic_pneumothorax" text, "ya_p01_ic_pregnancy" text, "ya_p01_ic_recent_eye_abdominal_chest_surgery" text, "ya_p01_ic_recent_myocardial_infarction" text, "ya_p01_ic_spirometry" text, "ya_p01_ic_surgical_metal_body" text, "ya_p01_ic_unstable_angina_pectoris" text, "ya_p01_ic_ya_dl_elspac" 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_p01__role, psc_role.psycap_p02_old_ya_p01__role, psc_role.ya_p01__role, psc_role.ya_p01_digi_ya03v2__role, psc_role.ya_p01_digi_ya04v2__role, psc_role.ya_p01_digi_ya05v2__role, psc_role.ya_p01_test__role, psc_state.psycap_p01_ya_p01__state, psc_state.psycap_p02_old_ya_p01__state, psc_state.ya_p01__state, psc_state.ya_p01_digi_ya03v2__state, psc_state.ya_p01_digi_ya04v2__state, psc_state.ya_p01_digi_ya05v2__state, psc_state.ya_p01_test__state, psc_activity_state.psycap_p01_ya_p01__activity_state, psc_activity_state.psycap_p02_old_ya_p01__activity_state, psc_activity_state.ya_p01__activity_state, psc_activity_state.ya_p01_digi_ya03v2__activity_state, psc_activity_state.ya_p01_digi_ya04v2__activity_state, psc_activity_state.ya_p01_digi_ya05v2__activity_state, psc_activity_state.ya_p01_test__activity_state, psc_created_at.psycap_p01_ya_p01__created_at, psc_created_at.psycap_p02_old_ya_p01__created_at, psc_created_at.ya_p01__created_at, psc_created_at.ya_p01_digi_ya03v2__created_at, psc_created_at.ya_p01_digi_ya04v2__created_at, psc_created_at.ya_p01_digi_ya05v2__created_at, psc_created_at.ya_p01_test__created_at, psc_accepted_at.psycap_p01_ya_p01__accepted_at, psc_accepted_at.psycap_p02_old_ya_p01__accepted_at, psc_accepted_at.ya_p01__accepted_at, psc_accepted_at.ya_p01_digi_ya03v2__accepted_at, psc_accepted_at.ya_p01_digi_ya04v2__accepted_at, psc_accepted_at.ya_p01_digi_ya05v2__accepted_at, psc_accepted_at.ya_p01_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p01__cancelled_at, psc_cancelled_at.ya_p01__cancelled_at, psc_cancelled_at.ya_p01_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p01_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p01__revoked_at, psc_revoked_at.psycap_p02_old_ya_p01__revoked_at, psc_revoked_at.ya_p01__revoked_at, psc_revoked_at.ya_p01_digi_ya03v2__revoked_at, psc_revoked_at.ya_p01_digi_ya04v2__revoked_at, psc_revoked_at.ya_p01_digi_ya05v2__revoked_at, psc_revoked_at.ya_p01_test__revoked_at, psc_paused_at.psycap_p01_ya_p01__paused_at, psc_paused_at.psycap_p02_old_ya_p01__paused_at, psc_paused_at.ya_p01__paused_at, psc_paused_at.ya_p01_digi_ya03v2__paused_at, psc_paused_at.ya_p01_digi_ya04v2__paused_at, psc_paused_at.ya_p01_digi_ya05v2__paused_at, psc_paused_at.ya_p01_test__paused_at, ya_p01_ic_buccal_swab_proband, ya_p01_ic_urine_proband, ya_p01_ic_venous_blood_proband, ya_p01_ic_anam_qs, ya_p01_ic_aneurysm, ya_p01_ic_anthropometry, ya_p01_ic_arch_foot, ya_p01_ic_basic_qs, ya_p01_ic_blood_pressure, ya_p01_ic_braces_piercing_iud, ya_p01_ic_cognition_test, ya_p01_ic_da_health_registry, ya_p01_ic_dexa, ya_p01_ic_enviro_qs, ya_p01_ic_follow_up_studies, ya_p01_ic_fracture_lower_body_last_3m, ya_p01_ic_fracture_upper_body_last_3m, ya_p01_ic_hand_grip, ya_p01_ic_hearing_vision_impairment, ya_p01_ic_heart_disease, ya_p01_ic_hemoptysis_ns, ya_p01_ic_hernia, ya_p01_ic_hyperthyroidism, ya_p01_ic_inability_hold_pencil, ya_p01_ic_inability_stand_both_legs, ya_p01_ic_inability_talk_cze, ya_p01_ic_inability_walk, ya_p01_ic_inbody, ya_p01_ic_infectious_resp_diseases, ya_p01_ic_iodine_barium_radioisotopes_last_7d, ya_p01_ic_knee_stability, ya_p01_ic_med_find, ya_p01_ic_nutri_qs, ya_p01_ic_over_weight_200_height_195, ya_p01_ic_pacemaker_defibrillator, ya_p01_ic_pneumothorax, ya_p01_ic_pregnancy, ya_p01_ic_recent_eye_abdominal_chest_surgery, ya_p01_ic_recent_myocardial_infarction, ya_p01_ic_spirometry, ya_p01_ic_surgical_metal_body, ya_p01_ic_unstable_angina_pectoris, ya_p01_ic_ya_dl_elspac 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 = 12 -- Pilot ID );
Date: 2025-11-30 17:02:22 Duration: 1s615ms 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__12"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__12__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA Pilot I, Pilot ID: 12 -- 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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p01__role" text, "psycap_p02_old_ya_p01__role" text, "ya_p01__role" text, "ya_p01_digi_ya03v2__role" text, "ya_p01_digi_ya04v2__role" text, "ya_p01_digi_ya05v2__role" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p01__state" text, "psycap_p02_old_ya_p01__state" text, "ya_p01__state" text, "ya_p01_digi_ya03v2__state" text, "ya_p01_digi_ya04v2__state" text, "ya_p01_digi_ya05v2__state" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p01__activity_state" text, "psycap_p02_old_ya_p01__activity_state" text, "ya_p01__activity_state" text, "ya_p01_digi_ya03v2__activity_state" text, "ya_p01_digi_ya04v2__activity_state" text, "ya_p01_digi_ya05v2__activity_state" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p01__created_at" text, "psycap_p02_old_ya_p01__created_at" text, "ya_p01__created_at" text, "ya_p01_digi_ya03v2__created_at" text, "ya_p01_digi_ya04v2__created_at" text, "ya_p01_digi_ya05v2__created_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p01__accepted_at" text, "psycap_p02_old_ya_p01__accepted_at" text, "ya_p01__accepted_at" text, "ya_p01_digi_ya03v2__accepted_at" text, "ya_p01_digi_ya04v2__accepted_at" text, "ya_p01_digi_ya05v2__accepted_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p01__cancelled_at" text, "psycap_p02_old_ya_p01__cancelled_at" text, "ya_p01__cancelled_at" text, "ya_p01_digi_ya03v2__cancelled_at" text, "ya_p01_digi_ya04v2__cancelled_at" text, "ya_p01_digi_ya05v2__cancelled_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p01__revoked_at" text, "psycap_p02_old_ya_p01__revoked_at" text, "ya_p01__revoked_at" text, "ya_p01_digi_ya03v2__revoked_at" text, "ya_p01_digi_ya04v2__revoked_at" text, "ya_p01_digi_ya05v2__revoked_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p01__paused_at" text, "psycap_p02_old_ya_p01__paused_at" text, "ya_p01__paused_at" text, "ya_p01_digi_ya03v2__paused_at" text, "ya_p01_digi_ya04v2__paused_at" text, "ya_p01_digi_ya05v2__paused_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p01_ic_buccal_swab_proband'), ('ya_p01_ic_urine_proband'), ('ya_p01_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p01_ic_buccal_swab_proband" text, "ya_p01_ic_urine_proband" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p01_ic_anam_qs'), ('ya_p01_ic_aneurysm'), ('ya_p01_ic_anthropometry'), ('ya_p01_ic_arch_foot'), ('ya_p01_ic_basic_qs'), ('ya_p01_ic_blood_pressure'), ('ya_p01_ic_braces_piercing_iud'), ('ya_p01_ic_cognition_test'), ('ya_p01_ic_da_health_registry'), ('ya_p01_ic_dexa'), ('ya_p01_ic_enviro_qs'), ('ya_p01_ic_follow_up_studies'), ('ya_p01_ic_fracture_lower_body_last_3m'), ('ya_p01_ic_fracture_upper_body_last_3m'), ('ya_p01_ic_hand_grip'), ('ya_p01_ic_hearing_vision_impairment'), ('ya_p01_ic_heart_disease'), ('ya_p01_ic_hemoptysis_ns'), ('ya_p01_ic_hernia'), ('ya_p01_ic_hyperthyroidism'), ('ya_p01_ic_inability_hold_pencil'), ('ya_p01_ic_inability_stand_both_legs'), ('ya_p01_ic_inability_talk_cze'), ('ya_p01_ic_inability_walk'), ('ya_p01_ic_inbody'), ('ya_p01_ic_infectious_resp_diseases'), ('ya_p01_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p01_ic_knee_stability'), ('ya_p01_ic_med_find'), ('ya_p01_ic_nutri_qs'), ('ya_p01_ic_over_weight_200_height_195'), ('ya_p01_ic_pacemaker_defibrillator'), ('ya_p01_ic_pneumothorax'), ('ya_p01_ic_pregnancy'), ('ya_p01_ic_recent_eye_abdominal_chest_surgery'), ('ya_p01_ic_recent_myocardial_infarction'), ('ya_p01_ic_spirometry'), ('ya_p01_ic_surgical_metal_body'), ('ya_p01_ic_unstable_angina_pectoris'), ('ya_p01_ic_ya_dl_elspac') $$ ) AS extra_state ("subject_id" int, "ya_p01_ic_anam_qs" text, "ya_p01_ic_aneurysm" text, "ya_p01_ic_anthropometry" text, "ya_p01_ic_arch_foot" text, "ya_p01_ic_basic_qs" text, "ya_p01_ic_blood_pressure" text, "ya_p01_ic_braces_piercing_iud" text, "ya_p01_ic_cognition_test" text, "ya_p01_ic_da_health_registry" text, "ya_p01_ic_dexa" text, "ya_p01_ic_enviro_qs" text, "ya_p01_ic_follow_up_studies" text, "ya_p01_ic_fracture_lower_body_last_3m" text, "ya_p01_ic_fracture_upper_body_last_3m" text, "ya_p01_ic_hand_grip" text, "ya_p01_ic_hearing_vision_impairment" text, "ya_p01_ic_heart_disease" text, "ya_p01_ic_hemoptysis_ns" text, "ya_p01_ic_hernia" text, "ya_p01_ic_hyperthyroidism" text, "ya_p01_ic_inability_hold_pencil" text, "ya_p01_ic_inability_stand_both_legs" text, "ya_p01_ic_inability_talk_cze" text, "ya_p01_ic_inability_walk" text, "ya_p01_ic_inbody" text, "ya_p01_ic_infectious_resp_diseases" text, "ya_p01_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p01_ic_knee_stability" text, "ya_p01_ic_med_find" text, "ya_p01_ic_nutri_qs" text, "ya_p01_ic_over_weight_200_height_195" text, "ya_p01_ic_pacemaker_defibrillator" text, "ya_p01_ic_pneumothorax" text, "ya_p01_ic_pregnancy" text, "ya_p01_ic_recent_eye_abdominal_chest_surgery" text, "ya_p01_ic_recent_myocardial_infarction" text, "ya_p01_ic_spirometry" text, "ya_p01_ic_surgical_metal_body" text, "ya_p01_ic_unstable_angina_pectoris" text, "ya_p01_ic_ya_dl_elspac" 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_p01__role, psc_role.psycap_p02_old_ya_p01__role, psc_role.ya_p01__role, psc_role.ya_p01_digi_ya03v2__role, psc_role.ya_p01_digi_ya04v2__role, psc_role.ya_p01_digi_ya05v2__role, psc_role.ya_p01_test__role, psc_state.psycap_p01_ya_p01__state, psc_state.psycap_p02_old_ya_p01__state, psc_state.ya_p01__state, psc_state.ya_p01_digi_ya03v2__state, psc_state.ya_p01_digi_ya04v2__state, psc_state.ya_p01_digi_ya05v2__state, psc_state.ya_p01_test__state, psc_activity_state.psycap_p01_ya_p01__activity_state, psc_activity_state.psycap_p02_old_ya_p01__activity_state, psc_activity_state.ya_p01__activity_state, psc_activity_state.ya_p01_digi_ya03v2__activity_state, psc_activity_state.ya_p01_digi_ya04v2__activity_state, psc_activity_state.ya_p01_digi_ya05v2__activity_state, psc_activity_state.ya_p01_test__activity_state, psc_created_at.psycap_p01_ya_p01__created_at, psc_created_at.psycap_p02_old_ya_p01__created_at, psc_created_at.ya_p01__created_at, psc_created_at.ya_p01_digi_ya03v2__created_at, psc_created_at.ya_p01_digi_ya04v2__created_at, psc_created_at.ya_p01_digi_ya05v2__created_at, psc_created_at.ya_p01_test__created_at, psc_accepted_at.psycap_p01_ya_p01__accepted_at, psc_accepted_at.psycap_p02_old_ya_p01__accepted_at, psc_accepted_at.ya_p01__accepted_at, psc_accepted_at.ya_p01_digi_ya03v2__accepted_at, psc_accepted_at.ya_p01_digi_ya04v2__accepted_at, psc_accepted_at.ya_p01_digi_ya05v2__accepted_at, psc_accepted_at.ya_p01_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p01__cancelled_at, psc_cancelled_at.ya_p01__cancelled_at, psc_cancelled_at.ya_p01_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p01_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p01__revoked_at, psc_revoked_at.psycap_p02_old_ya_p01__revoked_at, psc_revoked_at.ya_p01__revoked_at, psc_revoked_at.ya_p01_digi_ya03v2__revoked_at, psc_revoked_at.ya_p01_digi_ya04v2__revoked_at, psc_revoked_at.ya_p01_digi_ya05v2__revoked_at, psc_revoked_at.ya_p01_test__revoked_at, psc_paused_at.psycap_p01_ya_p01__paused_at, psc_paused_at.psycap_p02_old_ya_p01__paused_at, psc_paused_at.ya_p01__paused_at, psc_paused_at.ya_p01_digi_ya03v2__paused_at, psc_paused_at.ya_p01_digi_ya04v2__paused_at, psc_paused_at.ya_p01_digi_ya05v2__paused_at, psc_paused_at.ya_p01_test__paused_at, ya_p01_ic_buccal_swab_proband, ya_p01_ic_urine_proband, ya_p01_ic_venous_blood_proband, ya_p01_ic_anam_qs, ya_p01_ic_aneurysm, ya_p01_ic_anthropometry, ya_p01_ic_arch_foot, ya_p01_ic_basic_qs, ya_p01_ic_blood_pressure, ya_p01_ic_braces_piercing_iud, ya_p01_ic_cognition_test, ya_p01_ic_da_health_registry, ya_p01_ic_dexa, ya_p01_ic_enviro_qs, ya_p01_ic_follow_up_studies, ya_p01_ic_fracture_lower_body_last_3m, ya_p01_ic_fracture_upper_body_last_3m, ya_p01_ic_hand_grip, ya_p01_ic_hearing_vision_impairment, ya_p01_ic_heart_disease, ya_p01_ic_hemoptysis_ns, ya_p01_ic_hernia, ya_p01_ic_hyperthyroidism, ya_p01_ic_inability_hold_pencil, ya_p01_ic_inability_stand_both_legs, ya_p01_ic_inability_talk_cze, ya_p01_ic_inability_walk, ya_p01_ic_inbody, ya_p01_ic_infectious_resp_diseases, ya_p01_ic_iodine_barium_radioisotopes_last_7d, ya_p01_ic_knee_stability, ya_p01_ic_med_find, ya_p01_ic_nutri_qs, ya_p01_ic_over_weight_200_height_195, ya_p01_ic_pacemaker_defibrillator, ya_p01_ic_pneumothorax, ya_p01_ic_pregnancy, ya_p01_ic_recent_eye_abdominal_chest_surgery, ya_p01_ic_recent_myocardial_infarction, ya_p01_ic_spirometry, ya_p01_ic_surgical_metal_body, ya_p01_ic_unstable_angina_pectoris, ya_p01_ic_ya_dl_elspac 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 = 12 -- Pilot ID );
Date: 2025-11-30 05:02:27 Duration: 890ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
18 2s495ms 854 0ms 6ms 2ms update scheduled_command set last_execution = ?, locked = ?, version = version + ? where id = ? and version = ?;Times Reported Time consuming queries #18
Day Hour Count Duration Avg duration Nov 30 05 11 34ms 3ms 06 47 132ms 2ms 07 47 134ms 2ms 08 47 137ms 2ms 09 47 140ms 2ms 10 47 139ms 2ms 11 47 140ms 2ms 12 47 138ms 2ms 13 47 134ms 2ms 14 47 131ms 2ms 15 47 138ms 2ms 16 47 138ms 2ms 17 43 124ms 2ms 18 48 138ms 2ms 19 47 136ms 2ms 20 47 142ms 3ms 21 47 136ms 2ms 22 47 135ms 2ms 23 47 141ms 3ms [ User: tng_migration_user - Total duration: 2s495ms - Times executed: 854 ]
[ Application: [unknown] - Total duration: 2s495ms - Times executed: 854 ]
-
UPDATE scheduled_command SET last_execution = '2025-11-30 10:12:01', locked = 't', version = version + 1 WHERE id = '2' AND version = '467762';
Date: 2025-11-30 10:12:01 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
-
UPDATE scheduled_command SET last_execution = '2025-11-30 21:21:02', locked = 't', version = version + 1 WHERE id = '1' AND version = '1369303';
Date: 2025-11-30 21:21:02 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
-
UPDATE scheduled_command SET last_execution = '2025-11-30 17:32:01', locked = 't', version = version + 1 WHERE id = '6' AND version = '138719';
Date: 2025-11-30 17:32:01 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
19 2s443ms 2 1s209ms 1s233ms 1s221ms create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( with ranked_table_con as ( select *, row_number() over (partition by subject_id, type_code order by priority desc ) as ranked_row from "celspac"."core"."contact" where value -> ? = ?), ranked_table_contact as ( select *, row_number() over (partition by subject_id, type_code order by priority desc ) as ranked_row from "celspac"."core"."contact"), max_prio_perm as ( select * from ranked_table_con where ranked_row = ?), contact_table_max_prio as ( select * from ranked_table_contact where ranked_row = ?), contact_d as ( select distinct subject_id, replace((value -> ?)::text, ?, ? ) AS city, replace((value -> ?)::text, ?, ? ) as postal_code, replace((value -> ?)::text, ?, ? ) AS country, replace((value -> ?)::text, ?, ? ) as street, replace((value -> ?)::text, ?, ? ) AS street_number, replace((value -> ?)::text, ?, ? ) as permanent from max_prio_perm con where con.type_code = ?), contact_d_c as ( select distinct subject_id, replace((value -> ?)::text, ?, ? ) AS city, replace((value -> ?)::text, ?, ? ) as postal_code, replace((value -> ?)::text, ?, ? ) AS country, replace((value -> ?)::text, ?, ? ) as street, replace((value -> ?)::text, ?, ? ) AS street_number, replace((value -> ?)::text, ?, ? ) as permanent from contact_table_max_prio con where con.type_code = ?), con_email as ( select subject_id, replace(value::text, ?, ? ) AS email FROM contact_table_max_prio con WHERE con.type_code = ?), con_ph AS ( SELECT subject_id, replace(value::text, ?, ? ) as phone_number from contact_table_max_prio where type_code = ? ) select s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number as street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street as street_contact, con_d_c.street_number as street_number_contact, con_d_c.city as city_contact, con_d_c.postal_code as postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* from "celspac"."core"."subject" s left join "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se on se.subject_id = s.id left join "celspac"."core"."subject_dead" s_dead on s.id = s_dead.subject_id left join contact_d con_d on con_d.subject_id = s.id left join contact_d_c con_d_c on con_d_c.subject_id = s.id left join con_email c_e on c_e.subject_id = s.id left join con_ph c_p on c_p.subject_id = s.id );Times Reported Time consuming queries #19
Day Hour Count Duration Avg duration Nov 30 05 1 1s209ms 1s209ms 17 1 1s233ms 1s233ms [ User: tng_migration_user - Total duration: 2s443ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s443ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );
Date: 2025-11-30 17:02:18 Duration: 1s233ms 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-11-30 05:02:23 Duration: 1s209ms 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-11-30 05:02:23 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
20 2s291ms 2,878 0ms 1ms 0ms select ? from pg_catalog.pg_namespace where nspname = ?;Times Reported Time consuming queries #20
Day Hour Count Duration Avg duration Nov 30 00 120 93ms 0ms 01 120 92ms 0ms 02 120 97ms 0ms 03 120 96ms 0ms 04 120 99ms 0ms 05 120 92ms 0ms 06 120 92ms 0ms 07 120 96ms 0ms 08 120 99ms 0ms 09 120 97ms 0ms 10 120 93ms 0ms 11 120 95ms 0ms 12 120 100ms 0ms 13 120 92ms 0ms 14 120 95ms 0ms 15 120 98ms 0ms 16 120 98ms 0ms 17 120 88ms 0ms 18 118 93ms 0ms 19 120 97ms 0ms 20 120 103ms 0ms 21 120 92ms 0ms 22 120 92ms 0ms 23 120 92ms 0ms [ User: postgres - Total duration: 2s291ms - Times executed: 2878 ]
[ Application: [unknown] - Total duration: 2s291ms - Times executed: 2878 ]
-
select 1 from pg_catalog.pg_namespace where nspname = 'pgq';
Date: 2025-11-30 04:03:34 Duration: 1ms Database: celspac User: postgres Remote: [local] Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
select 1 from pg_catalog.pg_namespace where nspname = 'pgq';
Date: 2025-11-30 20:30:02 Duration: 1ms Database: postgres User: postgres Remote: [local] Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
select 1 from pg_catalog.pg_namespace where nspname = 'pgq';
Date: 2025-11-30 08:47:43 Duration: 1ms Database: celspac User: postgres Remote: [local] Application: [unknown] 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,092 1s194ms 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 = ?;Times Reported Time consuming queries #1
Day Hour Count Duration Avg duration Nov 30 00 2,520 47ms 0ms 01 2,520 46ms 0ms 02 2,520 47ms 0ms 03 2,520 47ms 0ms 04 2,520 47ms 0ms 05 2,527 47ms 0ms 06 2,737 50ms 0ms 07 2,730 51ms 0ms 08 2,730 50ms 0ms 09 2,730 50ms 0ms 10 2,730 51ms 0ms 11 2,730 51ms 0ms 12 2,730 50ms 0ms 13 2,730 50ms 0ms 14 2,730 50ms 0ms 15 2,730 51ms 0ms 16 2,730 51ms 0ms 17 2,702 49ms 0ms 18 2,730 50ms 0ms 19 2,730 50ms 0ms 20 2,730 51ms 0ms 21 2,730 50ms 0ms 22 2,730 50ms 0ms 23 2,576 47ms 0ms [ User: tng_migration_user - Total duration: 1s194ms - Times executed: 64092 ]
[ Application: [unknown] - Total duration: 1s194ms - Times executed: 64092 ]
-
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 = 'READY';
Date: 2025-11-30 23: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
-
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 = 'PROGRESS';
Date: 2025-11-30 07:35:17 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_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-11-30 19:01:16 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,624 620ms 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 Nov 30 00 1,440 24ms 0ms 01 1,440 24ms 0ms 02 1,440 24ms 0ms 03 1,440 24ms 0ms 04 1,440 24ms 0ms 05 1,444 24ms 0ms 06 1,564 26ms 0ms 07 1,560 26ms 0ms 08 1,560 26ms 0ms 09 1,560 26ms 0ms 10 1,560 26ms 0ms 11 1,560 26ms 0ms 12 1,560 26ms 0ms 13 1,560 26ms 0ms 14 1,560 26ms 0ms 15 1,560 26ms 0ms 16 1,560 26ms 0ms 17 1,544 25ms 0ms 18 1,560 26ms 0ms 19 1,560 26ms 0ms 20 1,560 26ms 0ms 21 1,560 26ms 0ms 22 1,560 26ms 0ms 23 1,472 24ms 0ms [ User: tng_migration_user - Total duration: 620ms - Times executed: 36624 ]
[ Application: [unknown] - Total duration: 620ms - Times executed: 36624 ]
-
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 = 'EMAIL_SENDED';
Date: 2025-11-30 13:30:17 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = 'PHONE';
Date: 2025-11-30 21:20: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 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-11-30 19:27:13 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 29,989 885ms 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 Nov 30 00 28 1ms 0ms 05 1,540 44ms 0ms 06 1,541 45ms 0ms 07 1,626 48ms 0ms 08 1,542 44ms 0ms 09 1,541 47ms 0ms 10 1,556 46ms 0ms 11 1,598 47ms 0ms 12 1,542 45ms 0ms 13 1,615 47ms 0ms 14 1,547 44ms 0ms 15 1,729 55ms 0ms 16 1,540 44ms 0ms 17 1,386 40ms 0ms 18 1,577 43ms 0ms 19 1,541 44ms 0ms 20 1,540 46ms 0ms 21 1,594 47ms 0ms 22 1,866 53ms 0ms 23 1,540 46ms 0ms [ User: tng_migration_user - Total duration: 885ms - Times executed: 29989 ]
[ Application: [unknown] - Total duration: 885ms - Times executed: 29989 ]
-
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 = '175';
Date: 2025-11-30 16: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
-
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 = '175';
Date: 2025-11-30 07:00: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 = '229';
Date: 2025-11-30 23:36: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 22,113 12s255ms 0ms 3ms 0ms select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.subject_subcohort_id as subject_subcohort_id_11, m0_.form_structure_variant_id as form_structure_variant_id_12, m0_.form_id as form_id_13, m0_.form_state_code as form_state_code_14 from core.mv_subject_form m0_ where m0_.form_structure_variant_id in (...) and m0_.form_id is null and m0_.result_date <= ? and m0_.use_alternative <> ?;Times Reported Time consuming queries #4
Day Hour Count Duration Avg duration Nov 30 05 1,170 636ms 0ms 06 1,170 642ms 0ms 07 1,170 658ms 0ms 08 1,170 668ms 0ms 09 1,170 654ms 0ms 10 1,170 646ms 0ms 11 1,170 670ms 0ms 12 1,170 680ms 0ms 13 1,170 651ms 0ms 14 1,170 627ms 0ms 15 1,170 644ms 0ms 16 1,170 655ms 0ms 17 1,053 587ms 0ms 18 1,170 648ms 0ms 19 1,170 634ms 0ms 20 1,170 644ms 0ms 21 1,170 627ms 0ms 22 1,170 651ms 0ms 23 1,170 623ms 0ms [ User: tng_migration_user - Total duration: 12s255ms - Times executed: 22113 ]
[ Application: [unknown] - Total duration: 12s255ms - Times executed: 22113 ]
-
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-16 12:48:01' AND m0_.use_alternative <> 't';
Date: 2025-11-30 12:48: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 ('80') AND m0_.form_id IS NULL AND m0_.result_date <= '2020-12-16 11:54:02' AND m0_.use_alternative <> 't';
Date: 2025-11-30 11:54: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 ('175') AND m0_.form_id IS NULL AND m0_.result_date <= '2022-11-13 12:48:01' AND m0_.use_alternative <> 't';
Date: 2025-11-30 12:48: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
5 10,172 1s123ms 0ms 27ms 0ms set names ?;Times Reported Time consuming queries #5
Day Hour Count Duration Avg duration Nov 30 00 425 71ms 0ms 01 420 44ms 0ms 02 420 45ms 0ms 03 420 45ms 0ms 04 420 47ms 0ms 05 413 44ms 0ms 06 421 44ms 0ms 07 433 47ms 0ms 08 422 46ms 0ms 09 421 44ms 0ms 10 424 46ms 0ms 11 429 46ms 0ms 12 422 46ms 0ms 13 434 46ms 0ms 14 427 45ms 0ms 15 454 50ms 0ms 16 420 46ms 0ms 17 411 41ms 0ms 18 435 46ms 0ms 19 421 45ms 0ms 20 420 46ms 0ms 21 424 45ms 0ms 22 438 45ms 0ms 23 398 42ms 0ms [ User: tng_migration_user - Total duration: 1s123ms - Times executed: 10172 ]
[ Application: [unknown] - Total duration: 1s123ms - Times executed: 10172 ]
-
SET NAMES 'utf8';
Date: 2025-11-30 00:01:42 Duration: 27ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
-
SET NAMES 'utf8';
Date: 2025-11-30 10:01:15 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-11-30 23:43: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
6 10,042 363ms 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 #6
Day Hour Count Duration Avg duration Nov 30 00 420 14ms 0ms 01 420 13ms 0ms 02 420 14ms 0ms 03 420 14ms 0ms 04 420 14ms 0ms 05 413 14ms 0ms 06 420 15ms 0ms 07 420 15ms 0ms 08 420 15ms 0ms 09 420 15ms 0ms 10 420 15ms 0ms 11 420 16ms 0ms 12 420 16ms 0ms 13 420 16ms 0ms 14 420 16ms 0ms 15 420 16ms 0ms 16 420 16ms 0ms 17 411 15ms 0ms 18 420 16ms 0ms 19 420 16ms 0ms 20 420 14ms 0ms 21 420 13ms 0ms 22 420 13ms 0ms 23 398 13ms 0ms [ User: tng_migration_user - Total duration: 363ms - Times executed: 10042 ]
[ Application: [unknown] - Total duration: 363ms - Times executed: 10042 ]
-
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-11-30 15:19: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.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-11-30 09:33: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.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-11-30 16:16: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
7 9,774 186ms 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 #7
Day Hour Count Duration Avg duration Nov 30 00 2 0ms 0ms 05 419 7ms 0ms 06 555 11ms 0ms 07 523 10ms 0ms 08 519 10ms 0ms 09 516 9ms 0ms 10 517 9ms 0ms 11 521 10ms 0ms 12 518 10ms 0ms 13 524 10ms 0ms 14 522 9ms 0ms 15 531 10ms 0ms 16 511 9ms 0ms 17 511 9ms 0ms 18 513 9ms 0ms 19 512 9ms 0ms 20 511 9ms 0ms 21 513 9ms 0ms 22 525 10ms 0ms 23 511 9ms 0ms [ User: tng_migration_user - Total duration: 186ms - Times executed: 9774 ]
[ Application: [unknown] - Total duration: 186ms - Times executed: 9774 ]
-
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 = '50137';
Date: 2025-11-30 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 = '43070';
Date: 2025-11-30 15: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 = '8889';
Date: 2025-11-30 12:23: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
8 9,556 113ms 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.clade_id as clade_id_5, t0.expired_at as expired_at_6, t0.owner_user_id as owner_user_id_7, t0.owner_group_id as owner_group_id_8, t0.form_structure_variant_id as form_structure_variant_id_9, t0.form_state_code as form_state_code_10, t0.subject_id as subject_id_11, t0.about_subject_id as about_subject_id_12, t0.notif_state as notif_state_13 from core.form t0 where t0.id = ?;Times Reported Time consuming queries #8
Day Hour Count Duration Avg duration Nov 30 05 567 6ms 0ms 06 502 6ms 0ms 07 503 6ms 0ms 08 503 6ms 0ms 09 501 6ms 0ms 10 502 5ms 0ms 11 503 6ms 0ms 12 501 5ms 0ms 13 503 6ms 0ms 14 502 5ms 0ms 15 505 6ms 0ms 16 495 5ms 0ms 17 495 5ms 0ms 18 496 6ms 0ms 19 495 5ms 0ms 20 495 5ms 0ms 21 495 5ms 0ms 22 498 5ms 0ms 23 495 5ms 0ms [ User: tng_migration_user - Total duration: 113ms - Times executed: 9556 ]
[ Application: [unknown] - Total duration: 113ms - Times executed: 9556 ]
-
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 = '137273';
Date: 2025-11-30 14:08:42 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.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 = '138048';
Date: 2025-11-30 13:22:16 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.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 = '136393';
Date: 2025-11-30 05: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
9 9,378 112ms 0ms 0ms 0ms select t0.is_archived as is_archived_1, t0.created_at as created_at_2, t0.updated_at as updated_at_3, t0.code as code_4, t0.name as name_5, t0.description as description_6 from core.notif_state t0 where t0.code = ? limit ?;Times Reported Time consuming queries #9
Day Hour Count Duration Avg duration Nov 30 00 360 4ms 0ms 01 360 4ms 0ms 02 360 4ms 0ms 03 360 4ms 0ms 04 360 4ms 0ms 05 360 4ms 0ms 06 614 6ms 0ms 07 390 4ms 0ms 08 390 4ms 0ms 09 390 4ms 0ms 10 390 4ms 0ms 11 390 4ms 0ms 12 390 4ms 0ms 13 390 4ms 0ms 14 390 4ms 0ms 15 390 4ms 0ms 16 390 4ms 0ms 17 386 4ms 0ms 18 390 4ms 0ms 19 390 4ms 0ms 20 390 4ms 0ms 21 390 4ms 0ms 22 390 4ms 0ms 23 368 4ms 0ms [ User: tng_migration_user - Total duration: 112ms - Times executed: 9378 ]
[ Application: [unknown] - Total duration: 112ms - Times executed: 9378 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = 'ERROR' LIMIT 1;
Date: 2025-11-30 00:58:15 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = 'ERROR' LIMIT 1;
Date: 2025-11-30 03:35: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 t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = 'ERROR' LIMIT 1;
Date: 2025-11-30 11:12:16 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
10 8,618 1s498ms 0ms 2ms 0ms select count(n0_.id) as sclr_0 from core.notif n0_ where n0_.notif_state_code = ? and n0_.processed_time >= ?;Times Reported Time consuming queries #10
Day Hour Count Duration Avg duration Nov 30 00 360 60ms 0ms 01 360 60ms 0ms 02 360 61ms 0ms 03 360 61ms 0ms 04 360 63ms 0ms 05 360 62ms 0ms 06 360 61ms 0ms 07 360 63ms 0ms 08 360 64ms 0ms 09 360 61ms 0ms 10 360 64ms 0ms 11 360 63ms 0ms 12 360 63ms 0ms 13 360 61ms 0ms 14 360 61ms 0ms 15 360 64ms 0ms 16 360 62ms 0ms 17 360 61ms 0ms 18 360 64ms 0ms 19 360 62ms 0ms 20 360 63ms 0ms 21 360 62ms 0ms 22 360 61ms 0ms 23 338 58ms 0ms [ User: tng_migration_user - Total duration: 1s498ms - Times executed: 8618 ]
[ Application: [unknown] - Total duration: 1s498ms - Times executed: 8618 ]
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = 'ERROR' AND n0_.processed_time >= '2025-11-23 17:00:15';
Date: 2025-11-30 17:00:15 Duration: 2ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = 'ERROR' AND n0_.processed_time >= '2025-11-23 18:24:14';
Date: 2025-11-30 18:24:14 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = 'ERROR' AND n0_.processed_time >= '2025-11-23 13:26:15';
Date: 2025-11-30 13:26:15 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
11 8,618 1s67ms 0ms 3ms 0ms select t0.id as id_1, t0.version as version_2, t0.created_at as created_at_3, t0.name as name_4, t0.command as command_5, t0.arguments as arguments_6, t0.cron_expression as cron_expression_7, t0.last_execution as last_execution_8, t0.last_return_code as last_return_code_9, t0.log_file as log_file_10, t0.priority as priority_11, t0.execute_immediately as execute_immediately_12, t0.disabled as disabled_13, t0.locked as locked_14, t0.ping_back_url as ping_back_url_15, t0.ping_back_failed_url as ping_back_failed_url_16, t0.notes as notes_17 from scheduled_command t0 order by t0.disabled asc, t0.priority desc;Times Reported Time consuming queries #11
Day Hour Count Duration Avg duration Nov 30 00 360 46ms 0ms 01 360 42ms 0ms 02 360 43ms 0ms 03 360 43ms 0ms 04 360 44ms 0ms 05 360 44ms 0ms 06 360 44ms 0ms 07 360 45ms 0ms 08 360 45ms 0ms 09 360 44ms 0ms 10 360 45ms 0ms 11 360 45ms 0ms 12 360 45ms 0ms 13 360 45ms 0ms 14 360 45ms 0ms 15 360 47ms 0ms 16 360 46ms 0ms 17 360 44ms 0ms 18 360 46ms 0ms 19 360 46ms 0ms 20 360 41ms 0ms 21 360 41ms 0ms 22 360 41ms 0ms 23 338 39ms 0ms [ User: tng_migration_user - Total duration: 1s67ms - Times executed: 8618 ]
[ Application: [unknown] - Total duration: 1s67ms - Times executed: 8618 ]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-30 00:01:42 Duration: 3ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log.1
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-30 15:26:13 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-11-30 07:09:15 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
12 8,618 148ms 0ms 0ms 0ms select s0_.id as id_0, s0_.version as version_1, s0_.created_at as created_at_2, s0_.name as name_3, s0_.command as command_4, s0_.arguments as arguments_5, s0_.cron_expression as cron_expression_6, s0_.last_execution as last_execution_7, s0_.last_return_code as last_return_code_8, s0_.log_file as log_file_9, s0_.priority as priority_10, s0_.execute_immediately as execute_immediately_11, s0_.disabled as disabled_12, s0_.locked as locked_13, s0_.ping_back_url as ping_back_url_14, s0_.ping_back_failed_url as ping_back_failed_url_15, s0_.notes as notes_16 from scheduled_command s0_ where s0_.disabled = ? and s0_.last_return_code <> ?;Times Reported Time consuming queries #12
Day Hour Count Duration Avg duration Nov 30 00 360 5ms 0ms 01 360 5ms 0ms 02 360 5ms 0ms 03 360 5ms 0ms 04 360 6ms 0ms 05 360 5ms 0ms 06 360 5ms 0ms 07 360 6ms 0ms 08 360 6ms 0ms 09 360 6ms 0ms 10 360 6ms 0ms 11 360 6ms 0ms 12 360 6ms 0ms 13 360 6ms 0ms 14 360 6ms 0ms 15 360 7ms 0ms 16 360 7ms 0ms 17 360 6ms 0ms 18 360 7ms 0ms 19 360 7ms 0ms 20 360 5ms 0ms 21 360 5ms 0ms 22 360 5ms 0ms 23 338 5ms 0ms [ User: tng_migration_user - Total duration: 148ms - Times executed: 8618 ]
[ Application: [unknown] - Total duration: 148ms - Times executed: 8618 ]
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = 'f' AND s0_.last_return_code <> '0';
Date: 2025-11-30 04:14:17 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = 'f' AND s0_.last_return_code <> '0';
Date: 2025-11-30 09:07:15 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT s0_.id AS id_0, s0_.version AS version_1, s0_.created_at AS created_at_2, s0_.name AS name_3, s0_.command AS command_4, s0_.arguments AS arguments_5, s0_.cron_expression AS cron_expression_6, s0_.last_execution AS last_execution_7, s0_.last_return_code AS last_return_code_8, s0_.log_file AS log_file_9, s0_.priority AS priority_10, s0_.execute_immediately AS execute_immediately_11, s0_.disabled AS disabled_12, s0_.locked AS locked_13, s0_.ping_back_url AS ping_back_url_14, s0_.ping_back_failed_url AS ping_back_failed_url_15, s0_.notes AS notes_16 FROM scheduled_command s0_ WHERE s0_.disabled = 'f' AND s0_.last_return_code <> '0';
Date: 2025-11-30 13:09: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
13 5,685 1s593ms 0ms 1ms 0ms fetch ? from c1;Times Reported Time consuming queries #13
Day Hour Count Duration Avg duration Nov 30 23 5,685 1s593ms 0ms [ User: tng__dwh_celspac_fdw - Total duration: 1s593ms - Times executed: 5685 ]
[ Application: postgres_fdw - Total duration: 1s593ms - Times executed: 5685 ]
-
FETCH 100 FROM c1;
Date: 2025-11-30 23:35:18 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-11-30 23:35:19 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-11-30 23:35:19 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
14 5,548 513ms 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 #14
Day Hour Count Duration Avg duration Nov 30 05 292 26ms 0ms 06 292 29ms 0ms 07 292 27ms 0ms 08 292 30ms 0ms 09 292 26ms 0ms 10 292 25ms 0ms 11 292 27ms 0ms 12 292 28ms 0ms 13 292 28ms 0ms 14 292 26ms 0ms 15 292 29ms 0ms 16 292 28ms 0ms 17 292 25ms 0ms 18 292 27ms 0ms 19 292 24ms 0ms 20 292 26ms 0ms 21 292 24ms 0ms 22 292 27ms 0ms 23 292 25ms 0ms [ User: tng_migration_user - Total duration: 513ms - Times executed: 5548 ]
[ Application: [unknown] - Total duration: 513ms - 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-17 11:00:01' AND '2023-06-16 11:00:01');
Date: 2025-11-30 11: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 = '173' AND m0_.form_state_code NOT IN ('READY', 'PROCESSING', 'DONE', 'CLOSED', 'EXPIRED', 'EXPIRED_EMPTY') AND m0_.use_alternative <> 't' AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN '2022-09-29 06:00:01' AND '2022-11-13 06:00:01');
Date: 2025-11-30 06: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 = '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-17 07:00:01' AND '2023-06-16 07:00:01');
Date: 2025-11-30 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
15 5,040 78ms 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 #15
Day Hour Count Duration Avg duration Nov 30 06 280 4ms 0ms 07 280 4ms 0ms 08 280 4ms 0ms 09 280 4ms 0ms 10 280 4ms 0ms 11 280 4ms 0ms 12 280 4ms 0ms 13 280 4ms 0ms 14 280 4ms 0ms 15 280 4ms 0ms 16 280 4ms 0ms 17 280 3ms 0ms 18 280 4ms 0ms 19 280 4ms 0ms 20 280 4ms 0ms 21 280 3ms 0ms 22 280 4ms 0ms 23 280 4ms 0ms [ User: tng_migration_user - Total duration: 78ms - Times executed: 5040 ]
[ Application: [unknown] - Total duration: 78ms - 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 ('114') AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ('AWAITING', 'MISSED', 'DONE', 'CANCELED') AND (m0_.result_date BETWEEN '2025-02-20 23:50:01' AND '2025-02-24 23:50:01');
Date: 2025-11-30 23:50: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-16 07:14:02' AND '2025-09-02 07:14:02');
Date: 2025-11-30 07: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 ('102') AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ('AWAITING', 'MISSED', 'DONE', 'CANCELED') AND (m0_.result_date BETWEEN '2025-02-20 23:14:02' AND '2025-02-24 23:14:02');
Date: 2025-11-30 23: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
16 4,725 1s616ms 0ms 1ms 0ms select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.subject_subcohort_id as subject_subcohort_id_11, m0_.form_structure_variant_id as form_structure_variant_id_12, m0_.form_id as form_id_13, m0_.form_state_code as form_state_code_14 from core.mv_subject_form m0_ where m0_.form_structure_variant_id in (...) and m0_.form_id is null;Times Reported Time consuming queries #16
Day Hour Count Duration Avg duration Nov 30 05 250 87ms 0ms 06 250 86ms 0ms 07 250 83ms 0ms 08 250 84ms 0ms 09 250 86ms 0ms 10 250 86ms 0ms 11 250 88ms 0ms 12 250 86ms 0ms 13 250 86ms 0ms 14 250 83ms 0ms 15 250 85ms 0ms 16 250 86ms 0ms 17 225 76ms 0ms 18 250 84ms 0ms 19 250 81ms 0ms 20 250 85ms 0ms 21 250 83ms 0ms 22 250 85ms 0ms 23 250 85ms 0ms [ User: tng_migration_user - Total duration: 1s616ms - Times executed: 4725 ]
[ Application: [unknown] - Total duration: 1s616ms - Times executed: 4725 ]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('127') AND m0_.form_id IS NULL;
Date: 2025-11-30 11:54:03 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
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 ('128') AND m0_.form_id IS NULL;
Date: 2025-11-30 11:54:03 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.subject_subcohort_id AS subject_subcohort_id_11, m0_.form_structure_variant_id AS form_structure_variant_id_12, m0_.form_id AS form_id_13, m0_.form_state_code AS form_state_code_14 FROM core.mv_subject_form m0_ WHERE m0_.form_structure_variant_id IN ('127') AND m0_.form_id IS NULL;
Date: 2025-11-30 15:00:04 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
17 3,590 74ms 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 #17
Day Hour Count Duration Avg duration Nov 30 00 123 2ms 0ms 05 109 3ms 0ms 07 369 7ms 0ms 10 39 0ms 0ms 11 246 5ms 0ms 13 306 6ms 0ms 15 806 17ms 0ms 18 142 3ms 0ms 21 246 5ms 0ms 22 1,204 22ms 0ms [ User: tng_migration_user - Total duration: 74ms - Times executed: 3590 ]
[ Application: [unknown] - Total duration: 74ms - Times executed: 3590 ]
-
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-11-30 15:24:29 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-11-30 18:45:12 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-11-30 11:59:44 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 3,276 918ms 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 (...) and m0_.proband_event_id is not null and p1_.state_code not in (...) and m0_.use_alternative <> ? and m0_.result_date <= ?;Times Reported Time consuming queries #18
Day Hour Count Duration Avg duration Nov 30 06 182 47ms 0ms 07 182 55ms 0ms 08 182 49ms 0ms 09 182 50ms 0ms 10 182 50ms 0ms 11 182 48ms 0ms 12 182 49ms 0ms 13 182 51ms 0ms 14 182 50ms 0ms 15 182 48ms 0ms 16 182 56ms 0ms 17 182 47ms 0ms 18 182 48ms 0ms 19 182 49ms 0ms 20 182 59ms 0ms 21 182 47ms 0ms 22 182 51ms 0ms 23 182 57ms 0ms [ User: tng_migration_user - Total duration: 918ms - Times executed: 3276 ]
[ Application: [unknown] - Total duration: 918ms - Times executed: 3276 ]
-
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 ('101') AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ('AWAITING', 'MISSED', 'DONE', 'CANCELED') AND m0_.use_alternative <> 't' AND m0_.result_date <= '2025-04-17 14:05:01';
Date: 2025-11-30 14:05:02 Duration: 1ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ('100') AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ('AWAITING', 'MISSED', 'DONE', 'CANCELED') AND m0_.use_alternative <> 't' AND m0_.result_date <= '2025-06-12 22:59:01';
Date: 2025-11-30 22: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 ('100') AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ('AWAITING', 'MISSED', 'DONE', 'CANCELED') AND m0_.use_alternative <> 't' AND m0_.result_date <= '2025-06-12 23:14:02';
Date: 2025-11-30 23: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
19 3,276 111ms 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_.use_alternative <> ? and (m0_.result_date between ? and ?);Times Reported Time consuming queries #19
Day Hour Count Duration Avg duration Nov 30 06 182 5ms 0ms 07 182 6ms 0ms 08 182 5ms 0ms 09 182 6ms 0ms 10 182 6ms 0ms 11 182 6ms 0ms 12 182 6ms 0ms 13 182 6ms 0ms 14 182 5ms 0ms 15 182 5ms 0ms 16 182 6ms 0ms 17 182 5ms 0ms 18 182 5ms 0ms 19 182 5ms 0ms 20 182 6ms 0ms 21 182 5ms 0ms 22 182 6ms 0ms 23 182 6ms 0ms [ User: tng_migration_user - Total duration: 111ms - Times executed: 3276 ]
[ Application: [unknown] - Total duration: 111ms - Times executed: 3276 ]
-
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 ('READY', 'AWAITING', 'MISSED', 'DONE', 'CANCELED') AND m0_.use_alternative <> 't' AND (m0_.result_date BETWEEN '2025-08-09 10:59:01' AND '2025-10-18 10:59:01');
Date: 2025-11-30 10: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
-
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 ('READY', 'AWAITING', 'MISSED', 'DONE', 'CANCELED') AND m0_.use_alternative <> 't' AND (m0_.result_date BETWEEN '2025-08-09 12:50:02' AND '2025-10-18 12:50:02');
Date: 2025-11-30 12:50: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 ('READY', 'AWAITING', 'MISSED', 'DONE', 'CANCELED') AND m0_.use_alternative <> 't' AND (m0_.result_date BETWEEN '2025-08-09 19:23:01' AND '2025-10-18 19:23:01');
Date: 2025-11-30 19:23:01 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
20 3,276 107ms 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_ where m0_.plan_id in (...) and m0_.proband_event_id is null and m0_.result_date <= ? and m0_.use_alternative <> ?;Times Reported Time consuming queries #20
Day Hour Count Duration Avg duration Nov 30 06 182 5ms 0ms 07 182 6ms 0ms 08 182 5ms 0ms 09 182 5ms 0ms 10 182 5ms 0ms 11 182 5ms 0ms 12 182 5ms 0ms 13 182 6ms 0ms 14 182 5ms 0ms 15 182 5ms 0ms 16 182 6ms 0ms 17 182 5ms 0ms 18 182 5ms 0ms 19 182 5ms 0ms 20 182 6ms 0ms 21 182 5ms 0ms 22 182 5ms 0ms 23 182 6ms 0ms [ User: tng_migration_user - Total duration: 107ms - Times executed: 3276 ]
[ Application: [unknown] - Total duration: 107ms - Times executed: 3276 ]
-
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_ WHERE m0_.plan_id IN ('107') AND m0_.proband_event_id IS NULL AND m0_.result_date <= '2025-04-28 15:23:02' AND m0_.use_alternative <> 't';
Date: 2025-11-30 15: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 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_ WHERE m0_.plan_id IN ('89') AND m0_.proband_event_id IS NULL AND m0_.result_date <= '2025-06-23 16:41:02' AND m0_.use_alternative <> 't';
Date: 2025-11-30 16:41: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_ WHERE m0_.plan_id IN ('88') AND m0_.proband_event_id IS NULL AND m0_.result_date <= '2025-08-11 08:41:02' AND m0_.use_alternative <> 't';
Date: 2025-11-30 08:41: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 6m6s 9m19s 7m42s 2 15m25s create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__19__dbt_tmp" as ( with proband_subcohort_role as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_role_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "covid_p01__role" text, "covid_p02__role" text, "covid_p03__role" text)), proband_subcohort_state as ( select * from crosstab ($$ select subject_id, subcohort_label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as role ("subject_id" int, "covid_p01__state" text, "covid_p02__state" text, "covid_p03__state" text)), proband_subcohort_activity_state as ( select * from crosstab ($$ select subject_id, subcohort_label, activity_state_code from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as activity ("subject_id" int, "covid_p01__activity_state" text, "covid_p02__activity_state" text, "covid_p03__activity_state" text)), proband_subcohort_created_at as ( select * from crosstab ($$ select subject_id, subcohort_label, created_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as created_at ("subject_id" int, "covid_p01__created_at" text, "covid_p02__created_at" text, "covid_p03__created_at" text)), proband_subcohort_accepted_at as ( select * from crosstab ($$ select subject_id, subcohort_label, accepted_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as accepted_at ("subject_id" int, "covid_p01__accepted_at" text, "covid_p02__accepted_at" text, "covid_p03__accepted_at" text)), proband_subcohort_cancelled_at as ( select * from crosstab ($$ select subject_id, subcohort_label, cancelled_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as cancelled_at ("subject_id" int, "covid_p01__cancelled_at" text, "covid_p02__cancelled_at" text, "covid_p03__cancelled_at" text)), proband_subcohort_revoked_at as ( select * from crosstab ($$ select subject_id, subcohort_label, revoked_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as revoked_at ("subject_id" int, "covid_p01__revoked_at" text, "covid_p02__revoked_at" text, "covid_p03__revoked_at" text)), proband_subcohort_paused_at as ( select * from crosstab ($$ select subject_id, subcohort_label, paused_at from "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" where subject_state_code <> ? and inform_consent_type_code = ? and pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as paused_at ("subject_id" int, "covid_p01__paused_at" text, "covid_p02__paused_at" text, "covid_p03__paused_at" text)), proband_ic_type_biomaterial_state as ( select * from crosstab ($$ select subject_id, label, subject_inform_consent_state_code from "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" where pilot_id = ? order by ?, ? $$, $$ values (?), (?), (?) $$ ) as biomaterial_state ("subject_id" int, "covid_p01_ic_venous_blood_proband" text, "covid_p02_ic_venous_blood_proband" text, "covid_p03_ic_venous_blood_proband" text) ) select sbj.tng_id as proband_id, sbj.test_proband as is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedchildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalid, sbj.tng_p08__childid, sbj.tng_p08__childcode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedchildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalid, sbj.tng_p01__childid, sbj.tng_p01__childcode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedchildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalid, sbj.tng_p02__childid, sbj.tng_p02__childcode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedchildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalid, sbj.tng_p03__childid, sbj.tng_p03__childcode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedchildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalid, sbj.tng_p04__childid, sbj.tng_p04__childcode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedchildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalid, sbj.tng_p05__childid, sbj.tng_p05__childcode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedchildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalid, sbj.tng_p06__childid, sbj.tng_p06__childcode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedchildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalid, sbj.tng_p07__childid, sbj.tng_p07__childcode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedchildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalid, sbj.tng_p09__childid, sbj.tng_p09__childcode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyelspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyelspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedchildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalid, sbj.tng_p10__childid, sbj.tng_p10__childcode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyelspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyelspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedchildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalid, sbj.tng_p11__childid, sbj.tng_p11__childcode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyelspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedchildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalid, sbj.tng_p12__childid, sbj.tng_p12__childcode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyelspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyelspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyelspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedchildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalid, sbj.tng_p13__childid, sbj.tng_p13__childcode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyelspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyelspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedchildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalid, sbj.tng_4mi_p1__childid, sbj.tng_4mi_p1__childcode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyelspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyelspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedchildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalid, sbj.tng_4mi_p2__childid, sbj.tng_4mi_p2__childcode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childcode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyelspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientgroup, sbj.horpark__patientpartner, sbj.horpark__biobankcode, sbj.horpark__locationbloodurine, sbj.horpark__locationlikvor, psc_role.covid_p01__role, psc_role.covid_p02__role, psc_role.covid_p03__role, psc_state.covid_p01__state, psc_state.covid_p02__state, psc_state.covid_p03__state, psc_activity_state.covid_p01__activity_state, psc_activity_state.covid_p02__activity_state, psc_activity_state.covid_p03__activity_state, psc_created_at.covid_p01__created_at, psc_created_at.covid_p02__created_at, psc_created_at.covid_p03__created_at, psc_accepted_at.covid_p01__accepted_at, psc_accepted_at.covid_p02__accepted_at, psc_accepted_at.covid_p03__accepted_at, psc_cancelled_at.covid_p01__cancelled_at, psc_cancelled_at.covid_p02__cancelled_at, psc_cancelled_at.covid_p03__cancelled_at, psc_revoked_at.covid_p01__revoked_at, psc_revoked_at.covid_p02__revoked_at, psc_revoked_at.covid_p03__revoked_at, psc_paused_at.covid_p01__paused_at, psc_paused_at.covid_p02__paused_at, psc_paused_at.covid_p03__paused_at, covid_p01_ic_venous_blood_proband, covid_p02_ic_venous_blood_proband, covid_p03_ic_venous_blood_proband from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #1
Day Hour Count Duration Avg duration Nov 30 05 1 6m6s 6m6s 17 1 9m19s 9m19s [ User: tng_migration_user - Total duration: 15m25s - Times executed: 2 ]
[ Application: dbt - Total duration: 15m25s - 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-11-30 17:11:42 Duration: 9m19s 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-11-30 05:08:31 Duration: 6m6s Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
2 25s998ms 34s291ms 30s145ms 2 1m 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 Nov 30 05 1 25s998ms 25s998ms 17 1 34s291ms 34s291ms [ User: tng_migration_user - Total duration: 1m - Times executed: 2 ]
[ Application: dbt - Total duration: 1m - 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-11-30 17:02:58 Duration: 34s291ms 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-11-30 05:02:50 Duration: 25s998ms 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 4s774ms 5s369ms 5s72ms 2 10s144ms 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 #3
Day Hour Count Duration Avg duration Nov 30 05 1 4s774ms 4s774ms 17 1 5s369ms 5s369ms [ User: tng_migration_user - Total duration: 10s144ms - Times executed: 2 ]
[ Application: dbt - Total duration: 10s144ms - 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-11-30 17:02:33 Duration: 5s369ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__27"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__27__dbt_tmp" as ( -- suject (proband) patrici do kohorty ... HAPIEE Pilot II, Pilot ID: 27 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS role ("subject_id" int, "hapiee_p02__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS activity ("subject_id" int, "hapiee_p02__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS created_at ("subject_id" int, "hapiee_p02__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS accepted_at ("subject_id" int, "hapiee_p02__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS cancelled_at ("subject_id" int, "hapiee_p02__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS revoked_at ("subject_id" int, "hapiee_p02__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02') $$ ) AS paused_at ("subject_id" int, "hapiee_p02__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "hapiee_p02_ic_venous_blood_proband" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 27 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('hapiee_p02_ic_dl_hapiee'), ('hapiee_p02_ic_dl_statistics'), ('hapiee_p02_ic_examination'), ('hapiee_p02_ic_health_qs'), ('hapiee_p02_ic_samples_storage') $$ ) AS extra_state ("subject_id" int, "hapiee_p02_ic_dl_hapiee" text, "hapiee_p02_ic_dl_statistics" text, "hapiee_p02_ic_examination" text, "hapiee_p02_ic_health_qs" text, "hapiee_p02_ic_samples_storage" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.hapiee_p02__role, psc_state.hapiee_p02__state, psc_activity_state.hapiee_p02__activity_state, psc_created_at.hapiee_p02__created_at, psc_accepted_at.hapiee_p02__accepted_at, psc_cancelled_at.hapiee_p02__cancelled_at, psc_revoked_at.hapiee_p02__revoked_at, psc_paused_at.hapiee_p02__paused_at, hapiee_p02_ic_venous_blood_proband, hapiee_p02_ic_dl_hapiee, hapiee_p02_ic_dl_statistics, hapiee_p02_ic_examination, hapiee_p02_ic_health_qs, hapiee_p02_ic_samples_storage FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 27 -- Pilot ID );
Date: 2025-11-30 05:02:38 Duration: 4s774ms 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 4s190ms 4s901ms 4s546ms 2 9s92ms 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 #4
Day Hour Count Duration Avg duration Nov 30 05 1 4s190ms 4s190ms 17 1 4s901ms 4s901ms [ User: tng_migration_user - Total duration: 9s92ms - Times executed: 2 ]
[ Application: dbt - Total duration: 9s92ms - 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-11-30 17:02:32 Duration: 4s901ms 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-11-30 05:02:36 Duration: 4s190ms 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 2s301ms 3s259ms 2s780ms 2 5s560ms 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 #5
Day Hour Count Duration Avg duration Nov 30 05 1 2s301ms 2s301ms 17 1 3s259ms 3s259ms [ User: tng_migration_user - Total duration: 5s560ms - Times executed: 2 ]
[ Application: dbt - Total duration: 5s560ms - 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-11-30 17:02:24 Duration: 3s259ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__17"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__17__dbt_tmp" as ( -- suject (proband) patrici do kohorty TNG Pilot X, Pilot ID: 17 -- WITH proband_subcohort_role AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_role_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__role" text, "tng__monitor__role" text, "tng_p10__role" text, "tng_p10_test_tp__role" text)), proband_subcohort_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS role ("subject_id" int, "dust_p01_tng_p10__state" text, "tng__monitor__state" text, "tng_p10__state" text, "tng_p10_test_tp__state" text)), proband_subcohort_activity_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, activity_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS activity ("subject_id" int, "dust_p01_tng_p10__activity_state" text, "tng__monitor__activity_state" text, "tng_p10__activity_state" text, "tng_p10_test_tp__activity_state" text)), proband_subcohort_created_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, created_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS created_at ("subject_id" int, "dust_p01_tng_p10__created_at" text, "tng__monitor__created_at" text, "tng_p10__created_at" text, "tng_p10_test_tp__created_at" text)), proband_subcohort_accepted_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, accepted_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS accepted_at ("subject_id" int, "dust_p01_tng_p10__accepted_at" text, "tng__monitor__accepted_at" text, "tng_p10__accepted_at" text, "tng_p10_test_tp__accepted_at" text)), proband_subcohort_cancelled_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, cancelled_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS cancelled_at ("subject_id" int, "dust_p01_tng_p10__cancelled_at" text, "tng__monitor__cancelled_at" text, "tng_p10__cancelled_at" text, "tng_p10_test_tp__cancelled_at" text)), proband_subcohort_revoked_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, revoked_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS revoked_at ("subject_id" int, "dust_p01_tng_p10__revoked_at" text, "tng__monitor__revoked_at" text, "tng_p10__revoked_at" text, "tng_p10_test_tp__revoked_at" text)), proband_subcohort_paused_at AS ( SELECT * FROM crosstab ($$ SELECT subject_id, subcohort_label, paused_at FROM "celspac"."dbt_marts_dbt_all"."intr__proband_base_data" WHERE subject_state_code <> 'BLANK' AND inform_consent_type_code = 'SUBCOHORT' AND pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10'), ('tng__monitor'), ('tng_p10'), ('tng_p10_test_tp') $$ ) AS paused_at ("subject_id" int, "dust_p01_tng_p10__paused_at" text, "tng__monitor__paused_at" text, "tng_p10__paused_at" text, "tng_p10_test_tp__paused_at" text)), proband_ic_type_biomaterial_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_biomaterial_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dust_mother'), ('tng_p10_ic_buccal_swab_child'), ('tng_p10_ic_buccal_swab_mother'), ('tng_p10_ic_cord_blood_mother'), ('tng_p10_ic_drop_blood_child'), ('tng_p10_ic_stool_child'), ('tng_p10_ic_urine_mother'), ('tng_p10_ic_venous_blood_mother') $$ ) AS biomaterial_state ("subject_id" int, "dust_p01_tng_p10_ic_dust_mother" text, "tng_p10_ic_buccal_swab_child" text, "tng_p10_ic_buccal_swab_mother" text, "tng_p10_ic_cord_blood_mother" text, "tng_p10_ic_drop_blood_child" text, "tng_p10_ic_stool_child" text, "tng_p10_ic_urine_mother" text, "tng_p10_ic_venous_blood_mother" text)), proband_ic_type_extra_state AS ( SELECT * FROM crosstab ($$ SELECT subject_id, label, subject_inform_consent_state_code FROM "celspac"."dbt_marts_dbt_all"."intr__ict_extra_base_data" WHERE pilot_id = 17 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('dust_p01_tng_p10_ic_dl_celpac_studies'), ('dust_p01_tng_p10_ic_survey'), ('tng_p10_ic_follow_up_studies'), ('tng_p10_ic_med_find') $$ ) AS extra_state ("subject_id" int, "dust_p01_tng_p10_ic_dl_celpac_studies" text, "dust_p01_tng_p10_ic_survey" text, "tng_p10_ic_follow_up_studies" text, "tng_p10_ic_med_find" text) ) SELECT sbj.tng_id AS proband_id, sbj.test_proband AS is_test, sbj.family_id, sbj.family_code, sbj.elspac_family_relationship_type_code, sbj.subject_state_code, sbj.rc, sbj.sex_code, sbj.birthdate, sbj.death_at, sbj.date_of_death, sbj.cause_of_death, sbj.titles_before, sbj.name, sbj.surname, sbj.titles_after, sbj.email, sbj.phone_number, sbj.street, sbj.street_number, sbj.city, sbj.postal_code, sbj.country, sbj.street_contact, sbj.street_number_contact, sbj.city_contact, sbj.postal_code_contact, sbj.country_contact, sbj.is_origin_elspac, sbj.description, sbj.tng_p08__description, sbj.tng_p08__description_internal, sbj.tng_p08__expectedChildbirth, sbj.tng_p08__childbirth, sbj.tng_p08__location, sbj.tng_p08__hospitalId, sbj.tng_p08__childId, sbj.tng_p08__childCode, sbj.tng_p01__description, sbj.tng_p01__description_internal, sbj.tng_p01__expectedChildbirth, sbj.tng_p01__childbirth, sbj.tng_p01__location, sbj.tng_p01__hospitalId, sbj.tng_p01__childId, sbj.tng_p01__childCode, sbj.tng_p02__description, sbj.tng_p02__description_internal, sbj.tng_p02__expectedChildbirth, sbj.tng_p02__childbirth, sbj.tng_p02__location, sbj.tng_p02__hospitalId, sbj.tng_p02__childId, sbj.tng_p02__childCode, sbj.tng_p03__description, sbj.tng_p03__description_internal, sbj.tng_p03__expectedChildbirth, sbj.tng_p03__childbirth, sbj.tng_p03__location, sbj.tng_p03__hospitalId, sbj.tng_p03__childId, sbj.tng_p03__childCode, sbj.tng_p04__description, sbj.tng_p04__description_internal, sbj.tng_p04__expectedChildbirth, sbj.tng_p04__childbirth, sbj.tng_p04__location, sbj.tng_p04__hospitalId, sbj.tng_p04__childId, sbj.tng_p04__childCode, sbj.tng_p05__description, sbj.tng_p05__description_internal, sbj.tng_p05__expectedChildbirth, sbj.tng_p05__childbirth, sbj.tng_p05__location, sbj.tng_p05__hospitalId, sbj.tng_p05__childId, sbj.tng_p05__childCode, sbj.tng_p06__description, sbj.tng_p06__description_internal, sbj.tng_p06__expectedChildbirth, sbj.tng_p06__childbirth, sbj.tng_p06__location, sbj.tng_p06__hospitalId, sbj.tng_p06__childId, sbj.tng_p06__childCode, sbj.tng_p07__description, sbj.tng_p07__description_internal, sbj.tng_p07__expectedChildbirth, sbj.tng_p07__childbirth, sbj.tng_p07__location, sbj.tng_p07__hospitalId, sbj.tng_p07__childId, sbj.tng_p07__childCode, sbj.tng_p09__description, sbj.tng_p09__description_internal, sbj.tng_p09__expectedChildbirth, sbj.tng_p09__childbirth, sbj.tng_p09__location, sbj.tng_p09__hospitalId, sbj.tng_p09__childId, sbj.tng_p09__childCode, sbj.ya_p01__description, sbj.ya_p01__description_internal, sbj.ya_p01__examin, sbj.ya_p01__familyElspac, sbj.ya_p02__description, sbj.ya_p02__description_internal, sbj.ya_p02__examin, sbj.ya_p02__familyElspac, sbj.tng_p10__description, sbj.tng_p10__description_internal, sbj.tng_p10__expectedChildbirth, sbj.tng_p10__childbirth, sbj.tng_p10__location, sbj.tng_p10__hospitalId, sbj.tng_p10__childId, sbj.tng_p10__childCode, sbj.hba_p01__description, sbj.hba_p01__description_internal, sbj.hba_p01__examin, sbj.hba_p01__familyElspac, sbj.covid_p01__description, sbj.covid_p01__description_internal, sbj.covid_p01__examin, sbj.covid_p01__familyElspac, sbj.tng_p11__description, sbj.tng_p11__description_internal, sbj.tng_p11__expectedChildbirth, sbj.tng_p11__childbirth, sbj.tng_p11__location, sbj.tng_p11__hospitalId, sbj.tng_p11__childId, sbj.tng_p11__childCode, sbj.ya_p03__description, sbj.ya_p03__description_internal, sbj.ya_p03__examin, sbj.ya_p03__familyElspac, sbj.tng_p12__description, sbj.tng_p12__description_internal, sbj.tng_p12__expectedChildbirth, sbj.tng_p12__childbirth, sbj.tng_p12__location, sbj.tng_p12__hospitalId, sbj.tng_p12__childId, sbj.tng_p12__childCode, sbj.celspac_pr_elspac_p01__description, sbj.celspac_pr_elspac_p01__description_internal, sbj.celspac_pr_elspac_p01__examin, sbj.celspac_pr_elspac_p01__familyElspac, sbj.celspac_pr_zajemci_p01__description, sbj.celspac_pr_zajemci_p01__description_internal, sbj.celspac_pr_zajemci_p01__examin, sbj.celspac_pr_zajemci_p01__familyElspac, sbj.hapiee_p01__description, sbj.hapiee_p01__description_internal, sbj.hapiee_p01__examin, sbj.hapiee_p01__familyElspac, sbj.tng_p13__description, sbj.tng_p13__description_internal, sbj.tng_p13__expectedChildbirth, sbj.tng_p13__childbirth, sbj.tng_p13__location, sbj.tng_p13__hospitalId, sbj.tng_p13__childId, sbj.tng_p13__childCode, sbj.hapiee_p02__description, sbj.hapiee_p02__description_internal, sbj.hapiee_p02__examin, sbj.hapiee_p02__familyElspac, sbj.vulde__description, sbj.vulde__description_internal, sbj.vulde__examin, sbj.vulde__familyElspac, sbj.tng_4mi_p1__description, sbj.tng_4mi_p1__description_internal, sbj.tng_4mi_p1__expectedChildbirth, sbj.tng_4mi_p1__childbirth, sbj.tng_4mi_p1__location, sbj.tng_4mi_p1__hospitalId, sbj.tng_4mi_p1__childId, sbj.tng_4mi_p1__childCode, sbj.tng_4mi_p1__examin, sbj.parents_p01__description, sbj.parents_p01__description_internal, sbj.parents_p01__examin, sbj.parents_p01__familyElspac, sbj.ya_p04__description, sbj.ya_p04__description_internal, sbj.ya_p04__examin, sbj.ya_p04__familyElspac, sbj.tng_4mi_p2__description, sbj.tng_4mi_p2__description_internal, sbj.tng_4mi_p2__expectedChildbirth, sbj.tng_4mi_p2__childbirth, sbj.tng_4mi_p2__location, sbj.tng_4mi_p2__hospitalId, sbj.tng_4mi_p2__childId, sbj.tng_4mi_p2__childCode, sbj.tng_4mi_p2__examin, sbj.tng_children_p1__description, sbj.tng_children_p1__description_internal, sbj.tng_children_p1__location, sbj.tng_children_p1__examin, sbj.tng_children_p1__childCode, sbj.parents_p02__description, sbj.parents_p02__description_internal, sbj.parents_p02__examin, sbj.parents_p02__familyElspac, sbj.horpark__description, sbj.horpark__description_internal, sbj.horpark__patientGroup, sbj.horpark__patientPartner, sbj.horpark__biobankCode, sbj.horpark__locationBloodUrine, sbj.horpark__locationLikvor, psc_role.dust_p01_tng_p10__role, psc_role.tng__monitor__role, psc_role.tng_p10__role, psc_role.tng_p10_test_tp__role, psc_state.dust_p01_tng_p10__state, psc_state.tng__monitor__state, psc_state.tng_p10__state, psc_state.tng_p10_test_tp__state, psc_activity_state.dust_p01_tng_p10__activity_state, psc_activity_state.tng__monitor__activity_state, psc_activity_state.tng_p10__activity_state, psc_activity_state.tng_p10_test_tp__activity_state, psc_created_at.dust_p01_tng_p10__created_at, psc_created_at.tng__monitor__created_at, psc_created_at.tng_p10__created_at, psc_created_at.tng_p10_test_tp__created_at, psc_accepted_at.dust_p01_tng_p10__accepted_at, psc_accepted_at.tng__monitor__accepted_at, psc_accepted_at.tng_p10__accepted_at, psc_accepted_at.tng_p10_test_tp__accepted_at, psc_cancelled_at.dust_p01_tng_p10__cancelled_at, psc_cancelled_at.tng__monitor__cancelled_at, psc_cancelled_at.tng_p10__cancelled_at, psc_cancelled_at.tng_p10_test_tp__cancelled_at, psc_revoked_at.dust_p01_tng_p10__revoked_at, psc_revoked_at.tng__monitor__revoked_at, psc_revoked_at.tng_p10__revoked_at, psc_revoked_at.tng_p10_test_tp__revoked_at, psc_paused_at.dust_p01_tng_p10__paused_at, psc_paused_at.tng__monitor__paused_at, psc_paused_at.tng_p10__paused_at, psc_paused_at.tng_p10_test_tp__paused_at, dust_p01_tng_p10_ic_dust_mother, tng_p10_ic_buccal_swab_child, tng_p10_ic_buccal_swab_mother, tng_p10_ic_cord_blood_mother, tng_p10_ic_drop_blood_child, tng_p10_ic_stool_child, tng_p10_ic_urine_mother, tng_p10_ic_venous_blood_mother, dust_p01_tng_p10_ic_dl_celpac_studies, dust_p01_tng_p10_ic_survey, tng_p10_ic_follow_up_studies, tng_p10_ic_med_find FROM "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj JOIN "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic ON sic.subject_about_id = sbj.id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic ON scic.id = sic.subcohort_inform_consent_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc ON sc.id = scic.subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__pilot" p ON p.id = sc.pilot_id AND sc.id = p.default_subcohort_id JOIN "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id -- data JOIN proband_subcohort_role psc_role ON psc_role.subject_id = sbj.id JOIN proband_subcohort_state psc_state ON psc_state.subject_id = sbj.id JOIN proband_subcohort_activity_state psc_activity_state ON psc_activity_state.subject_id = sbj.id JOIN proband_subcohort_created_at psc_created_at ON psc_created_at.subject_id = sbj.id JOIN proband_subcohort_accepted_at psc_accepted_at ON psc_accepted_at.subject_id = sbj.id JOIN proband_subcohort_cancelled_at psc_cancelled_at ON psc_cancelled_at.subject_id = sbj.id JOIN proband_subcohort_revoked_at psc_revoked_at ON psc_revoked_at.subject_id = sbj.id JOIN proband_subcohort_paused_at psc_paused_at ON psc_paused_at.subject_id = sbj.id -- ic type BIOMATERIAL LEFT JOIN proband_ic_type_biomaterial_state ict_bio_state ON ict_bio_state.subject_id = sbj.id -- ic type EXTRA LEFT JOIN proband_ic_type_extra_state ict_extra_state ON ict_extra_state.subject_id = sbj.id WHERE sbj.subject_state_code <> 'BLANK' AND ic.inform_consent_type_code = 'SUBCOHORT' AND p.id = 17 -- Pilot ID );
Date: 2025-11-30 05:02:30 Duration: 2s301ms 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 1s589ms 2s642ms 2s115ms 2 4s231ms 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 #6
Day Hour Count Duration Avg duration Nov 30 05 1 1s589ms 1s589ms 17 1 2s642ms 2s642ms [ User: tng_migration_user - Total duration: 4s231ms - Times executed: 2 ]
[ Application: dbt - Total duration: 4s231ms - 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-11-30 17:02:25 Duration: 2s642ms 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-11-30 05:02:30 Duration: 1s589ms 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 2s65ms 2s83ms 2s74ms 2 4s148ms 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 #7
Day Hour Count Duration Avg duration Nov 30 05 1 2s65ms 2s65ms 17 1 2s83ms 2s83ms [ User: tng_migration_user - Total duration: 4s148ms - Times executed: 2 ]
[ Application: dbt - Total duration: 4s148ms - 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-11-30 17:02:26 Duration: 2s83ms 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-11-30 05:02:33 Duration: 2s65ms 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 1s50ms 1s768ms 1s409ms 2 2s819ms 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 Nov 30 05 1 1s50ms 1s50ms 17 1 1s768ms 1s768ms [ User: tng_migration_user - Total duration: 2s819ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s819ms - 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-11-30 17:02:22 Duration: 1s768ms 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-11-30 05:02:28 Duration: 1s50ms 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 1s31ms 1s687ms 1s359ms 2 2s718ms 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 #9
Day Hour Count Duration Avg duration Nov 30 05 1 1s31ms 1s31ms 17 1 1s687ms 1s687ms [ User: tng_migration_user - Total duration: 2s718ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s718ms - 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-11-30 17:02:21 Duration: 1s687ms 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-11-30 05:02:27 Duration: 1s31ms 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 893ms 1s756ms 1s324ms 2 2s649ms 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 #10
Day Hour Count Duration Avg duration Nov 30 05 1 893ms 893ms 17 1 1s756ms 1s756ms [ User: tng_migration_user - Total duration: 2s649ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s649ms - 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-11-30 17:02:25 Duration: 1s756ms 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-11-30 05:02:31 Duration: 893ms 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 1s132ms 2s845ms 1s268ms 189 3m59s refresh materialized view core.mv_subject_form with data;Times Reported Time consuming queries #11
Day Hour Count Duration Avg duration Nov 30 05 10 12s248ms 1s224ms 06 10 12s168ms 1s216ms 07 10 12s340ms 1s234ms 08 10 12s951ms 1s295ms 09 10 12s504ms 1s250ms 10 10 12s434ms 1s243ms 11 10 12s654ms 1s265ms 12 10 12s843ms 1s284ms 13 10 12s741ms 1s274ms 14 10 11s926ms 1s192ms 15 10 12s588ms 1s258ms 16 10 12s364ms 1s236ms 17 9 12s226ms 1s358ms 18 10 12s286ms 1s228ms 19 10 12s322ms 1s232ms 20 10 12s665ms 1s266ms 21 10 12s493ms 1s249ms 22 10 12s371ms 1s237ms 23 10 15s540ms 1s554ms [ User: tng_migration_user - Total duration: 3m59s - Times executed: 189 ]
[ Application: [unknown] - Total duration: 3m59s - Times executed: 189 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-30 23:48:04 Duration: 2s845ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_form WITH DATA;
Date: 2025-11-30 23:54:04 Duration: 2s67ms 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-11-30 17:12:04 Duration: 2s53ms 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 890ms 1s615ms 1s252ms 2 2s505ms create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__12__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_p01__role" text, "psycap_p02_old_ya_p01__role" text, "ya_p01__role" text, "ya_p01_digi_ya03v2__role" text, "ya_p01_digi_ya04v2__role" text, "ya_p01_digi_ya05v2__role" text, "ya_p01_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_p01__state" text, "psycap_p02_old_ya_p01__state" text, "ya_p01__state" text, "ya_p01_digi_ya03v2__state" text, "ya_p01_digi_ya04v2__state" text, "ya_p01_digi_ya05v2__state" text, "ya_p01_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_p01__activity_state" text, "psycap_p02_old_ya_p01__activity_state" text, "ya_p01__activity_state" text, "ya_p01_digi_ya03v2__activity_state" text, "ya_p01_digi_ya04v2__activity_state" text, "ya_p01_digi_ya05v2__activity_state" text, "ya_p01_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_p01__created_at" text, "psycap_p02_old_ya_p01__created_at" text, "ya_p01__created_at" text, "ya_p01_digi_ya03v2__created_at" text, "ya_p01_digi_ya04v2__created_at" text, "ya_p01_digi_ya05v2__created_at" text, "ya_p01_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_p01__accepted_at" text, "psycap_p02_old_ya_p01__accepted_at" text, "ya_p01__accepted_at" text, "ya_p01_digi_ya03v2__accepted_at" text, "ya_p01_digi_ya04v2__accepted_at" text, "ya_p01_digi_ya05v2__accepted_at" text, "ya_p01_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_p01__cancelled_at" text, "psycap_p02_old_ya_p01__cancelled_at" text, "ya_p01__cancelled_at" text, "ya_p01_digi_ya03v2__cancelled_at" text, "ya_p01_digi_ya04v2__cancelled_at" text, "ya_p01_digi_ya05v2__cancelled_at" text, "ya_p01_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_p01__revoked_at" text, "psycap_p02_old_ya_p01__revoked_at" text, "ya_p01__revoked_at" text, "ya_p01_digi_ya03v2__revoked_at" text, "ya_p01_digi_ya04v2__revoked_at" text, "ya_p01_digi_ya05v2__revoked_at" text, "ya_p01_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_p01__paused_at" text, "psycap_p02_old_ya_p01__paused_at" text, "ya_p01__paused_at" text, "ya_p01_digi_ya03v2__paused_at" text, "ya_p01_digi_ya04v2__paused_at" text, "ya_p01_digi_ya05v2__paused_at" text, "ya_p01_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_p01_ic_buccal_swab_proband" text, "ya_p01_ic_urine_proband" text, "ya_p01_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_p01_ic_anam_qs" text, "ya_p01_ic_aneurysm" text, "ya_p01_ic_anthropometry" text, "ya_p01_ic_arch_foot" text, "ya_p01_ic_basic_qs" text, "ya_p01_ic_blood_pressure" text, "ya_p01_ic_braces_piercing_iud" text, "ya_p01_ic_cognition_test" text, "ya_p01_ic_da_health_registry" text, "ya_p01_ic_dexa" text, "ya_p01_ic_enviro_qs" text, "ya_p01_ic_follow_up_studies" text, "ya_p01_ic_fracture_lower_body_last_3m" text, "ya_p01_ic_fracture_upper_body_last_3m" text, "ya_p01_ic_hand_grip" text, "ya_p01_ic_hearing_vision_impairment" text, "ya_p01_ic_heart_disease" text, "ya_p01_ic_hemoptysis_ns" text, "ya_p01_ic_hernia" text, "ya_p01_ic_hyperthyroidism" text, "ya_p01_ic_inability_hold_pencil" text, "ya_p01_ic_inability_stand_both_legs" text, "ya_p01_ic_inability_talk_cze" text, "ya_p01_ic_inability_walk" text, "ya_p01_ic_inbody" text, "ya_p01_ic_infectious_resp_diseases" text, "ya_p01_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p01_ic_knee_stability" text, "ya_p01_ic_med_find" text, "ya_p01_ic_nutri_qs" text, "ya_p01_ic_over_weight_200_height_195" text, "ya_p01_ic_pacemaker_defibrillator" text, "ya_p01_ic_pneumothorax" text, "ya_p01_ic_pregnancy" text, "ya_p01_ic_recent_eye_abdominal_chest_surgery" text, "ya_p01_ic_recent_myocardial_infarction" text, "ya_p01_ic_spirometry" text, "ya_p01_ic_surgical_metal_body" text, "ya_p01_ic_unstable_angina_pectoris" text, "ya_p01_ic_ya_dl_elspac" 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_p01__role, psc_role.psycap_p02_old_ya_p01__role, psc_role.ya_p01__role, psc_role.ya_p01_digi_ya03v2__role, psc_role.ya_p01_digi_ya04v2__role, psc_role.ya_p01_digi_ya05v2__role, psc_role.ya_p01_test__role, psc_state.psycap_p01_ya_p01__state, psc_state.psycap_p02_old_ya_p01__state, psc_state.ya_p01__state, psc_state.ya_p01_digi_ya03v2__state, psc_state.ya_p01_digi_ya04v2__state, psc_state.ya_p01_digi_ya05v2__state, psc_state.ya_p01_test__state, psc_activity_state.psycap_p01_ya_p01__activity_state, psc_activity_state.psycap_p02_old_ya_p01__activity_state, psc_activity_state.ya_p01__activity_state, psc_activity_state.ya_p01_digi_ya03v2__activity_state, psc_activity_state.ya_p01_digi_ya04v2__activity_state, psc_activity_state.ya_p01_digi_ya05v2__activity_state, psc_activity_state.ya_p01_test__activity_state, psc_created_at.psycap_p01_ya_p01__created_at, psc_created_at.psycap_p02_old_ya_p01__created_at, psc_created_at.ya_p01__created_at, psc_created_at.ya_p01_digi_ya03v2__created_at, psc_created_at.ya_p01_digi_ya04v2__created_at, psc_created_at.ya_p01_digi_ya05v2__created_at, psc_created_at.ya_p01_test__created_at, psc_accepted_at.psycap_p01_ya_p01__accepted_at, psc_accepted_at.psycap_p02_old_ya_p01__accepted_at, psc_accepted_at.ya_p01__accepted_at, psc_accepted_at.ya_p01_digi_ya03v2__accepted_at, psc_accepted_at.ya_p01_digi_ya04v2__accepted_at, psc_accepted_at.ya_p01_digi_ya05v2__accepted_at, psc_accepted_at.ya_p01_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p01__cancelled_at, psc_cancelled_at.ya_p01__cancelled_at, psc_cancelled_at.ya_p01_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p01_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p01__revoked_at, psc_revoked_at.psycap_p02_old_ya_p01__revoked_at, psc_revoked_at.ya_p01__revoked_at, psc_revoked_at.ya_p01_digi_ya03v2__revoked_at, psc_revoked_at.ya_p01_digi_ya04v2__revoked_at, psc_revoked_at.ya_p01_digi_ya05v2__revoked_at, psc_revoked_at.ya_p01_test__revoked_at, psc_paused_at.psycap_p01_ya_p01__paused_at, psc_paused_at.psycap_p02_old_ya_p01__paused_at, psc_paused_at.ya_p01__paused_at, psc_paused_at.ya_p01_digi_ya03v2__paused_at, psc_paused_at.ya_p01_digi_ya04v2__paused_at, psc_paused_at.ya_p01_digi_ya05v2__paused_at, psc_paused_at.ya_p01_test__paused_at, ya_p01_ic_buccal_swab_proband, ya_p01_ic_urine_proband, ya_p01_ic_venous_blood_proband, ya_p01_ic_anam_qs, ya_p01_ic_aneurysm, ya_p01_ic_anthropometry, ya_p01_ic_arch_foot, ya_p01_ic_basic_qs, ya_p01_ic_blood_pressure, ya_p01_ic_braces_piercing_iud, ya_p01_ic_cognition_test, ya_p01_ic_da_health_registry, ya_p01_ic_dexa, ya_p01_ic_enviro_qs, ya_p01_ic_follow_up_studies, ya_p01_ic_fracture_lower_body_last_3m, ya_p01_ic_fracture_upper_body_last_3m, ya_p01_ic_hand_grip, ya_p01_ic_hearing_vision_impairment, ya_p01_ic_heart_disease, ya_p01_ic_hemoptysis_ns, ya_p01_ic_hernia, ya_p01_ic_hyperthyroidism, ya_p01_ic_inability_hold_pencil, ya_p01_ic_inability_stand_both_legs, ya_p01_ic_inability_talk_cze, ya_p01_ic_inability_walk, ya_p01_ic_inbody, ya_p01_ic_infectious_resp_diseases, ya_p01_ic_iodine_barium_radioisotopes_last_7d, ya_p01_ic_knee_stability, ya_p01_ic_med_find, ya_p01_ic_nutri_qs, ya_p01_ic_over_weight_200_height_195, ya_p01_ic_pacemaker_defibrillator, ya_p01_ic_pneumothorax, ya_p01_ic_pregnancy, ya_p01_ic_recent_eye_abdominal_chest_surgery, ya_p01_ic_recent_myocardial_infarction, ya_p01_ic_spirometry, ya_p01_ic_surgical_metal_body, ya_p01_ic_unstable_angina_pectoris, ya_p01_ic_ya_dl_elspac from "celspac"."dbt_stg"."stg_celspac_admin__subject" sbj join "celspac"."dbt_stg"."stg_celspac_admin__subject_inform_consent" sic on sic.subject_about_id = sbj.id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort_inform_consent" scic on scic.id = sic.subcohort_inform_consent_id join "celspac"."dbt_stg"."stg_celspac_admin__subcohort" sc on sc.id = scic.subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__pilot" p on p.id = sc.pilot_id and sc.id = p.default_subcohort_id join "celspac"."dbt_stg"."stg_celspac_admin__inform_consent" ic on ic.id = scic.info_consent_id join proband_subcohort_role psc_role on psc_role.subject_id = sbj.id join proband_subcohort_state psc_state on psc_state.subject_id = sbj.id join proband_subcohort_activity_state psc_activity_state on psc_activity_state.subject_id = sbj.id join proband_subcohort_created_at psc_created_at on psc_created_at.subject_id = sbj.id join proband_subcohort_accepted_at psc_accepted_at on psc_accepted_at.subject_id = sbj.id join proband_subcohort_cancelled_at psc_cancelled_at on psc_cancelled_at.subject_id = sbj.id join proband_subcohort_revoked_at psc_revoked_at on psc_revoked_at.subject_id = sbj.id join proband_subcohort_paused_at psc_paused_at on psc_paused_at.subject_id = sbj.id left join proband_ic_type_biomaterial_state ict_bio_state on ict_bio_state.subject_id = sbj.id left join proband_ic_type_extra_state ict_extra_state on ict_extra_state.subject_id = sbj.id where sbj.subject_state_code <> ? and ic.inform_consent_type_code = ? and p.id = ? );Times Reported Time consuming queries #12
Day Hour Count Duration Avg duration Nov 30 05 1 890ms 890ms 17 1 1s615ms 1s615ms [ User: tng_migration_user - Total duration: 2s505ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s505ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__12"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__12__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA Pilot I, Pilot ID: 12 -- 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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p01__role" text, "psycap_p02_old_ya_p01__role" text, "ya_p01__role" text, "ya_p01_digi_ya03v2__role" text, "ya_p01_digi_ya04v2__role" text, "ya_p01_digi_ya05v2__role" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p01__state" text, "psycap_p02_old_ya_p01__state" text, "ya_p01__state" text, "ya_p01_digi_ya03v2__state" text, "ya_p01_digi_ya04v2__state" text, "ya_p01_digi_ya05v2__state" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p01__activity_state" text, "psycap_p02_old_ya_p01__activity_state" text, "ya_p01__activity_state" text, "ya_p01_digi_ya03v2__activity_state" text, "ya_p01_digi_ya04v2__activity_state" text, "ya_p01_digi_ya05v2__activity_state" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p01__created_at" text, "psycap_p02_old_ya_p01__created_at" text, "ya_p01__created_at" text, "ya_p01_digi_ya03v2__created_at" text, "ya_p01_digi_ya04v2__created_at" text, "ya_p01_digi_ya05v2__created_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p01__accepted_at" text, "psycap_p02_old_ya_p01__accepted_at" text, "ya_p01__accepted_at" text, "ya_p01_digi_ya03v2__accepted_at" text, "ya_p01_digi_ya04v2__accepted_at" text, "ya_p01_digi_ya05v2__accepted_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p01__cancelled_at" text, "psycap_p02_old_ya_p01__cancelled_at" text, "ya_p01__cancelled_at" text, "ya_p01_digi_ya03v2__cancelled_at" text, "ya_p01_digi_ya04v2__cancelled_at" text, "ya_p01_digi_ya05v2__cancelled_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p01__revoked_at" text, "psycap_p02_old_ya_p01__revoked_at" text, "ya_p01__revoked_at" text, "ya_p01_digi_ya03v2__revoked_at" text, "ya_p01_digi_ya04v2__revoked_at" text, "ya_p01_digi_ya05v2__revoked_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p01__paused_at" text, "psycap_p02_old_ya_p01__paused_at" text, "ya_p01__paused_at" text, "ya_p01_digi_ya03v2__paused_at" text, "ya_p01_digi_ya04v2__paused_at" text, "ya_p01_digi_ya05v2__paused_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p01_ic_buccal_swab_proband'), ('ya_p01_ic_urine_proband'), ('ya_p01_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p01_ic_buccal_swab_proband" text, "ya_p01_ic_urine_proband" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p01_ic_anam_qs'), ('ya_p01_ic_aneurysm'), ('ya_p01_ic_anthropometry'), ('ya_p01_ic_arch_foot'), ('ya_p01_ic_basic_qs'), ('ya_p01_ic_blood_pressure'), ('ya_p01_ic_braces_piercing_iud'), ('ya_p01_ic_cognition_test'), ('ya_p01_ic_da_health_registry'), ('ya_p01_ic_dexa'), ('ya_p01_ic_enviro_qs'), ('ya_p01_ic_follow_up_studies'), ('ya_p01_ic_fracture_lower_body_last_3m'), ('ya_p01_ic_fracture_upper_body_last_3m'), ('ya_p01_ic_hand_grip'), ('ya_p01_ic_hearing_vision_impairment'), ('ya_p01_ic_heart_disease'), ('ya_p01_ic_hemoptysis_ns'), ('ya_p01_ic_hernia'), ('ya_p01_ic_hyperthyroidism'), ('ya_p01_ic_inability_hold_pencil'), ('ya_p01_ic_inability_stand_both_legs'), ('ya_p01_ic_inability_talk_cze'), ('ya_p01_ic_inability_walk'), ('ya_p01_ic_inbody'), ('ya_p01_ic_infectious_resp_diseases'), ('ya_p01_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p01_ic_knee_stability'), ('ya_p01_ic_med_find'), ('ya_p01_ic_nutri_qs'), ('ya_p01_ic_over_weight_200_height_195'), ('ya_p01_ic_pacemaker_defibrillator'), ('ya_p01_ic_pneumothorax'), ('ya_p01_ic_pregnancy'), ('ya_p01_ic_recent_eye_abdominal_chest_surgery'), ('ya_p01_ic_recent_myocardial_infarction'), ('ya_p01_ic_spirometry'), ('ya_p01_ic_surgical_metal_body'), ('ya_p01_ic_unstable_angina_pectoris'), ('ya_p01_ic_ya_dl_elspac') $$ ) AS extra_state ("subject_id" int, "ya_p01_ic_anam_qs" text, "ya_p01_ic_aneurysm" text, "ya_p01_ic_anthropometry" text, "ya_p01_ic_arch_foot" text, "ya_p01_ic_basic_qs" text, "ya_p01_ic_blood_pressure" text, "ya_p01_ic_braces_piercing_iud" text, "ya_p01_ic_cognition_test" text, "ya_p01_ic_da_health_registry" text, "ya_p01_ic_dexa" text, "ya_p01_ic_enviro_qs" text, "ya_p01_ic_follow_up_studies" text, "ya_p01_ic_fracture_lower_body_last_3m" text, "ya_p01_ic_fracture_upper_body_last_3m" text, "ya_p01_ic_hand_grip" text, "ya_p01_ic_hearing_vision_impairment" text, "ya_p01_ic_heart_disease" text, "ya_p01_ic_hemoptysis_ns" text, "ya_p01_ic_hernia" text, "ya_p01_ic_hyperthyroidism" text, "ya_p01_ic_inability_hold_pencil" text, "ya_p01_ic_inability_stand_both_legs" text, "ya_p01_ic_inability_talk_cze" text, "ya_p01_ic_inability_walk" text, "ya_p01_ic_inbody" text, "ya_p01_ic_infectious_resp_diseases" text, "ya_p01_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p01_ic_knee_stability" text, "ya_p01_ic_med_find" text, "ya_p01_ic_nutri_qs" text, "ya_p01_ic_over_weight_200_height_195" text, "ya_p01_ic_pacemaker_defibrillator" text, "ya_p01_ic_pneumothorax" text, "ya_p01_ic_pregnancy" text, "ya_p01_ic_recent_eye_abdominal_chest_surgery" text, "ya_p01_ic_recent_myocardial_infarction" text, "ya_p01_ic_spirometry" text, "ya_p01_ic_surgical_metal_body" text, "ya_p01_ic_unstable_angina_pectoris" text, "ya_p01_ic_ya_dl_elspac" 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_p01__role, psc_role.psycap_p02_old_ya_p01__role, psc_role.ya_p01__role, psc_role.ya_p01_digi_ya03v2__role, psc_role.ya_p01_digi_ya04v2__role, psc_role.ya_p01_digi_ya05v2__role, psc_role.ya_p01_test__role, psc_state.psycap_p01_ya_p01__state, psc_state.psycap_p02_old_ya_p01__state, psc_state.ya_p01__state, psc_state.ya_p01_digi_ya03v2__state, psc_state.ya_p01_digi_ya04v2__state, psc_state.ya_p01_digi_ya05v2__state, psc_state.ya_p01_test__state, psc_activity_state.psycap_p01_ya_p01__activity_state, psc_activity_state.psycap_p02_old_ya_p01__activity_state, psc_activity_state.ya_p01__activity_state, psc_activity_state.ya_p01_digi_ya03v2__activity_state, psc_activity_state.ya_p01_digi_ya04v2__activity_state, psc_activity_state.ya_p01_digi_ya05v2__activity_state, psc_activity_state.ya_p01_test__activity_state, psc_created_at.psycap_p01_ya_p01__created_at, psc_created_at.psycap_p02_old_ya_p01__created_at, psc_created_at.ya_p01__created_at, psc_created_at.ya_p01_digi_ya03v2__created_at, psc_created_at.ya_p01_digi_ya04v2__created_at, psc_created_at.ya_p01_digi_ya05v2__created_at, psc_created_at.ya_p01_test__created_at, psc_accepted_at.psycap_p01_ya_p01__accepted_at, psc_accepted_at.psycap_p02_old_ya_p01__accepted_at, psc_accepted_at.ya_p01__accepted_at, psc_accepted_at.ya_p01_digi_ya03v2__accepted_at, psc_accepted_at.ya_p01_digi_ya04v2__accepted_at, psc_accepted_at.ya_p01_digi_ya05v2__accepted_at, psc_accepted_at.ya_p01_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p01__cancelled_at, psc_cancelled_at.ya_p01__cancelled_at, psc_cancelled_at.ya_p01_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p01_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p01__revoked_at, psc_revoked_at.psycap_p02_old_ya_p01__revoked_at, psc_revoked_at.ya_p01__revoked_at, psc_revoked_at.ya_p01_digi_ya03v2__revoked_at, psc_revoked_at.ya_p01_digi_ya04v2__revoked_at, psc_revoked_at.ya_p01_digi_ya05v2__revoked_at, psc_revoked_at.ya_p01_test__revoked_at, psc_paused_at.psycap_p01_ya_p01__paused_at, psc_paused_at.psycap_p02_old_ya_p01__paused_at, psc_paused_at.ya_p01__paused_at, psc_paused_at.ya_p01_digi_ya03v2__paused_at, psc_paused_at.ya_p01_digi_ya04v2__paused_at, psc_paused_at.ya_p01_digi_ya05v2__paused_at, psc_paused_at.ya_p01_test__paused_at, ya_p01_ic_buccal_swab_proband, ya_p01_ic_urine_proband, ya_p01_ic_venous_blood_proband, ya_p01_ic_anam_qs, ya_p01_ic_aneurysm, ya_p01_ic_anthropometry, ya_p01_ic_arch_foot, ya_p01_ic_basic_qs, ya_p01_ic_blood_pressure, ya_p01_ic_braces_piercing_iud, ya_p01_ic_cognition_test, ya_p01_ic_da_health_registry, ya_p01_ic_dexa, ya_p01_ic_enviro_qs, ya_p01_ic_follow_up_studies, ya_p01_ic_fracture_lower_body_last_3m, ya_p01_ic_fracture_upper_body_last_3m, ya_p01_ic_hand_grip, ya_p01_ic_hearing_vision_impairment, ya_p01_ic_heart_disease, ya_p01_ic_hemoptysis_ns, ya_p01_ic_hernia, ya_p01_ic_hyperthyroidism, ya_p01_ic_inability_hold_pencil, ya_p01_ic_inability_stand_both_legs, ya_p01_ic_inability_talk_cze, ya_p01_ic_inability_walk, ya_p01_ic_inbody, ya_p01_ic_infectious_resp_diseases, ya_p01_ic_iodine_barium_radioisotopes_last_7d, ya_p01_ic_knee_stability, ya_p01_ic_med_find, ya_p01_ic_nutri_qs, ya_p01_ic_over_weight_200_height_195, ya_p01_ic_pacemaker_defibrillator, ya_p01_ic_pneumothorax, ya_p01_ic_pregnancy, ya_p01_ic_recent_eye_abdominal_chest_surgery, ya_p01_ic_recent_myocardial_infarction, ya_p01_ic_spirometry, ya_p01_ic_surgical_metal_body, ya_p01_ic_unstable_angina_pectoris, ya_p01_ic_ya_dl_elspac 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 = 12 -- Pilot ID );
Date: 2025-11-30 17:02:22 Duration: 1s615ms 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__12"} */ create table "celspac"."dbt_marts_dbt"."export_proband_by_pilot__12__dbt_tmp" as ( -- suject (proband) patrici do kohorty YA Pilot I, Pilot ID: 12 -- 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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p01__role" text, "psycap_p02_old_ya_p01__role" text, "ya_p01__role" text, "ya_p01_digi_ya03v2__role" text, "ya_p01_digi_ya04v2__role" text, "ya_p01_digi_ya05v2__role" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS role ("subject_id" int, "psycap_p01_ya_p01__state" text, "psycap_p02_old_ya_p01__state" text, "ya_p01__state" text, "ya_p01_digi_ya03v2__state" text, "ya_p01_digi_ya04v2__state" text, "ya_p01_digi_ya05v2__state" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS activity ("subject_id" int, "psycap_p01_ya_p01__activity_state" text, "psycap_p02_old_ya_p01__activity_state" text, "ya_p01__activity_state" text, "ya_p01_digi_ya03v2__activity_state" text, "ya_p01_digi_ya04v2__activity_state" text, "ya_p01_digi_ya05v2__activity_state" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS created_at ("subject_id" int, "psycap_p01_ya_p01__created_at" text, "psycap_p02_old_ya_p01__created_at" text, "ya_p01__created_at" text, "ya_p01_digi_ya03v2__created_at" text, "ya_p01_digi_ya04v2__created_at" text, "ya_p01_digi_ya05v2__created_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS accepted_at ("subject_id" int, "psycap_p01_ya_p01__accepted_at" text, "psycap_p02_old_ya_p01__accepted_at" text, "ya_p01__accepted_at" text, "ya_p01_digi_ya03v2__accepted_at" text, "ya_p01_digi_ya04v2__accepted_at" text, "ya_p01_digi_ya05v2__accepted_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS cancelled_at ("subject_id" int, "psycap_p01_ya_p01__cancelled_at" text, "psycap_p02_old_ya_p01__cancelled_at" text, "ya_p01__cancelled_at" text, "ya_p01_digi_ya03v2__cancelled_at" text, "ya_p01_digi_ya04v2__cancelled_at" text, "ya_p01_digi_ya05v2__cancelled_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS revoked_at ("subject_id" int, "psycap_p01_ya_p01__revoked_at" text, "psycap_p02_old_ya_p01__revoked_at" text, "ya_p01__revoked_at" text, "ya_p01_digi_ya03v2__revoked_at" text, "ya_p01_digi_ya04v2__revoked_at" text, "ya_p01_digi_ya05v2__revoked_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('psycap_p01_ya_p01'), ('psycap_p02_old_ya_p01'), ('ya_p01'), ('ya_p01_digi_ya03v2'), ('ya_p01_digi_ya04v2'), ('ya_p01_digi_ya05v2'), ('ya_p01_test') $$ ) AS paused_at ("subject_id" int, "psycap_p01_ya_p01__paused_at" text, "psycap_p02_old_ya_p01__paused_at" text, "ya_p01__paused_at" text, "ya_p01_digi_ya03v2__paused_at" text, "ya_p01_digi_ya04v2__paused_at" text, "ya_p01_digi_ya05v2__paused_at" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p01_ic_buccal_swab_proband'), ('ya_p01_ic_urine_proband'), ('ya_p01_ic_venous_blood_proband') $$ ) AS biomaterial_state ("subject_id" int, "ya_p01_ic_buccal_swab_proband" text, "ya_p01_ic_urine_proband" text, "ya_p01_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 = 12 -- Pilot ID ORDER BY 1, 2 $$, $$ VALUES ('ya_p01_ic_anam_qs'), ('ya_p01_ic_aneurysm'), ('ya_p01_ic_anthropometry'), ('ya_p01_ic_arch_foot'), ('ya_p01_ic_basic_qs'), ('ya_p01_ic_blood_pressure'), ('ya_p01_ic_braces_piercing_iud'), ('ya_p01_ic_cognition_test'), ('ya_p01_ic_da_health_registry'), ('ya_p01_ic_dexa'), ('ya_p01_ic_enviro_qs'), ('ya_p01_ic_follow_up_studies'), ('ya_p01_ic_fracture_lower_body_last_3m'), ('ya_p01_ic_fracture_upper_body_last_3m'), ('ya_p01_ic_hand_grip'), ('ya_p01_ic_hearing_vision_impairment'), ('ya_p01_ic_heart_disease'), ('ya_p01_ic_hemoptysis_ns'), ('ya_p01_ic_hernia'), ('ya_p01_ic_hyperthyroidism'), ('ya_p01_ic_inability_hold_pencil'), ('ya_p01_ic_inability_stand_both_legs'), ('ya_p01_ic_inability_talk_cze'), ('ya_p01_ic_inability_walk'), ('ya_p01_ic_inbody'), ('ya_p01_ic_infectious_resp_diseases'), ('ya_p01_ic_iodine_barium_radioisotopes_last_7d'), ('ya_p01_ic_knee_stability'), ('ya_p01_ic_med_find'), ('ya_p01_ic_nutri_qs'), ('ya_p01_ic_over_weight_200_height_195'), ('ya_p01_ic_pacemaker_defibrillator'), ('ya_p01_ic_pneumothorax'), ('ya_p01_ic_pregnancy'), ('ya_p01_ic_recent_eye_abdominal_chest_surgery'), ('ya_p01_ic_recent_myocardial_infarction'), ('ya_p01_ic_spirometry'), ('ya_p01_ic_surgical_metal_body'), ('ya_p01_ic_unstable_angina_pectoris'), ('ya_p01_ic_ya_dl_elspac') $$ ) AS extra_state ("subject_id" int, "ya_p01_ic_anam_qs" text, "ya_p01_ic_aneurysm" text, "ya_p01_ic_anthropometry" text, "ya_p01_ic_arch_foot" text, "ya_p01_ic_basic_qs" text, "ya_p01_ic_blood_pressure" text, "ya_p01_ic_braces_piercing_iud" text, "ya_p01_ic_cognition_test" text, "ya_p01_ic_da_health_registry" text, "ya_p01_ic_dexa" text, "ya_p01_ic_enviro_qs" text, "ya_p01_ic_follow_up_studies" text, "ya_p01_ic_fracture_lower_body_last_3m" text, "ya_p01_ic_fracture_upper_body_last_3m" text, "ya_p01_ic_hand_grip" text, "ya_p01_ic_hearing_vision_impairment" text, "ya_p01_ic_heart_disease" text, "ya_p01_ic_hemoptysis_ns" text, "ya_p01_ic_hernia" text, "ya_p01_ic_hyperthyroidism" text, "ya_p01_ic_inability_hold_pencil" text, "ya_p01_ic_inability_stand_both_legs" text, "ya_p01_ic_inability_talk_cze" text, "ya_p01_ic_inability_walk" text, "ya_p01_ic_inbody" text, "ya_p01_ic_infectious_resp_diseases" text, "ya_p01_ic_iodine_barium_radioisotopes_last_7d" text, "ya_p01_ic_knee_stability" text, "ya_p01_ic_med_find" text, "ya_p01_ic_nutri_qs" text, "ya_p01_ic_over_weight_200_height_195" text, "ya_p01_ic_pacemaker_defibrillator" text, "ya_p01_ic_pneumothorax" text, "ya_p01_ic_pregnancy" text, "ya_p01_ic_recent_eye_abdominal_chest_surgery" text, "ya_p01_ic_recent_myocardial_infarction" text, "ya_p01_ic_spirometry" text, "ya_p01_ic_surgical_metal_body" text, "ya_p01_ic_unstable_angina_pectoris" text, "ya_p01_ic_ya_dl_elspac" 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_p01__role, psc_role.psycap_p02_old_ya_p01__role, psc_role.ya_p01__role, psc_role.ya_p01_digi_ya03v2__role, psc_role.ya_p01_digi_ya04v2__role, psc_role.ya_p01_digi_ya05v2__role, psc_role.ya_p01_test__role, psc_state.psycap_p01_ya_p01__state, psc_state.psycap_p02_old_ya_p01__state, psc_state.ya_p01__state, psc_state.ya_p01_digi_ya03v2__state, psc_state.ya_p01_digi_ya04v2__state, psc_state.ya_p01_digi_ya05v2__state, psc_state.ya_p01_test__state, psc_activity_state.psycap_p01_ya_p01__activity_state, psc_activity_state.psycap_p02_old_ya_p01__activity_state, psc_activity_state.ya_p01__activity_state, psc_activity_state.ya_p01_digi_ya03v2__activity_state, psc_activity_state.ya_p01_digi_ya04v2__activity_state, psc_activity_state.ya_p01_digi_ya05v2__activity_state, psc_activity_state.ya_p01_test__activity_state, psc_created_at.psycap_p01_ya_p01__created_at, psc_created_at.psycap_p02_old_ya_p01__created_at, psc_created_at.ya_p01__created_at, psc_created_at.ya_p01_digi_ya03v2__created_at, psc_created_at.ya_p01_digi_ya04v2__created_at, psc_created_at.ya_p01_digi_ya05v2__created_at, psc_created_at.ya_p01_test__created_at, psc_accepted_at.psycap_p01_ya_p01__accepted_at, psc_accepted_at.psycap_p02_old_ya_p01__accepted_at, psc_accepted_at.ya_p01__accepted_at, psc_accepted_at.ya_p01_digi_ya03v2__accepted_at, psc_accepted_at.ya_p01_digi_ya04v2__accepted_at, psc_accepted_at.ya_p01_digi_ya05v2__accepted_at, psc_accepted_at.ya_p01_test__accepted_at, psc_cancelled_at.psycap_p01_ya_p01__cancelled_at, psc_cancelled_at.psycap_p02_old_ya_p01__cancelled_at, psc_cancelled_at.ya_p01__cancelled_at, psc_cancelled_at.ya_p01_digi_ya03v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya04v2__cancelled_at, psc_cancelled_at.ya_p01_digi_ya05v2__cancelled_at, psc_cancelled_at.ya_p01_test__cancelled_at, psc_revoked_at.psycap_p01_ya_p01__revoked_at, psc_revoked_at.psycap_p02_old_ya_p01__revoked_at, psc_revoked_at.ya_p01__revoked_at, psc_revoked_at.ya_p01_digi_ya03v2__revoked_at, psc_revoked_at.ya_p01_digi_ya04v2__revoked_at, psc_revoked_at.ya_p01_digi_ya05v2__revoked_at, psc_revoked_at.ya_p01_test__revoked_at, psc_paused_at.psycap_p01_ya_p01__paused_at, psc_paused_at.psycap_p02_old_ya_p01__paused_at, psc_paused_at.ya_p01__paused_at, psc_paused_at.ya_p01_digi_ya03v2__paused_at, psc_paused_at.ya_p01_digi_ya04v2__paused_at, psc_paused_at.ya_p01_digi_ya05v2__paused_at, psc_paused_at.ya_p01_test__paused_at, ya_p01_ic_buccal_swab_proband, ya_p01_ic_urine_proband, ya_p01_ic_venous_blood_proband, ya_p01_ic_anam_qs, ya_p01_ic_aneurysm, ya_p01_ic_anthropometry, ya_p01_ic_arch_foot, ya_p01_ic_basic_qs, ya_p01_ic_blood_pressure, ya_p01_ic_braces_piercing_iud, ya_p01_ic_cognition_test, ya_p01_ic_da_health_registry, ya_p01_ic_dexa, ya_p01_ic_enviro_qs, ya_p01_ic_follow_up_studies, ya_p01_ic_fracture_lower_body_last_3m, ya_p01_ic_fracture_upper_body_last_3m, ya_p01_ic_hand_grip, ya_p01_ic_hearing_vision_impairment, ya_p01_ic_heart_disease, ya_p01_ic_hemoptysis_ns, ya_p01_ic_hernia, ya_p01_ic_hyperthyroidism, ya_p01_ic_inability_hold_pencil, ya_p01_ic_inability_stand_both_legs, ya_p01_ic_inability_talk_cze, ya_p01_ic_inability_walk, ya_p01_ic_inbody, ya_p01_ic_infectious_resp_diseases, ya_p01_ic_iodine_barium_radioisotopes_last_7d, ya_p01_ic_knee_stability, ya_p01_ic_med_find, ya_p01_ic_nutri_qs, ya_p01_ic_over_weight_200_height_195, ya_p01_ic_pacemaker_defibrillator, ya_p01_ic_pneumothorax, ya_p01_ic_pregnancy, ya_p01_ic_recent_eye_abdominal_chest_surgery, ya_p01_ic_recent_myocardial_infarction, ya_p01_ic_spirometry, ya_p01_ic_surgical_metal_body, ya_p01_ic_unstable_angina_pectoris, ya_p01_ic_ya_dl_elspac 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 = 12 -- Pilot ID );
Date: 2025-11-30 05:02:27 Duration: 890ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
13 1s209ms 1s233ms 1s221ms 2 2s443ms create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( with ranked_table_con as ( select *, row_number() over (partition by subject_id, type_code order by priority desc ) as ranked_row from "celspac"."core"."contact" where value -> ? = ?), ranked_table_contact as ( select *, row_number() over (partition by subject_id, type_code order by priority desc ) as ranked_row from "celspac"."core"."contact"), max_prio_perm as ( select * from ranked_table_con where ranked_row = ?), contact_table_max_prio as ( select * from ranked_table_contact where ranked_row = ?), contact_d as ( select distinct subject_id, replace((value -> ?)::text, ?, ? ) AS city, replace((value -> ?)::text, ?, ? ) as postal_code, replace((value -> ?)::text, ?, ? ) AS country, replace((value -> ?)::text, ?, ? ) as street, replace((value -> ?)::text, ?, ? ) AS street_number, replace((value -> ?)::text, ?, ? ) as permanent from max_prio_perm con where con.type_code = ?), contact_d_c as ( select distinct subject_id, replace((value -> ?)::text, ?, ? ) AS city, replace((value -> ?)::text, ?, ? ) as postal_code, replace((value -> ?)::text, ?, ? ) AS country, replace((value -> ?)::text, ?, ? ) as street, replace((value -> ?)::text, ?, ? ) AS street_number, replace((value -> ?)::text, ?, ? ) as permanent from contact_table_max_prio con where con.type_code = ?), con_email as ( select subject_id, replace(value::text, ?, ? ) AS email FROM contact_table_max_prio con WHERE con.type_code = ?), con_ph AS ( SELECT subject_id, replace(value::text, ?, ? ) as phone_number from contact_table_max_prio where type_code = ? ) select s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number as street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street as street_contact, con_d_c.street_number as street_number_contact, con_d_c.city as city_contact, con_d_c.postal_code as postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* from "celspac"."core"."subject" s left join "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se on se.subject_id = s.id left join "celspac"."core"."subject_dead" s_dead on s.id = s_dead.subject_id left join contact_d con_d on con_d.subject_id = s.id left join contact_d_c con_d_c on con_d_c.subject_id = s.id left join con_email c_e on c_e.subject_id = s.id left join con_ph c_p on c_p.subject_id = s.id );Times Reported Time consuming queries #13
Day Hour Count Duration Avg duration Nov 30 05 1 1s209ms 1s209ms 17 1 1s233ms 1s233ms [ User: tng_migration_user - Total duration: 2s443ms - Times executed: 2 ]
[ Application: dbt - Total duration: 2s443ms - Times executed: 2 ]
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.stg_celspac_admin__subject"} */ create table "celspac"."dbt_stg"."stg_celspac_admin__subject__dbt_tmp" as ( WITH ranked_table_con AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact" WHERE value -> 'permanent' = 'true'), ranked_table_contact AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY subject_id, type_code ORDER BY priority DESC ) AS ranked_row FROM "celspac"."core"."contact"), max_prio_perm AS ( SELECT * FROM ranked_table_con WHERE ranked_row = 1), contact_table_max_prio AS ( SELECT * FROM ranked_table_contact WHERE ranked_row = 1), contact_d AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM max_prio_perm con WHERE con.type_code = 'ADDRESS'), contact_d_c AS ( SELECT DISTINCT subject_id, replace((value -> 'municipality')::text, '"', '' ) AS city, replace((value -> 'postalcode')::text, '"', '' ) AS postal_code, replace((value -> 'country')::text, '"', '' ) AS country, replace((value -> 'streetname')::text, '"', '' ) AS street, replace((value -> 'streetnumber')::text, '"', '' ) AS street_number, replace((value -> 'permanent')::text, '"', '' ) AS permanent FROM contact_table_max_prio con WHERE con.type_code = 'ADDRESS'), con_email AS ( SELECT subject_id, replace(value::text, '"', '' ) AS email FROM contact_table_max_prio con WHERE con.type_code = 'EMAIL'), con_ph AS ( SELECT subject_id, replace(value::text, '"', '' ) AS phone_number FROM contact_table_max_prio WHERE type_code = 'PHONE' ) SELECT s.id, s.subject_state_code, s.sex_code, s.family_id, s.elspac_family_relationship_type_code, s.is_origin_elspac, s.family_code, s.owner_user_id, s.owner_group_id, s.name, s.surname, s.titles_before, s.titles_after, s.description, s.rc, s.tng_id, s.puk, s.birthdate, s_dead.death_by, s_dead.death_at, s_dead.date_of_death, s_dead.cause_of_death, c_e.email, c_p.phone_number, con_d.city, con_d.street, con_d.street_number AS street_number, con_d.postal_code, con_d.country, con_d.permanent, con_d_c.street AS street_contact, con_d_c.street_number AS street_number_contact, con_d_c.city AS city_contact, con_d_c.postal_code AS postal_code_contact, con_d_c.country as country_contact, s.is_archived, s.user_id, s.maiden_name, s.test_proband, s.created_by, s.enrolled_by, s.created_at, s.enrolled_at, s.anonym_by, s.anonym_at, se.* FROM "celspac"."core"."subject" s LEFT JOIN "celspac"."dbt_stg"."inte_unique_subject_extend_columns" se ON se.subject_id = s.id LEFT JOIN "celspac"."core"."subject_dead" s_dead ON s.id = s_dead.subject_id LEFT JOIN contact_d con_d ON con_d.subject_id = s.id LEFT JOIN contact_d_c con_d_c ON con_d_c.subject_id = s.id LEFT JOIN con_email c_e ON c_e.subject_id = s.id LEFT JOIN con_ph c_p ON c_p.subject_id = s.id );
Date: 2025-11-30 17:02:18 Duration: 1s233ms 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-11-30 05:02:23 Duration: 1s209ms 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-11-30 05:02:23 Duration: 0ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt
14 114ms 495ms 144ms 126 18s251ms refresh materialized view core.mv_subject_event with data;Times Reported Time consuming queries #14
Day Hour Count Duration Avg duration Nov 30 06 7 1s113ms 159ms 07 7 1s317ms 188ms 08 7 917ms 131ms 09 7 979ms 139ms 10 7 881ms 125ms 11 7 1s162ms 166ms 12 7 966ms 138ms 13 7 959ms 137ms 14 7 944ms 134ms 15 7 979ms 139ms 16 7 962ms 137ms 17 7 1s 142ms 18 7 977ms 139ms 19 7 920ms 131ms 20 7 980ms 140ms 21 7 1s263ms 180ms 22 7 931ms 133ms 23 7 992ms 141ms [ User: tng_migration_user - Total duration: 18s251ms - Times executed: 126 ]
[ Application: [unknown] - Total duration: 18s251ms - Times executed: 126 ]
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-30 07:14:02 Duration: 495ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-30 21:05:02 Duration: 477ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: [unknown] Bind query: yes Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
REFRESH MATERIALIZED VIEW core.mv_subject_event WITH DATA;
Date: 2025-11-30 11:50:01 Duration: 367ms 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 252ms 84ms 160 13s548ms 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 Nov 30 05 80 6s723ms 84ms 17 80 6s824ms 85ms [ User: tng_migration_user - Total duration: 13s548ms - Times executed: 160 ]
[ Application: dbt - Total duration: 13s548ms - 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-11-30 05:02:24 Duration: 252ms 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-11-30 17:02:22 Duration: 244ms 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-11-30 17:02:22 Duration: 235ms 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 37ms 272ms 75ms 156 11s848ms 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 Nov 30 05 78 5s536ms 70ms 17 78 6s311ms 80ms [ User: tng_migration_user - Total duration: 11s848ms - Times executed: 156 ]
[ Application: dbt - Total duration: 11s848ms - 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-11-30 17:02:23 Duration: 272ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
/* {"app": "dbt", "dbt_version": "1.9.1", "profile_name": "celspacadmindbt", "target_name": "main", "node_id": "model.celspacadmindbt.export_proband_by_pilot__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-11-30 17:02:20 Duration: 146ms 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-11-30 17:02:23 Duration: 130ms 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 6ms 2ms 854 2s495ms update scheduled_command set last_execution = ?, locked = ?, version = version + ? where id = ? and version = ?;Times Reported Time consuming queries #17
Day Hour Count Duration Avg duration Nov 30 05 11 34ms 3ms 06 47 132ms 2ms 07 47 134ms 2ms 08 47 137ms 2ms 09 47 140ms 2ms 10 47 139ms 2ms 11 47 140ms 2ms 12 47 138ms 2ms 13 47 134ms 2ms 14 47 131ms 2ms 15 47 138ms 2ms 16 47 138ms 2ms 17 43 124ms 2ms 18 48 138ms 2ms 19 47 136ms 2ms 20 47 142ms 3ms 21 47 136ms 2ms 22 47 135ms 2ms 23 47 141ms 3ms [ User: tng_migration_user - Total duration: 2s495ms - Times executed: 854 ]
[ Application: [unknown] - Total duration: 2s495ms - Times executed: 854 ]
-
UPDATE scheduled_command SET last_execution = '2025-11-30 10:12:01', locked = 't', version = version + 1 WHERE id = '2' AND version = '467762';
Date: 2025-11-30 10:12:01 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
-
UPDATE scheduled_command SET last_execution = '2025-11-30 21:21:02', locked = 't', version = version + 1 WHERE id = '1' AND version = '1369303';
Date: 2025-11-30 21:21:02 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
-
UPDATE scheduled_command SET last_execution = '2025-11-30 17:32:01', locked = 't', version = version + 1 WHERE id = '6' AND version = '138719';
Date: 2025-11-30 17:32:01 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
18 0ms 401ms 1ms 3,032 5s406ms commit;Times Reported Time consuming queries #18
Day Hour Count Duration Avg duration Nov 30 00 103 237ms 2ms 05 650 1s364ms 2ms 06 343 346ms 1ms 07 118 101ms 0ms 08 106 91ms 0ms 09 107 117ms 1ms 10 107 149ms 1ms 11 114 245ms 2ms 12 108 158ms 1ms 13 120 179ms 1ms 14 119 200ms 1ms 15 137 192ms 1ms 16 104 159ms 1ms 17 142 1s152ms 8ms 18 113 128ms 1ms 19 108 95ms 0ms 20 104 105ms 1ms 21 106 146ms 1ms 22 119 109ms 0ms 23 104 125ms 1ms [ User: tng_migration_user - Total duration: 5s406ms - Times executed: 3032 ]
[ Application: [unknown] - Total duration: 3s944ms - Times executed: 2938 ]
[ Application: dbt - Total duration: 1s462ms - Times executed: 94 ]
-
COMMIT;
Date: 2025-11-30 17:02:33 Duration: 401ms 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-11-30 05:02:29 Duration: 186ms 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-11-30 17:02:58 Duration: 145ms Database: celspac User: tng_migration_user Remote: 127.0.0.1 Application: dbt Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
19 0ms 1ms 0ms 2,878 2s291ms select ? from pg_catalog.pg_namespace where nspname = ?;Times Reported Time consuming queries #19
Day Hour Count Duration Avg duration Nov 30 00 120 93ms 0ms 01 120 92ms 0ms 02 120 97ms 0ms 03 120 96ms 0ms 04 120 99ms 0ms 05 120 92ms 0ms 06 120 92ms 0ms 07 120 96ms 0ms 08 120 99ms 0ms 09 120 97ms 0ms 10 120 93ms 0ms 11 120 95ms 0ms 12 120 100ms 0ms 13 120 92ms 0ms 14 120 95ms 0ms 15 120 98ms 0ms 16 120 98ms 0ms 17 120 88ms 0ms 18 118 93ms 0ms 19 120 97ms 0ms 20 120 103ms 0ms 21 120 92ms 0ms 22 120 92ms 0ms 23 120 92ms 0ms [ User: postgres - Total duration: 2s291ms - Times executed: 2878 ]
[ Application: [unknown] - Total duration: 2s291ms - Times executed: 2878 ]
-
select 1 from pg_catalog.pg_namespace where nspname = 'pgq';
Date: 2025-11-30 04:03:34 Duration: 1ms Database: celspac User: postgres Remote: [local] Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
select 1 from pg_catalog.pg_namespace where nspname = 'pgq';
Date: 2025-11-30 20:30:02 Duration: 1ms Database: postgres User: postgres Remote: [local] Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
-
select 1 from pg_catalog.pg_namespace where nspname = 'pgq';
Date: 2025-11-30 08:47:43 Duration: 1ms Database: celspac User: postgres Remote: [local] Application: [unknown] Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
20 0ms 3ms 0ms 22,113 12s255ms select m0_.id as id_0, m0_.result_date as result_date_1, m0_.use_alternative as use_alternative_2, m0_.subject_subcohort_id as subject_subcohort_id_3, m0_.subject_id as subject_id_4, m0_.subject_about_id as subject_about_id_5, m0_.subject_extend_id as subject_extend_id_6, m0_.subject_role_code as subject_role_code_7, m0_.timeing_t0_type_code as timeing_t0_type_code_8, m0_.pilot_id as pilot_id_9, m0_.subcohort_id as subcohort_id_10, m0_.subject_subcohort_id as subject_subcohort_id_11, m0_.form_structure_variant_id as form_structure_variant_id_12, m0_.form_id as form_id_13, m0_.form_state_code as form_state_code_14 from core.mv_subject_form m0_ where m0_.form_structure_variant_id in (...) and m0_.form_id is null and m0_.result_date <= ? and m0_.use_alternative <> ?;Times Reported Time consuming queries #20
Day Hour Count Duration Avg duration Nov 30 05 1,170 636ms 0ms 06 1,170 642ms 0ms 07 1,170 658ms 0ms 08 1,170 668ms 0ms 09 1,170 654ms 0ms 10 1,170 646ms 0ms 11 1,170 670ms 0ms 12 1,170 680ms 0ms 13 1,170 651ms 0ms 14 1,170 627ms 0ms 15 1,170 644ms 0ms 16 1,170 655ms 0ms 17 1,053 587ms 0ms 18 1,170 648ms 0ms 19 1,170 634ms 0ms 20 1,170 644ms 0ms 21 1,170 627ms 0ms 22 1,170 651ms 0ms 23 1,170 623ms 0ms [ User: tng_migration_user - Total duration: 12s255ms - Times executed: 22113 ]
[ Application: [unknown] - Total duration: 12s255ms - Times executed: 22113 ]
-
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-16 12:48:01' AND m0_.use_alternative <> 't';
Date: 2025-11-30 12:48: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 ('80') AND m0_.form_id IS NULL AND m0_.result_date <= '2020-12-16 11:54:02' AND m0_.use_alternative <> 't';
Date: 2025-11-30 11:54: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 ('175') AND m0_.form_id IS NULL AND m0_.result_date <= '2022-11-13 12:48:01' AND m0_.use_alternative <> 't';
Date: 2025-11-30 12:48: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
Time consuming prepare
Rank Total duration Times executed Min duration Max duration Avg duration Query 1 13s30ms 15,771 0ms 13ms 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 Nov 30 04 313 264ms 0ms 05 360 296ms 0ms 06 360 297ms 0ms 07 360 282ms 0ms 08 360 282ms 0ms 09 360 284ms 0ms 10 360 286ms 0ms 11 360 291ms 0ms 12 360 293ms 0ms 13 360 302ms 0ms 14 360 292ms 0ms 15 360 302ms 0ms 16 360 287ms 0ms 17 360 287ms 0ms 18 360 291ms 0ms 19 360 278ms 0ms 20 360 279ms 0ms 21 360 284ms 0ms 22 360 290ms 0ms 23 360 287ms 0ms Nov 30 00 360 313ms 0ms 01 360 293ms 0ms 02 360 302ms 0ms 03 360 303ms 0ms 04 360 312ms 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 [ User: tng_migration_user - Total duration: 1s916ms - Times executed: 15771 ]
[ Application: [unknown] - Total duration: 1s916ms - Times executed: 15771 ]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-30 00:01:42 Duration: 13ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-30 17:00:15 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-29 05:52:16 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
2 7s749ms 17,255 0ms 1ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 WHERE t0.code = $1 LIMIT 1;Times Reported Time consuming prepare #2
Day Hour Count Duration Avg duration 03 313 152ms 0ms 04 360 169ms 0ms 05 578 190ms 0ms 06 390 168ms 0ms 07 390 172ms 0ms 08 390 170ms 0ms 09 390 173ms 0ms 10 390 178ms 0ms 11 390 177ms 0ms 12 390 182ms 0ms 13 390 178ms 0ms 14 390 183ms 0ms 15 390 174ms 0ms 16 386 176ms 0ms 17 390 177ms 0ms 18 390 171ms 0ms 19 390 170ms 0ms 20 390 174ms 0ms 21 390 180ms 0ms 22 390 180ms 0ms 23 360 168ms 0ms 00 360 164ms 0ms 01 360 168ms 0ms 02 360 167ms 0ms 03 360 176ms 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 [ User: tng_migration_user - Total duration: 204ms - Times executed: 17255 ]
[ Application: [unknown] - Total duration: 204ms - Times executed: 17255 ]
-
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-29 14:52:15 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.notif_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-11-29 04:19: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.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-29 14:31:17 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
3 6s12ms 117,929 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,191 114ms 0ms 04 2,527 129ms 0ms 05 2,737 142ms 0ms 06 2,730 135ms 0ms 07 2,730 137ms 0ms 08 2,730 134ms 0ms 09 2,730 136ms 0ms 10 2,730 138ms 0ms 11 2,730 137ms 0ms 12 2,730 140ms 0ms 13 2,730 137ms 0ms 14 2,730 139ms 0ms 15 2,730 137ms 0ms 16 2,702 137ms 0ms 17 2,730 138ms 0ms 18 2,730 136ms 0ms 19 2,730 135ms 0ms 20 2,730 136ms 0ms 21 2,730 139ms 0ms 22 2,730 140ms 0ms 23 2,520 129ms 0ms 00 2,520 128ms 0ms 01 2,520 129ms 0ms 02 2,520 129ms 0ms 03 2,520 132ms 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 [ User: tng_migration_user - Total duration: 2s186ms - Times executed: 117929 ]
[ Application: [unknown] - Total duration: 2s186ms - Times executed: 117929 ]
-
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-29 19:05: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-29 18:30: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 05:56:15 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
4 3s400ms 15,771 0ms 1ms 0ms SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;Times Reported Time consuming prepare #4
Day Hour Count Duration Avg duration 03 313 70ms 0ms 04 360 79ms 0ms 05 360 79ms 0ms 06 360 74ms 0ms 07 360 74ms 0ms 08 360 73ms 0ms 09 360 75ms 0ms 10 360 77ms 0ms 11 360 77ms 0ms 12 360 79ms 0ms 13 360 77ms 0ms 14 360 79ms 0ms 15 360 76ms 0ms 16 360 78ms 0ms 17 360 77ms 0ms 18 360 73ms 0ms 19 360 73ms 0ms 20 360 76ms 0ms 21 360 77ms 0ms 22 360 77ms 0ms 23 360 76ms 0ms 00 360 78ms 0ms 01 360 78ms 0ms 02 360 77ms 0ms 03 360 81ms 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 [ User: tng_migration_user - Total duration: 2s719ms - Times executed: 15771 ]
[ Application: [unknown] - Total duration: 2s719ms - Times executed: 15771 ]
-
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]
-
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 16:27:42 Duration: 0ms 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-29 21:57:13 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
5 3s172ms 18,368 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 #5
Day Hour Count Duration Avg duration 03 365 63ms 0ms 04 410 65ms 0ms 05 420 74ms 0ms 06 420 71ms 0ms 07 420 74ms 0ms 08 420 72ms 0ms 09 420 72ms 0ms 10 420 73ms 0ms 11 420 72ms 0ms 12 420 75ms 0ms 13 420 71ms 0ms 14 420 73ms 0ms 15 420 73ms 0ms 16 411 62ms 0ms 17 420 69ms 0ms 18 420 69ms 0ms 19 420 68ms 0ms 20 420 69ms 0ms 21 420 71ms 0ms 22 420 73ms 0ms 23 420 73ms 0ms 00 420 71ms 0ms 01 420 74ms 0ms 02 420 73ms 0ms 03 420 76ms 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 [ User: tng_migration_user - Total duration: 662ms - Times executed: 18368 ]
[ Application: [unknown] - Total duration: 662ms - Times executed: 18368 ]
-
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-11-30 16:43:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
6 3s47ms 60,380 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 #6
Day Hour Count Duration Avg duration 04 1,386 67ms 0ms 05 1,613 80ms 0ms 06 1,540 77ms 0ms 07 1,540 73ms 0ms 08 1,540 78ms 0ms 09 1,540 75ms 0ms 10 1,790 92ms 0ms 11 1,568 77ms 0ms 12 1,568 77ms 0ms 13 1,760 88ms 0ms 14 1,540 75ms 0ms 15 1,639 83ms 0ms 16 1,488 75ms 0ms 17 1,733 87ms 0ms 18 1,786 94ms 0ms 19 1,617 79ms 0ms 20 1,543 76ms 0ms 21 1,603 80ms 0ms 22 1,597 80ms 0ms 23 28 1ms 0ms 04 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 [ User: tng_migration_user - Total duration: 1s767ms - Times executed: 60380 ]
[ Application: [unknown] - Total duration: 1s767ms - Times executed: 60380 ]
-
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-11-29 16:27: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-29 13:18:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
7 2s889ms 15,771 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 prepare #7
Day Hour Count Duration Avg duration 03 313 60ms 0ms 04 360 66ms 0ms 05 360 68ms 0ms 06 360 63ms 0ms 07 360 63ms 0ms 08 360 63ms 0ms 09 360 64ms 0ms 10 360 65ms 0ms 11 360 65ms 0ms 12 360 67ms 0ms 13 360 65ms 0ms 14 360 68ms 0ms 15 360 64ms 0ms 16 360 64ms 0ms 17 360 66ms 0ms 18 360 63ms 0ms 19 360 62ms 0ms 20 360 63ms 0ms 21 360 65ms 0ms 22 360 65ms 0ms 23 360 65ms 0ms 00 360 65ms 0ms 01 360 66ms 0ms 02 360 67ms 0ms 03 360 71ms 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 [ User: tng_migration_user - Total duration: 271ms - Times executed: 15771 ]
[ Application: [unknown] - Total duration: 271ms - Times executed: 15771 ]
-
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]
-
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-29 19:05:16 Duration: 0ms 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-29 06:44:15 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
8 2s560ms 67,388 0ms 0ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;Times Reported Time consuming prepare #8
Day Hour Count Duration Avg duration 03 1,252 47ms 0ms 04 1,444 55ms 0ms 05 1,564 59ms 0ms 06 1,560 57ms 0ms 07 1,560 58ms 0ms 08 1,560 57ms 0ms 09 1,560 57ms 0ms 10 1,560 58ms 0ms 11 1,560 58ms 0ms 12 1,560 59ms 0ms 13 1,560 58ms 0ms 14 1,560 59ms 0ms 15 1,560 58ms 0ms 16 1,544 58ms 0ms 17 1,560 58ms 0ms 18 1,560 57ms 0ms 19 1,560 58ms 0ms 20 1,560 59ms 0ms 21 1,560 59ms 0ms 22 1,560 59ms 0ms 23 1,440 55ms 0ms 00 1,440 55ms 0ms 01 1,440 55ms 0ms 02 1,440 55ms 0ms 03 1,440 56ms 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 [ User: tng_migration_user - Total duration: 1s137ms - Times executed: 67388 ]
[ Application: [unknown] - Total duration: 1s137ms - Times executed: 67388 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-11-30 00:06:17 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-11-29 22:34: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_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-11-30 01:22:17 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
9 2s153ms 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,053 49ms 0ms 05 1,170 55ms 0ms 06 1,170 54ms 0ms 07 1,170 55ms 0ms 08 1,170 56ms 0ms 09 1,170 57ms 0ms 10 1,170 55ms 0ms 11 1,170 57ms 0ms 12 1,170 57ms 0ms 13 1,170 57ms 0ms 14 1,170 57ms 0ms 15 1,170 58ms 0ms 16 1,053 51ms 0ms 17 1,170 56ms 0ms 18 1,170 58ms 0ms 19 1,170 57ms 0ms 20 1,170 56ms 0ms 21 1,170 58ms 0ms 22 1,170 56ms 0ms 04 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 [ User: tng_migration_user - Total duration: 24s624ms - Times executed: 44109 ]
[ Application: [unknown] - Total duration: 24s624ms - 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-11-29 13:42: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-29 17:48:03 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
10 1s479ms 19,516 0ms 0ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;Times Reported Time consuming prepare #10
Day Hour Count Duration Avg duration 04 430 30ms 0ms 05 565 43ms 0ms 06 510 36ms 0ms 07 510 37ms 0ms 08 510 36ms 0ms 09 510 37ms 0ms 10 530 39ms 0ms 11 514 38ms 0ms 12 510 36ms 0ms 13 523 41ms 0ms 14 508 39ms 0ms 15 514 37ms 0ms 16 517 39ms 0ms 17 514 37ms 0ms 18 543 46ms 0ms 19 509 38ms 0ms 20 507 37ms 0ms 21 509 39ms 0ms 22 509 38ms 0ms 23 2 0ms 0ms 04 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 [ User: tng_migration_user - Total duration: 370ms - Times executed: 19516 ]
[ Application: [unknown] - Total duration: 370ms - Times executed: 19516 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-11-29 19:16:50 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-11-29 17:05:50 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-11-29 19:42:06 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
11 713ms 19,398 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 #11
Day Hour Count Duration Avg duration 04 573 20ms 0ms 05 521 19ms 0ms 06 516 18ms 0ms 07 516 17ms 0ms 08 516 18ms 0ms 09 516 18ms 0ms 10 522 18ms 0ms 11 517 18ms 0ms 12 515 18ms 0ms 13 518 19ms 0ms 14 514 19ms 0ms 15 516 18ms 0ms 16 516 19ms 0ms 17 510 18ms 0ms 18 522 23ms 0ms 19 508 17ms 0ms 20 509 18ms 0ms 21 508 19ms 0ms 22 509 18ms 0ms 04 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 [ User: tng_migration_user - Total duration: 230ms - Times executed: 19398 ]
[ Application: [unknown] - Total duration: 230ms - Times executed: 19398 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;
Date: 2025-11-30 13:00:04 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;
Date: 2025-11-29 19:16:50 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;
Date: 2025-11-30 14:08:42 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
12 559ms 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 #12
Day Hour Count Duration Avg duration 05 182 15ms 0ms 06 182 15ms 0ms 07 182 16ms 0ms 08 182 15ms 0ms 09 182 14ms 0ms 10 182 15ms 0ms 11 182 15ms 0ms 12 182 15ms 0ms 13 182 16ms 0ms 14 182 15ms 0ms 15 182 15ms 0ms 16 182 15ms 0ms 17 182 15ms 0ms 18 182 15ms 0ms 19 182 16ms 0ms 20 182 15ms 0ms 21 182 16ms 0ms 22 182 15ms 0ms 05 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 [ User: tng_migration_user - Total duration: 1s831ms - Times executed: 6552 ]
[ Application: [unknown] - Total duration: 1s831ms - 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-11-29 08:59:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-11-29 16:59:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-11-29 19:05:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
13 548ms 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 #13
Day Hour Count Duration Avg duration 05 238 15ms 0ms 06 238 14ms 0ms 07 238 15ms 0ms 08 238 14ms 0ms 09 238 14ms 0ms 10 238 14ms 0ms 11 238 14ms 0ms 12 238 15ms 0ms 13 238 16ms 0ms 14 238 15ms 0ms 15 238 14ms 0ms 16 238 15ms 0ms 17 238 14ms 0ms 18 238 14ms 0ms 19 238 15ms 0ms 20 238 15ms 0ms 21 238 15ms 0ms 22 238 15ms 0ms 05 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 [ User: tng_migration_user - Total duration: 140ms - Times executed: 8568 ]
[ Application: [unknown] - Total duration: 140ms - 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-11-29 17:59: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]
-
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 09:41:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
14 472ms 6,100 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 #14
Day Hour Count Duration Avg duration 05 212 16ms 0ms 10 579 43ms 0ms 11 87 6ms 0ms 12 95 6ms 0ms 13 592 45ms 0ms 15 309 23ms 0ms 16 309 24ms 0ms 17 618 46ms 0ms 18 392 31ms 0ms 19 138 10ms 0ms 21 154 11ms 0ms 22 190 14ms 0ms 23 95 7ms 0ms 05 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 [ User: tng_migration_user - Total duration: 188ms - Times executed: 6100 ]
[ Application: [unknown] - Total duration: 188ms - Times executed: 6100 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;
Date: 2025-11-29 18:17:06 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-11-30 22:16:53 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-11-30 00:04:48 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
15 458ms 3,352 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 #15
Day Hour Count Duration Avg duration 04 36 5ms 0ms 05 92 12ms 0ms 06 68 10ms 0ms 07 68 10ms 0ms 08 68 11ms 0ms 09 68 10ms 0ms 10 160 19ms 0ms 11 84 11ms 0ms 12 76 10ms 0ms 13 144 18ms 0ms 14 68 9ms 0ms 15 104 13ms 0ms 16 96 10ms 0ms 17 156 17ms 0ms 18 180 21ms 0ms 19 92 11ms 0ms 20 72 10ms 0ms 21 80 12ms 0ms 22 88 11ms 0ms 23 12 1ms 0ms 04 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 [ User: tng_migration_user - Total duration: 32ms - Times executed: 3352 ]
[ Application: [unknown] - Total duration: 32ms - Times executed: 3352 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.subject_inform_consent_state t0 WHERE t0.code = $1 LIMIT 1;
Date: 2025-11-29 11:45:32 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
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-11-30 20:14:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
16 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 #16
Day Hour Count Duration Avg duration 05 182 12ms 0ms 06 182 11ms 0ms 07 182 12ms 0ms 08 182 12ms 0ms 09 182 11ms 0ms 10 182 11ms 0ms 11 182 11ms 0ms 12 182 12ms 0ms 13 182 13ms 0ms 14 182 11ms 0ms 15 182 11ms 0ms 16 182 12ms 0ms 17 182 11ms 0ms 18 182 11ms 0ms 19 182 12ms 0ms 20 182 11ms 0ms 21 182 12ms 0ms 22 182 11ms 0ms 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 [ User: tng_migration_user - Total duration: 221ms - Times executed: 6552 ]
[ Application: [unknown] - Total duration: 221ms - 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-11-29 14:41: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]
-
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-29 08:05:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
17 392ms 8,784 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 #17
Day Hour Count Duration Avg duration 04 88 5ms 0ms 05 320 14ms 0ms 10 823 36ms 0ms 11 112 4ms 0ms 12 122 5ms 0ms 13 763 32ms 0ms 15 405 17ms 0ms 16 405 18ms 0ms 17 810 35ms 0ms 18 669 30ms 0ms 19 246 10ms 0ms 21 214 9ms 0ms 22 244 10ms 0ms 23 122 5ms 0ms 04 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 [ User: tng_migration_user - Total duration: 169ms - Times executed: 8784 ]
[ Application: [unknown] - Total duration: 169ms - Times executed: 8784 ]
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-11-29 11:31:59 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-11-30 05:01:42 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-11-29 05:01:13 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
18 372ms 9,425 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;Times Reported Time consuming prepare #18
Day Hour Count Duration Avg duration 04 225 8ms 0ms 05 250 9ms 0ms 06 250 9ms 0ms 07 250 10ms 0ms 08 250 10ms 0ms 09 250 9ms 0ms 10 250 9ms 0ms 11 250 9ms 0ms 12 250 10ms 0ms 13 250 9ms 0ms 14 250 9ms 0ms 15 250 10ms 0ms 16 225 9ms 0ms 17 250 9ms 0ms 18 250 10ms 0ms 19 250 9ms 0ms 20 250 9ms 0ms 21 250 9ms 0ms 22 250 9ms 0ms 04 250 10ms 0ms 05 250 9ms 0ms 06 250 10ms 0ms 07 250 9ms 0ms 08 250 9ms 0ms 09 250 10ms 0ms 10 250 10ms 0ms 11 250 10ms 0ms 12 250 9ms 0ms 13 250 9ms 0ms 14 250 9ms 0ms 15 250 9ms 0ms 16 225 8ms 0ms 17 250 10ms 0ms 18 250 9ms 0ms 19 250 9ms 0ms 20 250 9ms 0ms 21 250 9ms 0ms 22 250 9ms 0ms [ User: tng_migration_user - Total duration: 3s238ms - Times executed: 9425 ]
[ Application: [unknown] - Total duration: 3s238ms - Times executed: 9425 ]
-
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;
Date: 2025-11-29 13:00:03 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_.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;
Date: 2025-11-29 09:30:03 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_.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;
Date: 2025-11-30 11:06:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
19 367ms 6,688 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 = $1 AND m0_.form_state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN $7 AND $8);Times Reported Time consuming prepare #19
Day Hour Count Duration Avg duration 04 176 9ms 0ms 05 176 9ms 0ms 06 176 9ms 0ms 07 176 9ms 0ms 08 176 9ms 0ms 09 176 10ms 0ms 10 176 9ms 0ms 11 176 9ms 0ms 12 176 9ms 0ms 13 176 9ms 0ms 14 176 11ms 0ms 15 176 9ms 0ms 16 176 10ms 0ms 17 176 9ms 0ms 18 176 10ms 0ms 19 176 9ms 0ms 20 176 9ms 0ms 21 176 9ms 0ms 22 176 9ms 0ms 04 176 9ms 0ms 05 176 9ms 0ms 06 176 9ms 0ms 07 176 9ms 0ms 08 176 9ms 0ms 09 176 9ms 0ms 10 176 9ms 0ms 11 176 9ms 0ms 12 176 10ms 0ms 13 176 9ms 0ms 14 176 10ms 0ms 15 176 9ms 0ms 16 176 9ms 0ms 17 176 9ms 0ms 18 176 9ms 0ms 19 176 9ms 0ms 20 176 9ms 0ms 21 176 9ms 0ms 22 176 9ms 0ms [ User: tng_migration_user - Total duration: 457ms - Times executed: 6688 ]
[ Application: [unknown] - Total duration: 457ms - Times executed: 6688 ]
-
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 = $1 AND m0_.form_state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN $7 AND $8);
Date: 2025-11-29 17:00:04 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_.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 = $1 AND m0_.form_state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN $7 AND $8);
Date: 2025-11-30 09:00:03 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_.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 = $1 AND m0_.form_state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN $7 AND $8);
Date: 2025-11-29 15:00:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
20 308ms 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_ WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;Times Reported Time consuming prepare #20
Day Hour Count Duration Avg duration 05 182 8ms 0ms 06 182 8ms 0ms 07 182 8ms 0ms 08 182 8ms 0ms 09 182 8ms 0ms 10 182 8ms 0ms 11 182 8ms 0ms 12 182 8ms 0ms 13 182 9ms 0ms 14 182 8ms 0ms 15 182 8ms 0ms 16 182 8ms 0ms 17 182 8ms 0ms 18 182 8ms 0ms 19 182 8ms 0ms 20 182 8ms 0ms 21 182 8ms 0ms 22 182 8ms 0ms 05 182 8ms 0ms 06 182 9ms 0ms 07 182 8ms 0ms 08 182 8ms 0ms 09 182 8ms 0ms 10 182 8ms 0ms 11 182 8ms 0ms 12 182 8ms 0ms 13 182 8ms 0ms 14 182 8ms 0ms 15 182 9ms 0ms 16 182 8ms 0ms 17 182 8ms 0ms 18 182 8ms 0ms 19 182 9ms 0ms 20 182 8ms 0ms 21 182 8ms 0ms 22 182 9ms 0ms [ User: tng_migration_user - Total duration: 213ms - Times executed: 6552 ]
[ Application: [unknown] - Total duration: 213ms - 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_ WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;
Date: 2025-11-29 14:59: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_ WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;
Date: 2025-11-29 18:32: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_ WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NULL AND m0_.result_date <= $2 AND m0_.use_alternative <> $3;
Date: 2025-11-30 19:14: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 14s348ms 117,929 0ms 1ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_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 Nov 30 04 2,191 273ms 0ms 05 2,527 312ms 0ms 06 2,737 341ms 0ms 07 2,730 320ms 0ms 08 2,730 326ms 0ms 09 2,730 323ms 0ms 10 2,730 326ms 0ms 11 2,730 329ms 0ms 12 2,730 331ms 0ms 13 2,730 334ms 0ms 14 2,730 329ms 0ms 15 2,730 335ms 0ms 16 2,730 330ms 0ms 17 2,702 325ms 0ms 18 2,730 330ms 0ms 19 2,730 324ms 0ms 20 2,730 322ms 0ms 21 2,730 328ms 0ms 22 2,730 335ms 0ms 23 2,730 334ms 0ms Nov 30 00 2,520 310ms 0ms 01 2,520 307ms 0ms 02 2,520 308ms 0ms 03 2,520 310ms 0ms 04 2,520 317ms 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 [ User: tng_migration_user - Total duration: 2s186ms - Times executed: 117929 ]
[ Application: [unknown] - Total duration: 2s186ms - Times executed: 117929 ]
-
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-29 16:30:18 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-11-29 14:00:16 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-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'
2 9s731ms 15,771 0ms 20ms 0ms SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;Times Reported Time consuming bind #2
Day Hour Count Duration Avg duration 03 313 197ms 0ms 04 360 221ms 0ms 05 360 222ms 0ms 06 360 210ms 0ms 07 360 211ms 0ms 08 360 211ms 0ms 09 360 213ms 0ms 10 360 217ms 0ms 11 360 216ms 0ms 12 360 224ms 0ms 13 360 217ms 0ms 14 360 223ms 0ms 15 360 213ms 0ms 16 360 212ms 0ms 17 360 217ms 0ms 18 360 209ms 0ms 19 360 209ms 0ms 20 360 212ms 0ms 21 360 215ms 0ms 22 360 216ms 0ms 23 360 246ms 0ms 00 360 220ms 0ms 01 360 226ms 0ms 02 360 226ms 0ms 03 360 233ms 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 [ User: tng_migration_user - Total duration: 1s916ms - Times executed: 15771 ]
[ Application: [unknown] - Total duration: 1s916ms - Times executed: 15771 ]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-30 00:01:42 Duration: 20ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-30 17:00:15 Duration: 3ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
-
SELECT t0.id AS id_1, t0.version AS version_2, t0.created_at AS created_at_3, t0.name AS name_4, t0.command AS command_5, t0.arguments AS arguments_6, t0.cron_expression AS cron_expression_7, t0.last_execution AS last_execution_8, t0.last_return_code AS last_return_code_9, t0.log_file AS log_file_10, t0.priority AS priority_11, t0.execute_immediately AS execute_immediately_12, t0.disabled AS disabled_13, t0.locked AS locked_14, t0.ping_back_url AS ping_back_url_15, t0.ping_back_failed_url AS ping_back_failed_url_16, t0.notes AS notes_17 FROM scheduled_command t0 ORDER BY t0.disabled ASC, t0.priority DESC;
Date: 2025-11-30 18:24:14 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown]
3 8s287ms 60,380 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,386 182ms 0ms 05 1,613 220ms 0ms 06 1,540 211ms 0ms 07 1,540 200ms 0ms 08 1,540 214ms 0ms 09 1,540 204ms 0ms 10 1,790 255ms 0ms 11 1,568 212ms 0ms 12 1,568 211ms 0ms 13 1,760 243ms 0ms 14 1,540 207ms 0ms 15 1,639 230ms 0ms 16 1,488 204ms 0ms 17 1,733 237ms 0ms 18 1,786 258ms 0ms 19 1,617 215ms 0ms 20 1,543 206ms 0ms 21 1,603 219ms 0ms 22 1,597 218ms 0ms 23 28 5ms 0ms 04 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 [ User: tng_migration_user - Total duration: 1s767ms - Times executed: 60380 ]
[ Application: [unknown] - Total duration: 1s767ms - Times executed: 60380 ]
-
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-29 11:45:32 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '215'
-
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-29 19:38:40 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '221'
-
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'
4 5s720ms 67,388 0ms 1ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;Times Reported Time consuming bind #4
Day Hour Count Duration Avg duration 03 1,252 107ms 0ms 04 1,444 124ms 0ms 05 1,564 134ms 0ms 06 1,560 128ms 0ms 07 1,560 130ms 0ms 08 1,560 129ms 0ms 09 1,560 130ms 0ms 10 1,560 131ms 0ms 11 1,560 131ms 0ms 12 1,560 132ms 0ms 13 1,560 131ms 0ms 14 1,560 133ms 0ms 15 1,560 131ms 0ms 16 1,544 130ms 0ms 17 1,560 132ms 0ms 18 1,560 129ms 0ms 19 1,560 128ms 0ms 20 1,560 131ms 0ms 21 1,560 134ms 0ms 22 1,560 132ms 0ms 23 1,440 123ms 0ms 00 1,440 124ms 0ms 01 1,440 123ms 0ms 02 1,440 123ms 0ms 03 1,440 125ms 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 [ User: tng_migration_user - Total duration: 1s137ms - Times executed: 67388 ]
[ Application: [unknown] - Total duration: 1s137ms - Times executed: 67388 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-11-30 01:22:17 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'EMAIL_SENDED'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-11-29 14:09:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'PHONE'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.code AS code_4, t0.name AS name_5, t0.description AS description_6 FROM core.notif_state t0 INNER JOIN core.notif_type_state ON t0.code = core.notif_type_state.notif_state_code WHERE core.notif_type_state.notif_type_code = $1;
Date: 2025-11-30 17:15:15 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'EMAIL_SENDED'
5 4s659ms 15,771 0ms 1ms 0ms SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;Times Reported Time consuming bind #5
Day Hour Count Duration Avg duration 03 313 94ms 0ms 04 360 106ms 0ms 05 360 107ms 0ms 06 360 99ms 0ms 07 360 101ms 0ms 08 360 101ms 0ms 09 360 102ms 0ms 10 360 104ms 0ms 11 360 105ms 0ms 12 360 108ms 0ms 13 360 103ms 0ms 14 360 106ms 0ms 15 360 103ms 0ms 16 360 105ms 0ms 17 360 104ms 0ms 18 360 98ms 0ms 19 360 100ms 0ms 20 360 105ms 0ms 21 360 105ms 0ms 22 360 103ms 0ms 23 360 107ms 0ms 00 360 107ms 0ms 01 360 108ms 0ms 02 360 107ms 0ms 03 360 112ms 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 [ User: tng_migration_user - Total duration: 2s719ms - Times executed: 15771 ]
[ Application: [unknown] - Total duration: 2s719ms - Times executed: 15771 ]
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;
Date: 2025-11-29 13:21:15 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR', $2 = '2025-11-22 13:21:15'
-
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'
-
SELECT COUNT(n0_.id) AS sclr_0 FROM core.notif n0_ WHERE n0_.notif_state_code = $1 AND n0_.processed_time >= $2;
Date: 2025-11-29 17:09:15 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR', $2 = '2025-11-22 17:09:15'
6 3s458ms 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,053 80ms 0ms 05 1,170 89ms 0ms 06 1,170 88ms 0ms 07 1,170 90ms 0ms 08 1,170 91ms 0ms 09 1,170 91ms 0ms 10 1,170 89ms 0ms 11 1,170 92ms 0ms 12 1,170 91ms 0ms 13 1,170 92ms 0ms 14 1,170 93ms 0ms 15 1,170 93ms 0ms 16 1,053 82ms 0ms 17 1,170 90ms 0ms 18 1,170 93ms 0ms 19 1,170 93ms 0ms 20 1,170 91ms 0ms 21 1,170 94ms 0ms 22 1,170 90ms 0ms 04 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 [ User: tng_migration_user - Total duration: 24s624ms - Times executed: 44109 ]
[ Application: [unknown] - Total duration: 24s624ms - 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-29 22:18:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13', $2 = '2025-03-15 22:18: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-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-11-29 13:36:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '13', $2 = '2025-03-15 13:36:02', $3 = 't'
7 3s148ms 17,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.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 #7
Day Hour Count Duration Avg duration 03 313 59ms 0ms 04 360 67ms 0ms 05 578 82ms 0ms 06 390 68ms 0ms 07 390 70ms 0ms 08 390 69ms 0ms 09 390 70ms 0ms 10 390 71ms 0ms 11 390 71ms 0ms 12 390 74ms 0ms 13 390 72ms 0ms 14 390 73ms 0ms 15 390 70ms 0ms 16 386 70ms 0ms 17 390 71ms 0ms 18 390 70ms 0ms 19 390 69ms 0ms 20 390 70ms 0ms 21 390 71ms 0ms 22 390 73ms 0ms 23 360 67ms 0ms 00 360 66ms 0ms 01 360 66ms 0ms 02 360 67ms 0ms 03 360 70ms 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 [ User: tng_migration_user - Total duration: 204ms - Times executed: 17255 ]
[ Application: [unknown] - Total duration: 204ms - Times executed: 17255 ]
-
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 00:58:15 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-11-29 13:34:15 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-11-29 23:07:16 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'ERROR'
8 2s683ms 18,368 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 #8
Day Hour Count Duration Avg duration 03 365 55ms 0ms 04 410 55ms 0ms 05 420 60ms 0ms 06 420 58ms 0ms 07 420 59ms 0ms 08 420 59ms 0ms 09 420 58ms 0ms 10 420 59ms 0ms 11 420 59ms 0ms 12 420 61ms 0ms 13 420 57ms 0ms 14 420 59ms 0ms 15 420 59ms 0ms 16 411 56ms 0ms 17 420 61ms 0ms 18 420 59ms 0ms 19 420 59ms 0ms 20 420 61ms 0ms 21 420 63ms 0ms 22 420 64ms 0ms 23 420 64ms 0ms 00 420 62ms 0ms 01 420 64ms 0ms 02 420 63ms 0ms 03 420 66ms 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 [ User: tng_migration_user - Total duration: 662ms - Times executed: 18368 ]
[ Application: [unknown] - Total duration: 662ms - Times executed: 18368 ]
-
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 16:43: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-11-30 02:00: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-11-30 17:32:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = 'f'
9 2s184ms 19,516 0ms 2ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;Times Reported Time consuming bind #9
Day Hour Count Duration Avg duration 04 430 44ms 0ms 05 565 67ms 0ms 06 510 52ms 0ms 07 510 53ms 0ms 08 510 52ms 0ms 09 510 53ms 0ms 10 530 60ms 0ms 11 514 56ms 0ms 12 510 52ms 0ms 13 523 62ms 0ms 14 508 57ms 0ms 15 514 54ms 0ms 16 517 59ms 0ms 17 514 56ms 0ms 18 543 77ms 0ms 19 509 56ms 0ms 20 507 55ms 0ms 21 509 58ms 0ms 22 509 56ms 0ms 23 2 0ms 0ms 04 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 [ User: tng_migration_user - Total duration: 370ms - Times executed: 19516 ]
[ Application: [unknown] - Total duration: 370ms - Times executed: 19516 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-11-29 19:16:50 Duration: 2ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '41999'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-11-30 08:57:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '41999'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.rc AS rc_5, t0.tng_id AS tng_id_6, t0.birthdate AS birthdate_7, t0.name AS name_8, t0.surname AS surname_9, t0.maiden_name AS maiden_name_10, t0.titles_before AS titles_before_11, t0.titles_after AS titles_after_12, t0.description AS description_13, t0.test_proband AS test_proband_14, t0.puk AS puk_15, t0.is_origin_elspac AS is_origin_elspac_16, t0.family_code AS family_code_17, t0.enrolled_at AS enrolled_at_18, t0.anonym_at AS anonym_at_19, t0.elspac_family_relationship_type_code AS elspac_family_relationship_type_code_20, t0.subject_state_code AS subject_state_code_21, t0.sex_code AS sex_code_22, t0.family_id AS family_id_23, t0.user_id AS user_id_24, t0.created_by AS created_by_25, t0.enrolled_by AS enrolled_by_26, t0.anonym_by AS anonym_by_27, t28.id AS id_29, t28.death_at AS death_at_30, t28.date_of_death AS date_of_death_31, t28.cause_of_death AS cause_of_death_32, t28.subject_id AS subject_id_33, t28.death_by AS death_by_34, t0.owner_user_id AS owner_user_id_35, t0.owner_group_id AS owner_group_id_36 FROM core.subject t0 LEFT JOIN core.subject_dead t28 ON t28.subject_id = t0.id WHERE t0.id = $1;
Date: 2025-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'
10 1s663ms 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 #10
Day Hour Count Duration Avg duration 05 238 46ms 0ms 06 238 45ms 0ms 07 238 45ms 0ms 08 238 45ms 0ms 09 238 44ms 0ms 10 238 45ms 0ms 11 238 45ms 0ms 12 238 45ms 0ms 13 238 49ms 0ms 14 238 45ms 0ms 15 238 45ms 0ms 16 238 46ms 0ms 17 238 45ms 0ms 18 238 44ms 0ms 19 238 46ms 0ms 20 238 46ms 0ms 21 238 46ms 0ms 22 238 46ms 0ms 05 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 [ User: tng_migration_user - Total duration: 140ms - Times executed: 8568 ]
[ Application: [unknown] - Total duration: 140ms - 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-11-29 17:59:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '108', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = '2025-02-19 17:59:01', $7 = '2025-02-23 17:59:01'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND (m0_.result_date BETWEEN $6 AND $7);
Date: 2025-11-29 08:59:02 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 = '2025-10-08 08:59:02', $7 = '2025-10-12 08:59: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-11-29 15:05:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '86', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = '2025-12-09 15:05:01', $7 = '2025-12-13 15:05:01'
11 1s349ms 15,771 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 #11
Day Hour Count Duration Avg duration 03 313 26ms 0ms 04 360 31ms 0ms 05 360 31ms 0ms 06 360 29ms 0ms 07 360 29ms 0ms 08 360 29ms 0ms 09 360 29ms 0ms 10 360 30ms 0ms 11 360 30ms 0ms 12 360 31ms 0ms 13 360 30ms 0ms 14 360 31ms 0ms 15 360 30ms 0ms 16 360 29ms 0ms 17 360 29ms 0ms 18 360 28ms 0ms 19 360 28ms 0ms 20 360 29ms 0ms 21 360 29ms 0ms 22 360 29ms 0ms 23 360 30ms 0ms 00 360 31ms 0ms 01 360 31ms 0ms 02 360 31ms 0ms 03 360 32ms 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 [ User: tng_migration_user - Total duration: 271ms - Times executed: 15771 ]
[ Application: [unknown] - Total duration: 271ms - Times executed: 15771 ]
-
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-11-30 04:11:42 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-11-30 17:02:42 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'f', $2 = '0'
12 1s332ms 8,784 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 #12
Day Hour Count Duration Avg duration 04 88 16ms 0ms 05 320 48ms 0ms 10 823 122ms 0ms 11 112 15ms 0ms 12 122 17ms 0ms 13 763 112ms 0ms 15 405 61ms 0ms 16 405 63ms 0ms 17 810 117ms 0ms 18 669 104ms 0ms 19 246 35ms 0ms 21 214 30ms 0ms 22 244 36ms 0ms 23 122 19ms 0ms 04 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 [ User: tng_migration_user - Total duration: 169ms - Times executed: 8784 ]
[ Application: [unknown] - Total duration: 169ms - Times executed: 8784 ]
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-11-30 21:36:28 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '41'
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-11-30 07:43:32 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '41'
-
SELECT s0_.is_archived AS is_archived_0, s0_.created_at AS created_at_1, s0_.updated_at AS updated_at_2, s0_.ordering AS ordering_3, s0_.id AS id_4, s0_.is_required AS is_required_5, s0_.subcohort_id AS subcohort_id_6, s0_.info_consent_id AS info_consent_id_7, s0_.subject_role_code AS subject_role_code_8 FROM core.subcohort_inform_consent s0_ INNER JOIN core.subcohort s1_ ON s0_.subcohort_id = s1_.id WHERE s0_.info_consent_id = s1_.inform_consent_id AND s0_.subcohort_id IN ($1);
Date: 2025-11-30 22:07:27 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '41'
13 1s320ms 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 bind #13
Day Hour Count Duration Avg duration 05 182 36ms 0ms 06 182 36ms 0ms 07 182 36ms 0ms 08 182 36ms 0ms 09 182 35ms 0ms 10 182 35ms 0ms 11 182 35ms 0ms 12 182 36ms 0ms 13 182 40ms 0ms 14 182 35ms 0ms 15 182 35ms 0ms 16 182 36ms 0ms 17 182 36ms 0ms 18 182 35ms 0ms 19 182 37ms 0ms 20 182 36ms 0ms 21 182 37ms 0ms 22 182 37ms 0ms 05 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 [ User: tng_migration_user - Total duration: 221ms - Times executed: 6552 ]
[ Application: [unknown] - Total duration: 221ms - 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-11-30 22:41:01 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '89', $2 = 'READY', $3 = 'AWAITING', $4 = 'MISSED', $5 = 'DONE', $6 = 'CANCELED', $7 = 't', $8 = '2025-06-12 22:41:01', $9 = '2025-06-23 22:41:01'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);
Date: 2025-11-29 08:59:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '105', $2 = 'READY', $3 = 'AWAITING', $4 = 'MISSED', $5 = 'DONE', $6 = 'CANCELED', $7 = 't', $8 = '2025-07-30 08:59:02', $9 = '2025-08-10 08:59: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, $6) AND m0_.use_alternative <> $7 AND (m0_.result_date BETWEEN $8 AND $9);
Date: 2025-11-29 14:41:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '104', $2 = 'READY', $3 = 'AWAITING', $4 = 'MISSED', $5 = 'DONE', $6 = 'CANCELED', $7 = 't', $8 = '2025-10-08 14:41:01', $9 = '2025-10-19 14:41:01'
14 1s314ms 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 #14
Day Hour Count Duration Avg duration 05 182 36ms 0ms 06 182 35ms 0ms 07 182 36ms 0ms 08 182 35ms 0ms 09 182 35ms 0ms 10 182 36ms 0ms 11 182 35ms 0ms 12 182 36ms 0ms 13 182 39ms 0ms 14 182 35ms 0ms 15 182 35ms 0ms 16 182 36ms 0ms 17 182 36ms 0ms 18 182 34ms 0ms 19 182 37ms 0ms 20 182 36ms 0ms 21 182 37ms 0ms 22 182 36ms 0ms 05 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 [ User: tng_migration_user - Total duration: 1s831ms - Times executed: 6552 ]
[ Application: [unknown] - Total duration: 1s831ms - 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-11-29 08:59:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '104', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = 't', $7 = '2025-10-08 08:59:02'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-11-29 18:41:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '104', $2 = 'AWAITING', $3 = 'MISSED', $4 = 'DONE', $5 = 'CANCELED', $6 = 't', $7 = '2025-10-08 18:41:02'
-
SELECT m0_.id AS id_0, m0_.result_date AS result_date_1, m0_.use_alternative AS use_alternative_2, m0_.subject_subcohort_id AS subject_subcohort_id_3, m0_.subject_id AS subject_id_4, m0_.subject_about_id AS subject_about_id_5, m0_.subject_extend_id AS subject_extend_id_6, m0_.subject_role_code AS subject_role_code_7, m0_.timeing_t0_type_code AS timeing_t0_type_code_8, m0_.pilot_id AS pilot_id_9, m0_.subcohort_id AS subcohort_id_10, m0_.plan_id AS plan_id_11, m0_.proband_event_id AS proband_event_id_12, m0_.state_code AS state_code_13, m0_.subject_subcohort_id AS subject_subcohort_id_14 FROM core.mv_subject_event m0_ INNER JOIN core.proband_event p1_ ON m0_.proband_event_id = p1_.id WHERE m0_.plan_id IN ($1) AND m0_.proband_event_id IS NOT NULL AND p1_.state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date <= $7;
Date: 2025-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'
15 1s255ms 6,100 0ms 4ms 0ms SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;Times Reported Time consuming bind #15
Day Hour Count Duration Avg duration 05 212 44ms 0ms 10 579 122ms 0ms 11 87 16ms 0ms 12 95 18ms 0ms 13 592 117ms 0ms 15 309 62ms 0ms 16 309 64ms 0ms 17 618 122ms 0ms 18 392 91ms 0ms 19 138 27ms 0ms 21 154 30ms 0ms 22 190 39ms 0ms 23 95 20ms 0ms 05 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 [ User: tng_migration_user - Total duration: 188ms - Times executed: 6100 ]
[ Application: [unknown] - Total duration: 188ms - Times executed: 6100 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;
Date: 2025-11-29 19:42:23 Duration: 4ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '50018', $2 = '561', $3 = '560'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;
Date: 2025-11-30 21:35:58 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '43009', $2 = '326', $3 = '325'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.assigned_at AS assigned_at_5, t0.revoke_at AS revoke_at_6, t0.cancelled_at AS cancelled_at_7, t0.upload_at AS upload_at_8, t0.paused_at AS paused_at_9, t0.owner_user_id AS owner_user_id_10, t0.owner_group_id AS owner_group_id_11, t0.subject_id AS subject_id_12, t0.subject_about_id AS subject_about_id_13, t0.subcohort_inform_consent_id AS subcohort_inform_consent_id_14, t0.subject_inform_consent_state_code AS subject_inform_consent_state_code_15, t0.activity_state_code AS activity_state_code_16, t0.terminated_state_code AS terminated_state_code_17, t0.assigned_by AS assigned_by_18, t0.revoke_by AS revoke_by_19, t0.created_by AS created_by_20, t0.cancelled_by AS cancelled_by_21, t0.upload_by AS upload_by_22, t0.paused_by AS paused_by_23, t0.subject_plugin_id AS subject_plugin_id_24, t25.is_archived AS is_archived_26, t25.created_at AS created_at_27, t25.updated_at AS updated_at_28, t25.id AS id_29, t25.extend AS extend_30, t25.description AS description_31, t25.description_internal AS description_internal_32, t25.owner_user_id AS owner_user_id_33, t25.owner_group_id AS owner_group_id_34, t25.subject_id AS subject_id_35 FROM core.subject_inform_consent t0 LEFT JOIN core.subject_extend t25 ON t0.subject_plugin_id = t25.id WHERE t0.subject_about_id = $1 AND t0.subcohort_inform_consent_id IN ($2, $3) LIMIT 1;
Date: 2025-11-30 21:35:58 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '43009', $2 = '419', $3 = '418'
16 955ms 19,398 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 #16
Day Hour Count Duration Avg duration 04 573 27ms 0ms 05 521 25ms 0ms 06 516 24ms 0ms 07 516 24ms 0ms 08 516 23ms 0ms 09 516 25ms 0ms 10 522 26ms 0ms 11 517 24ms 0ms 12 515 24ms 0ms 13 518 27ms 0ms 14 514 27ms 0ms 15 516 24ms 0ms 16 516 26ms 0ms 17 510 24ms 0ms 18 522 32ms 0ms 19 508 23ms 0ms 20 509 24ms 0ms 21 508 25ms 0ms 22 509 24ms 0ms 04 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 [ User: tng_migration_user - Total duration: 230ms - Times executed: 19398 ]
[ Application: [unknown] - Total duration: 230ms - Times executed: 19398 ]
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;
Date: 2025-11-29 19:16:50 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '137406'
-
SELECT t0.is_archived AS is_archived_1, t0.created_at AS created_at_2, t0.updated_at AS updated_at_3, t0.id AS id_4, t0.clade_id AS clade_id_5, t0.expired_at AS expired_at_6, t0.owner_user_id AS owner_user_id_7, t0.owner_group_id AS owner_group_id_8, t0.form_structure_variant_id AS form_structure_variant_id_9, t0.form_state_code AS form_state_code_10, t0.subject_id AS subject_id_11, t0.about_subject_id AS about_subject_id_12, t0.notif_state AS notif_state_13 FROM core.form t0 WHERE t0.id = $1;
Date: 2025-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'
17 708ms 6,688 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 = $1 AND m0_.form_state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN $7 AND $8);Times Reported Time consuming bind #17
Day Hour Count Duration Avg duration 04 176 19ms 0ms 05 176 18ms 0ms 06 176 18ms 0ms 07 176 17ms 0ms 08 176 17ms 0ms 09 176 20ms 0ms 10 176 17ms 0ms 11 176 19ms 0ms 12 176 18ms 0ms 13 176 19ms 0ms 14 176 20ms 0ms 15 176 17ms 0ms 16 176 19ms 0ms 17 176 18ms 0ms 18 176 20ms 0ms 19 176 18ms 0ms 20 176 17ms 0ms 21 176 18ms 0ms 22 176 18ms 0ms 04 176 18ms 0ms 05 176 19ms 0ms 06 176 18ms 0ms 07 176 18ms 0ms 08 176 18ms 0ms 09 176 18ms 0ms 10 176 19ms 0ms 11 176 18ms 0ms 12 176 19ms 0ms 13 176 18ms 0ms 14 176 20ms 0ms 15 176 18ms 0ms 16 176 18ms 0ms 17 176 18ms 0ms 18 176 17ms 0ms 19 176 17ms 0ms 20 176 17ms 0ms 21 176 18ms 0ms 22 176 17ms 0ms [ User: tng_migration_user - Total duration: 457ms - Times executed: 6688 ]
[ Application: [unknown] - Total duration: 457ms - Times executed: 6688 ]
-
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 = $1 AND m0_.form_state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN $7 AND $8);
Date: 2025-11-29 17:00:04 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '99', $2 = 'DONE', $3 = 'CLOSED', $4 = 'EXPIRED', $5 = 'EXPIRED_EMPTY', $6 = 't', $7 = '2025-11-08 17:00:02', $8 = '2025-11-21 17:00: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_.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 = $1 AND m0_.form_state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN $7 AND $8);
Date: 2025-11-29 10:00:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '97', $2 = 'DONE', $3 = 'CLOSED', $4 = 'EXPIRED', $5 = 'EXPIRED_EMPTY', $6 = 't', $7 = '2025-07-03 10:00:01', $8 = '2025-07-10 10:00: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_.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 = $1 AND m0_.form_state_code NOT IN ($2, $3, $4, $5) AND m0_.use_alternative <> $6 AND m0_.result_date IS NOT NULL AND (m0_.result_date BETWEEN $7 AND $8);
Date: 2025-11-29 15:00:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '81', $2 = 'DONE', $3 = 'CLOSED', $4 = 'EXPIRED', $5 = 'EXPIRED_EMPTY', $6 = 't', $7 = '2022-11-16 15:00:01', $8 = '2022-11-26 15:00:01'
18 562ms 2,125 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.NAME = $1 LIMIT 1;Times Reported Time consuming bind #18
Day Hour Count Duration Avg duration 04 284 34ms 0ms 05 191 26ms 0ms 06 27 11ms 0ms 07 27 11ms 0ms 08 27 12ms 0ms 09 27 11ms 0ms 10 36 15ms 0ms 11 31 12ms 0ms 12 27 11ms 0ms 13 36 14ms 0ms 14 27 11ms 0ms 15 29 11ms 0ms 16 31 11ms 0ms 17 30 12ms 0ms 18 49 17ms 0ms 19 31 12ms 0ms 20 29 11ms 0ms 21 28 12ms 0ms 22 29 12ms 0ms 23 102 13ms 0ms 04 356 43ms 0ms 05 163 25ms 0ms 06 33 12ms 0ms 07 27 10ms 0ms 08 29 13ms 0ms 09 27 11ms 0ms 10 31 12ms 0ms 11 29 12ms 0ms 12 33 13ms 0ms 13 35 11ms 0ms 14 41 14ms 0ms 15 27 10ms 0ms 16 25 10ms 0ms 17 28 11ms 0ms 18 29 11ms 0ms 19 27 11ms 0ms 20 27 11ms 0ms 21 33 13ms 0ms 22 27 12ms 0ms [ User: tng_migration_user - Total duration: 1s143ms - Times executed: 2125 ]
[ Application: [unknown] - Total duration: 1s143ms - Times executed: 2125 ]
-
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.NAME = $1 LIMIT 1;
Date: 2025-11-30 09:48:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'system'
-
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.NAME = $1 LIMIT 1;
Date: 2025-11-30 18:24:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'system'
-
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.NAME = $1 LIMIT 1;
Date: 2025-11-29 19:42:02 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = 'system'
19 527ms 9,425 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;Times Reported Time consuming bind #19
Day Hour Count Duration Avg duration 04 225 12ms 0ms 05 250 13ms 0ms 06 250 13ms 0ms 07 250 13ms 0ms 08 250 13ms 0ms 09 250 14ms 0ms 10 250 13ms 0ms 11 250 13ms 0ms 12 250 14ms 0ms 13 250 13ms 0ms 14 250 14ms 0ms 15 250 14ms 0ms 16 225 12ms 0ms 17 250 13ms 0ms 18 250 14ms 0ms 19 250 14ms 0ms 20 250 14ms 0ms 21 250 14ms 0ms 22 250 13ms 0ms 04 250 14ms 0ms 05 250 14ms 0ms 06 250 14ms 0ms 07 250 14ms 0ms 08 250 13ms 0ms 09 250 14ms 0ms 10 250 14ms 0ms 11 250 14ms 0ms 12 250 13ms 0ms 13 250 13ms 0ms 14 250 13ms 0ms 15 250 13ms 0ms 16 225 12ms 0ms 17 250 13ms 0ms 18 250 13ms 0ms 19 250 13ms 0ms 20 250 13ms 0ms 21 250 13ms 0ms 22 250 14ms 0ms [ User: tng_migration_user - Total duration: 3s238ms - Times executed: 9425 ]
[ Application: [unknown] - Total duration: 3s238ms - Times executed: 9425 ]
-
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;
Date: 2025-11-29 22:42:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '30'
-
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;
Date: 2025-11-30 11:06:02 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '301'
-
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;
Date: 2025-11-30 21:06:03 Duration: 0ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '199'
20 505ms 629 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 ORDER BY t0.id ASC LIMIT 1;Times Reported Time consuming bind #20
Day Hour Count Duration Avg duration 04 9 6ms 0ms 05 17 13ms 0ms 06 17 13ms 0ms 07 17 13ms 0ms 08 17 14ms 0ms 09 17 13ms 0ms 10 17 14ms 0ms 11 17 12ms 0ms 12 17 13ms 0ms 13 17 14ms 0ms 14 17 13ms 0ms 15 17 13ms 0ms 16 16 11ms 0ms 17 17 13ms 0ms 18 17 12ms 0ms 19 17 13ms 0ms 20 17 13ms 0ms 21 17 14ms 0ms 22 17 13ms 0ms 04 10 6ms 0ms 05 17 14ms 0ms 06 17 14ms 0ms 07 17 13ms 0ms 08 17 14ms 0ms 09 17 13ms 0ms 10 17 14ms 0ms 11 17 13ms 0ms 12 17 14ms 0ms 13 17 12ms 0ms 14 17 14ms 0ms 15 17 13ms 0ms 16 16 12ms 0ms 17 17 12ms 0ms 18 17 13ms 0ms 19 17 14ms 0ms 20 17 13ms 0ms 21 17 13ms 0ms 22 17 14ms 0ms [ User: tng_migration_user - Total duration: 19ms - Times executed: 629 ]
[ Application: [unknown] - Total duration: 19ms - Times executed: 629 ]
-
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 ORDER BY t0.id ASC LIMIT 1;
Date: 2025-11-29 15:59:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '1'
-
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 ORDER BY t0.id ASC LIMIT 1;
Date: 2025-11-29 15:36:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '1'
-
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 ORDER BY t0.id ASC LIMIT 1;
Date: 2025-11-29 14:59:01 Duration: 1ms Database: postgres User: celspac Remote: tng_migration_user Application: 127.0.0.1 Queryid: [unknown] parameters: $1 = '1'
-
Events
Log levels
Key values
- 1,619,286 Event entries
- (EVENTLOG entries are formaly LOG level entries that are not queries)
Events distribution (except queries)
Key values
- 0 PANIC entries
- 34058 FATAL entries
- 0 ERROR entries
- 102 WARNING entries
- 16 EVENTLOG entries
Most Frequent Errors/Events
Key values
- 34,058 Max number of times the same event was reported
- 34,176 Total events found
Rank Times reported Error 1 34,058 FATAL: password authentication failed for user "..."
Times Reported Most Frequent Error / Event #1
Day Hour Count Nov 30 00 1,412 01 1,406 02 1,422 03 1,400 04 1,404 05 1,414 06 1,414 07 1,420 08 1,424 09 1,422 10 1,416 11 1,426 12 1,416 13 1,420 14 1,420 15 1,426 16 1,428 17 1,428 18 1,426 19 1,422 20 1,420 21 1,426 22 1,428 23 1,418 - FATAL: password authentication failed for user "ismael"
Detail: Connection matched file "/etc/postgresql/16/main/pg_hba.conf" line 143: "host all all 10.16.50.12/32 md5"
Date: 2025-11-30 04:03:13 Database: celspac Application: [unknown] User: ismael Remote: 10.16.50.12 Log file: ssh://root@ucet.celspac.cz//var/log/postgresql/postgresql-16-main.log
2 102 WARNING: there is already a transaction in progress
Times Reported Most Frequent Error / Event #2
Day Hour Count Nov 30 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 Nov 30 01 2 23 14