Sort (cost=8725694.92..8725694.92 rows=1 width=625) (actual time=266461.38..266461.38 rows=8 loops=1) -> Nested Loop (cost=8725228.42..8725694.91 rows=1 width=625) (actual time=266452.64..266461.09 rows=8 loops=1) -> Nested Loop (cost=8725228.42..8725691.01 rows=1 width=581) (actual time=266442.99..266448.67 rows=8 loops=1) -> Nested Loop (cost=8725228.42..8725687.12 rows=1 width=537) (actual time=266442.93..266448.29 rows=8 loops=1) -> Nested Loop (cost=8725228.42..8725684.14 rows=1 width=523) (actual time=266442.45..266445.48 rows=8 loops=1) -> Nested Loop (cost=8725228.42..8725680.64 rows=1 width=495) (actual time=266442.38..266444.99 rows=8 loops=1) -> Nested Loop (cost=8725228.42..8725676.67 rows=1 width=434) (actual time=266442.30..266444.43 rows=8 loops=1) -> Merge Join (cost=8725228.42..8725229.20 rows=113 width=422) (actual time=266442.08..266442.77 rows=26 loops=1) -> Sort (cost=8725226.81..8725226.81 rows=54 width=404) (actual time=266441.54..266441.56 rows=27 loops=1) -> Merge Join (cost=8725197.37..8725226.03 rows=54 width=404) (actual time=266439.42..266441.41 rows=27 loops=1) -> Index Scan using locations_pkey on locations (cost=0.00..27.54 rows=568 width=107) (actual time=0.14..1.44 rows=172 loops=1) -> Sort (cost=8725197.37..8725197.37 rows=54 width=297) (actual time=266439.24..266439.25 rows=27 loops=1) -> Hash Join (cost=5.73..8725196.59 rows=54 width=297) (actual time=28490.20..266438.99 rows=27 loops=1) -> Hash Join (cost=4.60..8725192.42 rows=1083 width=272) (actual time=2.25..266436.04 rows=964 loops=1) -> Index Scan using idx_events_date on events (cost=0.00..8725178.35 rows=1083 width=238) (actual time=1.49..266421.59 rows=964 loops=1) SubPlan -> Hash Join (cost=89.59..3792.14 rows=1 width=55) (actual time=311.23..311.23 rows=0 loops=855) -> Hash Join (cost=82.64..3784.86 rows=88 width=23) (actual time=301.99..310.66 rows=0 loops=855) -> Seq Scan on case_clients (cost=0.00..3673.48 rows=11274 width=11) (actual time=0.02..302.20 rows=8822 loops=855) -> Hash (cost=81.53..81.53 rows=887 width=12) (actual time=0.04..0.04 rows=0 loops=855) -> Nested Loop (cost=0.00..81.53 rows=887 width=12) (actual time=0.03..0.04 rows=1 loops=855) -> Index Scan using trial_groups_pkey on trial_groups (cost=0.00..3.49 rows=1 width=4) (actual time=0.02..0.02 rows=0 loops=855) -> Index Scan using idx_cases_tgroup on cases (cost=0.00..77.77 rows=43 width=8) (actual time=0.03..0.07 rows=6 loops=133) -> Hash (cost=6.95..6.95 rows=1 width=32) (actual time=0.30..0.30 rows=0 loops=855) -> Nested Loop (cost=5.48..6.95 rows=1 width=32) (actual time=0.06..0.30 rows=3 loops=855) -> Merge Join (cost=5.48..5.50 rows=1 width=30) (actual time=0.02..0.04 rows=3 loops=855) -> Sort (cost=4.04..4.04 rows=2 width=28) (actual time=0.00..0.00 rows=3 loops=855) -> Merge Join (cost=3.99..4.03 rows=2 width=28) (actual time=0.30..0.30 rows=3 loops=1) -> Sort (cost=1.34..1.34 rows=21 width=8) (actual time=0.11..0.11 rows=2 loops=1) -> Seq Scan on text_lists (cost=0.00..1.10 rows=21 width=8) (actual time=0.01..0.05 rows=21 loops=1) -> Sort (cost=2.65..2.65 rows=2 width=20) (actual time=0.18..0.18 rows=3 loops=1) -> Seq Scan on list_values (cost=0.00..2.65 rows=2 width=20) (actual time=0.01..0.14 rows=3 loops=1) -> Sort (cost=1.45..1.45 rows=3 width=2) (actual time=0.00..0.00 rows=5 loops=855) -> Seq Scan on status s1 (cost=0.00..1.44 rows=3 width=2) (actual time=0.01..0.08 rows=4 loops=1) -> Seq Scan on status s2 (cost=0.00..1.44 rows=3 width=2) (actual time=0.01..0.07 rows=3 loops=2565) -> Nested Loop (cost=5.48..15.71 rows=1 width=47) (actual time=0.07..0.07 rows=0 loops=3312) -> Nested Loop (cost=0.00..8.76 rows=1 width=15) (actual time=0.06..0.07 rows=1 loops=3312) -> Index Scan using cases_pkey on cases (cost=0.00..3.96 rows=1 width=4) (actual time=0.02..0.02 rows=1 loops=3312) -> Index Scan using idx_caseclients_case on case_clients (cost=0.00..4.79 rows=1 width=11) (actual time=0.03..0.03 rows=1 loops=3298) -> Materialize (cost=6.95..6.95 rows=1 width=32) (actual time=0.00..0.00 rows=2 loops=2182) -> Nested Loop (cost=5.48..6.95 rows=1 width=32) (actual time=0.68..0.89 rows=3 loops=1) -> Merge Join (cost=5.48..5.50 rows=1 width=30) (actual time=0.64..0.66 rows=3 loops=1) -> Sort (cost=4.04..4.04 rows=2 width=28) (actual time=0.50..0.50 rows=3 loops=1) -> Merge Join (cost=3.99..4.03 rows=2 width=28) (actual time=0.42..0.43 rows=3 loops=1) -> Sort (cost=1.34..1.34 rows=21 width=8) (actual time=0.16..0.16 rows=2 loops=1) -> Seq Scan on text_lists (cost=0.00..1.10 rows=21 width=8) (actual time=0.06..0.09 rows=21 loops=1) -> Sort (cost=2.65..2.65 rows=2 width=20) (actual time=0.24..0.24 rows=3 loops=1) -> Seq Scan on list_values (cost=0.00..2.65 rows=2 width=20) (actual time=0.06..0.20 rows=3 loops=1) -> Sort (cost=1.45..1.45 rows=3 width=2) (actual time=0.12..0.12 rows=5 loops=1) -> Seq Scan on status s1 (cost=0.00..1.44 rows=3 width=2) (actual time=0.01..0.09 rows=4 loops=1) -> Seq Scan on status s2 (cost=0.00..1.44 rows=3 width=2) (actual time=0.01..0.07 rows=3 loops=3) -> Hash (cost=4.48..4.48 rows=96 width=34) (actual time=0.51..0.51 rows=0 loops=1) -> Seq Scan on event_types (cost=0.00..4.48 rows=96 width=34) (actual time=0.05..0.36 rows=96 loops=1) -> Hash (cost=1.12..1.12 rows=1 width=25) (actual time=0.08..0.08 rows=0 loops=1) -> Seq Scan on event_cats (cost=0.00..1.12 rows=1 width=25) (actual time=0.06..0.07 rows=1 loops=1) -> Sort (cost=1.61..1.61 rows=10 width=18) (actual time=0.49..0.51 rows=30 loops=1) -> Seq Scan on status (cost=0.00..1.52 rows=10 width=18) (actual time=0.05..0.14 rows=9 loops=1) -> Index Scan using event_days_pk on event_days (cost=0.00..3.96 rows=1 width=12) (actual time=0.05..0.05 rows=0 loops=26) -> Index Scan using cases_pkey on cases (cost=0.00..3.96 rows=1 width=61) (actual time=0.03..0.03 rows=0 loops=8) -> Index Scan using trial_groups_pkey on trial_groups (cost=0.00..3.49 rows=1 width=28) (actual time=0.02..0.02 rows=0 loops=8) -> Seq Scan on opp_counsel (cost=0.00..2.44 rows=87 width=14) (actual time=0.01..0.17 rows=87 loops=8) -> Index Scan using events_pkey on events parent (cost=0.00..3.89 rows=1 width=44) (actual time=0.00..0.00 rows=0 loops=8) -> Index Scan using events_pkey on events previous (cost=0.00..3.89 rows=1 width=44) (actual time=0.02..0.02 rows=0 loops=8) SubPlan -> Aggregate (cost=283.08..283.08 rows=1 width=23) (actual time=0.33..0.33 rows=1 loops=4) -> Index Scan using idx_cases_tgroup on cases c1 (cost=0.00..283.05 rows=21 width=23) (actual time=0.08..0.23 rows=4 loops=4) SubPlan -> Index Scan using idx_caseclients_case on case_clients cc1 (cost=0.00..4.78 rows=1 width=7) (actual time=0.03..0.03 rows=1 loops=22) Total runtime: 266463.54 msec