Enumerated CT-Where

Change label
Query Plan as raw text
Summary
Time Node
Node (ms) Percent
4907.146 100.00%
 Merge Join (cost=234737.38..284955.77 rows=2 width=311) (actual time=1515.034..4907.146 rows=2 loops=1)
  Merge Cond: (r.submission_id = r.submission_id)
1612.163 32.85%
  -> GroupAggregate (cost=67108.03..116165.93 rows=91198 width=22) (actual time=437.331..1612.163 rows=2081 loops=1)
475.001 9.68%
        -> Sort (cost=67108.03..68194.85 rows=434726 width=22) (actual time=436.566..475.001 rows=47864 loops=1)
              Sort Key: r.submission_id
              Sort Method:  external merge  Disk: 3824kB
270.843 5.52%
              -> Hash Join (cost=16.87..17478.49 rows=434726 width=22) (actual time=0.467..270.843 rows=106145 loops=1)
                    Hash Cond: (r.question_id = cvq.id)
96.268 1.96%
                    -> Seq Scan on canvas_integerresponse r (cost=0.0..10547.08 rows=684608 width=12) (actual time=0.019..96.268 rows=682405 loops=1)
0.414 0.01%
                    -> Hash (cost=15.28..15.28 rows=127 width=18) (actual time=0.414..0.414 rows=158 loops=1)
0.339 0.01%
                          -> Hash Join (cost=8.04..15.28 rows=127 width=18) (actual time=0.165..0.339 rows=158 loops=1)
                                Hash Cond: (cvq.question_id = q.id)
0.085 0.00%
                                -> Seq Scan on canvas_chartversionquestion cvq (cost=0.0..5.5 rows=127 width=12) (actual time=0.019..0.085 rows=158 loops=1)
                                      Filter: (chart_id = ANY ('{3,18}'::integer[]))
0.127 0.00%
                                -> Hash (cost=6.35..6.35 rows=135 width=14) (actual time=0.127..0.127 rows=135 loops=1)
0.063 0.00%
                                      -> Seq Scan on canvas_question q (cost=0.0..6.35 rows=135 width=14) (actual time=0.011..0.063 rows=135 loops=1)
3294.419 67.14%
  -> Materialize (cost=167629.35..167629.37 rows=2 width=243) (actual time=1077.690..3294.419 rows=2 loops=1)
3294.393 67.13%
        -> Merge Join (cost=121224.64..167629.34 rows=2 width=243) (actual time=1077.677..3294.393 rows=2 loops=1)
              Merge Cond: (r.submission_id = r.submission_id)
2146.650 43.75%
              -> GroupAggregate (cost=47015.22..92430.05 rows=77107 width=22) (actual time=430.290..2146.650 rows=2081 loops=1)
477.430 9.73%
                    -> Sort (cost=47015.22..47783.68 rows=307384 width=22) (actual time=429.314..477.430 rows=58269 loops=1)
                          Sort Key: r.submission_id
                          Sort Method:  external merge  Disk: 5104kB
224.675 4.58%
                          -> Hash Join (cost=16.87..12690.66 rows=307384 width=22) (actual time=0.457..224.675 rows=129220 loops=1)
                                Hash Cond: (r.question_id = cvq.id)
70.401 1.43%
                                -> Seq Scan on canvas_foreignkeyresponse r (cost=0.0..7784.69 rows=484069 width=12) (actual time=0.019..70.401 rows=471612 loops=1)
0.397 0.01%
                                -> Hash (cost=15.28..15.28 rows=127 width=18) (actual time=0.397..0.397 rows=158 loops=1)
0.318 0.01%
                                      -> Hash Join (cost=8.04..15.28 rows=127 width=18) (actual time=0.151..0.318 rows=158 loops=1)
                                            Hash Cond: (cvq.question_id = q.id)
0.094 0.00%
                                            -> Seq Scan on canvas_chartversionquestion cvq (cost=0.0..5.5 rows=127 width=12) (actual time=0.020..0.094 rows=158 loops=1)
                                                  Filter: (chart_id = ANY ('{3,18}'::integer[]))
0.118 0.00%
                                            -> Hash (cost=6.35..6.35 rows=135 width=14) (actual time=0.118..0.118 rows=135 loops=1)
0.062 0.00%
                                                  -> Seq Scan on canvas_question q (cost=0.0..6.35 rows=135 width=14) (actual time=0.010..0.062 rows=135 loops=1)
1147.097 23.38%
              -> Materialize (cost=74209.42..74209.45 rows=3 width=127) (actual time=647.378..1147.097 rows=2 loops=1)
1147.080 23.38%
                    -> Merge Join (cost=59047.61..74209.42 rows=3 width=127) (actual time=647.370..1147.080 rows=2 loops=1)
                          Merge Cond: (r.submission_id = r.submission_id)
630.427 12.85%
                          -> GroupAggregate (cost=13992.82..28252.03 rows=69099 width=19) (actual time=179.671..630.427 rows=2081 loops=1)
196.376 4.00%
                                -> Sort (cost=13992.82..14236.22 rows=97359 width=19) (actual time=179.335..196.376 rows=29135 loops=1)
                                      Sort Key: r.submission_id
                                      Sort Method:  external merge  Disk: 2168kB
79.920 1.63%
                                      -> Hash Join (cost=16.87..3927.62 rows=97359 width=19) (actual time=0.453..79.920 rows=64610 loops=1)
                                            Hash Cond: (r.question_id = cvq.id)
21.727 0.44%
                                            -> Seq Scan on canvas_booleanresponse r (cost=0.0..2362.21 rows=153321 width=9) (actual time=0.019..21.727 rows=150208 loops=1)
0.400 0.01%
                                            -> Hash (cost=15.28..15.28 rows=127 width=18) (actual time=0.400..0.400 rows=158 loops=1)
0.335 0.01%
                                                  -> Hash Join (cost=8.04..15.28 rows=127 width=18) (actual time=0.149..0.335 rows=158 loops=1)
                                                        Hash Cond: (cvq.question_id = q.id)
0.098 0.00%
                                                        -> Seq Scan on canvas_chartversionquestion cvq (cost=0.0..5.5 rows=127 width=12) (actual time=0.020..0.098 rows=158 loops=1)
                                                              Filter: (chart_id = ANY ('{3,18}'::integer[]))
0.115 0.00%
                                                        -> Hash (cost=6.35..6.35 rows=135 width=14) (actual time=0.115..0.115 rows=135 loops=1)
0.063 0.00%
                                                              -> Seq Scan on canvas_question q (cost=0.0..6.35 rows=135 width=14) (actual time=0.011..0.063 rows=135 loops=1)
516.111 10.52%
                          -> Materialize (cost=45054.79..45054.84 rows=5 width=109) (actual time=467.690..516.111 rows=2 loops=1)
516.102 10.52%
                                -> Merge Join (cost=37940.35..45054.79 rows=5 width=109) (actual time=467.685..516.102 rows=2 loops=1)
                                      Merge Cond: (r.submission_id = cs.id)
105.795 2.16%
                                      -> GroupAggregate (cost=19056.29..24865.75 rows=104389 width=22) (actual time=83.626..105.795 rows=2081 loops=1)
84.602 1.72%
                                            -> Sort (cost=19056.29..19383.07 rows=130712 width=22) (actual time=83.569..84.602 rows=6244 loops=1)
                                                  Sort Key: r.submission_id
                                                  Sort Method:  quicksort  Memory: 1322kB
71.691 1.46%
                                                  -> Hash Join (cost=16.87..5267.36 rows=130712 width=22) (actual time=0.427..71.691 rows=13845 loops=1)
                                                        Hash Cond: (r.question_id = cvq.id)
27.120 0.55%
                                                        -> Seq Scan on canvas_dateresponse r (cost=0.0..3171.45 rows=205845 width=12) (actual time=0.019..27.120 rows=199868 loops=1)
0.384 0.01%
                                                        -> Hash (cost=15.28..15.28 rows=127 width=18) (actual time=0.384..0.384 rows=158 loops=1)
0.323 0.01%
                                                              -> Hash Join (cost=8.04..15.28 rows=127 width=18) (actual time=0.149..0.323 rows=158 loops=1)
                                                                    Hash Cond: (cvq.question_id = q.id)
0.084 0.00%
                                                                    -> Seq Scan on canvas_chartversionquestion cvq (cost=0.0..5.5 rows=127 width=12) (actual time=0.019..0.084 rows=158 loops=1)
                                                                          Filter: (chart_id = ANY ('{3,18}'::integer[]))
0.118 0.00%
                                                                    -> Hash (cost=6.35..6.35 rows=135 width=14) (actual time=0.118..0.118 rows=135 loops=1)
0.064 0.00%
                                                                          -> Seq Scan on canvas_question q (cost=0.0..6.35 rows=135 width=14) (actual time=0.011..0.064 rows=135 loops=1)
409.948 8.35%
                                      -> Materialize (cost=18884.07..18884.12 rows=5 width=93) (actual time=384.052..409.948 rows=2 loops=1)
409.938 8.35%
                                            -> Merge Join (cost=14053.0..18884.06 rows=5 width=93) (actual time=384.046..409.938 rows=2 loops=1)
                                                  Merge Cond: (r.submission_id = cs.id)
75.851 1.55%
                                                  -> GroupAggregate (cost=10833.39..14769.74 rows=71570 width=34) (actual time=50.794..75.851 rows=2 loops=1)
                                                        Filter: (max(CASE WHEN ((q.name || to_char(cvq.file_position, 'FM000'::text)) = 'uid004'::text) THEN r.value ELSE NULL::text END) = 'SHE19631225F2177'::text)
52.446 1.07%
                                                        -> Sort (cost=10833.39..11012.32 rows=71570 width=34) (actual time=50.736..52.446 rows=9230 loops=1)
                                                              Sort Key: r.submission_id
                                                              Sort Method:  quicksort  Memory: 1106kB
42.922 0.87%
                                                              -> Hash Join (cost=16.87..3102.32 rows=71570 width=34) (actual time=0.409..42.922 rows=9230 loops=1)
                                                                    Hash Cond: (r.question_id = cvq.id)
17.676 0.36%
                                                                    -> Seq Scan on canvas_textresponse r (cost=0.0..1947.09 rows=112709 width=24) (actual time=0.013..17.676 rows=109655 loops=1)
0.370 0.01%
                                                                    -> Hash (cost=15.28..15.28 rows=127 width=18) (actual time=0.370..0.370 rows=158 loops=1)
0.306 0.01%
                                                                          -> Hash Join (cost=8.04..15.28 rows=127 width=18) (actual time=0.130..0.306 rows=158 loops=1)
                                                                                Hash Cond: (cvq.question_id = q.id)
0.078 0.00%
                                                                                -> Seq Scan on canvas_chartversionquestion cvq (cost=0.0..5.5 rows=127 width=12) (actual time=0.013..0.078 rows=158 loops=1)
                                                                                      Filter: (chart_id = ANY ('{3,18}'::integer[]))
0.107 0.00%
                                                                                -> Hash (cost=6.35..6.35 rows=135 width=14) (actual time=0.107..0.107 rows=135 loops=1)
0.058 0.00%
                                                                                      -> Seq Scan on canvas_question q (cost=0.0..6.35 rows=135 width=14) (actual time=0.008..0.058 rows=135 loops=1)
333.648 6.80%
                                                  -> Sort (cost=3219.61..3219.63 rows=8 width=25) (actual time=333.242..333.648 rows=2081 loops=1)
                                                        Sort Key: cs.id
                                                        Sort Method:  quicksort  Memory: 553kB
328.711 6.70%
                                                        -> Hash Join (cost=2787.31..3219.49 rows=8 width=25) (actual time=321.154..328.711 rows=4615 loops=1)
                                                              Hash Cond: (r.submission_id = cs.id)
281.847 5.74%
                                                              -> HashAggregate (cost=1250.04..1618.76 rows=4609 width=19) (actual time=278.261..281.847 rows=4615 loops=1)
33.853 0.69%
                                                                    -> Hash Join (cost=16.87..840.32 rows=20486 width=19) (actual time=0.406..33.853 rows=32305 loops=1)
                                                                          Hash Cond: (r.question_id = cvq.id)
5.674 0.12%
                                                                          -> Seq Scan on canvas_nullresponse r (cost=0.0..497.61 rows=32261 width=9) (actual time=0.013..5.674 rows=32305 loops=1)
0.374 0.01%
                                                                          -> Hash (cost=15.28..15.28 rows=127 width=18) (actual time=0.374..0.374 rows=158 loops=1)
0.305 0.01%
                                                                                -> Hash Join (cost=8.04..15.28 rows=127 width=18) (actual time=0.132..0.305 rows=158 loops=1)
                                                                                      Hash Cond: (cvq.question_id = q.id)
0.088 0.00%
                                                                                      -> Seq Scan on canvas_chartversionquestion cvq (cost=0.0..5.5 rows=127 width=12) (actual time=0.014..0.088 rows=158 loops=1)
                                                                                            Filter: (chart_id = ANY ('{3,18}'::integer[]))
0.108 0.00%
                                                                                      -> Hash (cost=6.35..6.35 rows=135 width=14) (actual time=0.108..0.108 rows=135 loops=1)
0.055 0.00%
                                                                                            -> Seq Scan on canvas_question q (cost=0.0..6.35 rows=135 width=14) (actual time=0.009..0.055 rows=135 loops=1)
42.857 0.87%
                                                              -> Hash (cost=1534.82..1534.82 rows=196 width=14) (actual time=42.857..42.857 rows=4615 loops=1)
41.027 0.84%
                                                                    -> Hash Join (cost=1310.12..1534.82 rows=196 width=14) (actual time=35.151..41.027 rows=4615 loops=1)
                                                                          Hash Cond: (r.submission_id = cs.id)
33.702 0.69%
                                                                          -> HashAggregate (cost=294.04..431.11 rows=4569 width=19) (actual time=31.548..33.702 rows=4615 loops=1)
9.048 0.18%
                                                                                -> Hash Join (cost=16.87..250.53 rows=5802 width=19) (actual time=0.421..9.048 rows=9230 loops=1)
                                                                                      Hash Cond: (r.question_id = cvq.id)
1.434 0.03%
                                                                                      -> Seq Scan on canvas_nullbooleanresponse r (cost=0.0..141.37 rows=9137 width=9) (actual time=0.008..1.434 rows=9230 loops=1)
0.401 0.01%
                                                                                      -> Hash (cost=15.28..15.28 rows=127 width=18) (actual time=0.401..0.401 rows=158 loops=1)
0.329 0.01%
                                                                                            -> Hash Join (cost=8.04..15.28 rows=127 width=18) (actual time=0.160..0.329 rows=158 loops=1)
                                                                                                  Hash Cond: (cvq.question_id = q.id)
0.081 0.00%
                                                                                                  -> Seq Scan on canvas_chartversionquestion cvq (cost=0.0..5.5 rows=127 width=12) (actual time=0.015..0.081 rows=158 loops=1)
                                                                                                        Filter: (chart_id = ANY ('{3,18}'::integer[]))
0.123 0.00%
                                                                                                  -> Hash (cost=6.35..6.35 rows=135 width=14) (actual time=0.123..0.123 rows=135 loops=1)
0.059 0.00%
                                                                                                        -> Seq Scan on canvas_question q (cost=0.0..6.35 rows=135 width=14) (actual time=0.009..0.059 rows=135 loops=1)
3.565 0.07%
                                                                          -> Hash (cost=957.47..957.47 rows=4689 width=8) (actual time=3.565..3.565 rows=4615 loops=1)
2.059 0.04%
                                                                                -> Bitmap Heap Scan on canvas_submission cs (cost=92.86..957.47 rows=4689 width=8) (actual time=0.701..2.059 rows=4615 loops=1)
                                                                                      Recheck Cond: (chart_id = ANY ('{3,18}'::integer[]))
0.673 0.01%
                                                                                      -> Bitmap Index Scan on canvas_submission_questionnaire_id (cost=0.0..91.69 rows=4689 width=0) (actual time=0.673..0.673 rows=4726 loops=1)
                                                                                            Index Cond: (chart_id = ANY ('{3,18}'::integer[]))
Run-time
4.914245 seconds (4914.245 ms)