Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QUERY PLAN
- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- Sort (cost=124598.37..124607.09 rows=3490 width=68)
- Sort Key: p_1.date_time
- -> Nested Loop Left Join (cost=85708.17..124393.00 rows=3490 width=68)
- -> Hash Join (cost=43650.83..50493.30 rows=1452 width=64)
- Hash Cond: (s_2.device = o_1.device)
- Join Filter: ((m.date_time >= o_1.start_date) AND (m.date_time <= ((SubPlan 2))))
- -> Hash Join (cost=1815.14..8127.05 rows=2878 width=80)
- Hash Cond: (m.device_info_serial = t_1.device_info_serial)
- -> Gather (cost=1559.97..7769.87 rows=604 width=76)
- Workers Planned: 2
- -> Nested Loop (cost=559.97..6709.47 rows=252 width=76)
- -> Hash Join (cost=559.55..5653.91 rows=252 width=64)
- Hash Cond: (p_1.device_info_serial = t.device_info_serial)
- -> Parallel Seq Scan on "position" p_1 (cost=0.00..5089.26 rows=690 width=32)
- Filter: ((date_time >= '2022-10-01 00:00:00'::timestamp without time zone) AND (date_time < '2022-11-01 14:01:00'::timestamp without time zone))
- -> Hash (cost=547.63..547.63 rows=953 width=40)
- -> Hash Join (cost=457.84..547.63 rows=953 width=40)
- Hash Cond: (p_2.id = p.id)
- -> Hash Join (cost=452.30..539.50 rows=953 width=48)
- Hash Cond: (s.individual = i.id)
- -> Hash Join (cost=361.39..446.09 rows=953 width=48)
- Hash Cond: (s.device = t.id)
- -> Hash Left Join (cost=264.60..346.80 rows=953 width=40)
- Hash Cond: (s.individual = o.individual)
- -> Hash Join (cost=45.41..120.14 rows=953 width=40)
- Hash Cond: (s.project = p_2.id)
- -> Seq Scan on ee_track_session s (cost=0.00..68.33 rows=2333 width=32)
- -> Hash (cost=44.93..44.93 rows=38 width=8)
- -> HashAggregate (cost=44.17..44.55 rows=38 width=8)
- Group Key: p_2.id
- -> Nested Loop (cost=36.15..44.08 rows=38 width=8)
- -> Hash Join (cost=36.01..40.45 rows=3 width=16)
- Hash Cond: (direct_p.id = m_2.project)
- -> Seq Scan on ee_project direct_p (cost=0.00..4.13 rows=113 width=24)
- -> Hash (cost=35.97..35.97 rows=3 width=8)
- -> Unique (cost=35.93..35.94 rows=3 width=8)
- -> Sort (cost=35.93..35.94 rows=3 width=8)
- Sort Key: m_2.project
- -> Hash Join (cost=14.55..35.91 rows=3 width=8)
- Hash Cond: (m_2.member_user = u.id)
- -> Seq Scan on ee_membership m_2 (cost=0.00..19.86 rows=562 width=16)
- Filter: (((status)::text = 'APPROVED'::text) AND ((role)::text = ANY ('{BASE,ADMIN,LEADER}'::text[])))
- -> Hash (cost=14.53..14.53 rows=2 width=8)
- -> Seq Scan on ee_user u (cost=0.00..14.53 rows=2 width=8)
- Filter: ((login_name)::name = "current_user"())
- -> Index Scan using ee_project_rgt_key on ee_project p_2 (cost=0.14..1.08 rows=13 width=24)
- Index Cond: (rgt <= direct_p.rgt)
- Filter: (lft >= direct_p.lft)
- -> Hash (cost=207.57..207.57 rows=930 width=8)
- -> Hash Join (cost=136.80..207.57 rows=930 width=8)
- Hash Cond: (i_1.species = s_1.id)
- -> Hash Join (cost=134.56..202.70 rows=930 width=16)
- Hash Cond: (i_1.id = o.individual)
- -> Seq Scan on ee_individual i_1 (cost=0.00..62.07 rows=2307 width=16)
- -> Hash (cost=122.94..122.94 rows=930 width=8)
- -> HashAggregate (cost=104.34..113.64 rows=930 width=8)
- Group Key: o.individual
- -> Hash Join (cost=45.41..102.01 rows=930 width=8)
- Hash Cond: (o.project = p_3.id)
- -> Seq Scan on ee_individual_ownership o (cost=0.00..50.24 rows=2324 width=16)
- -> Hash (cost=44.93..44.93 rows=38 width=8)
- -> HashAggregate (cost=44.17..44.55 rows=38 width=8)
- Group Key: p_3.id
- -> Nested Loop (cost=36.15..44.08 rows=38 width=8)
- -> Hash Join (cost=36.01..40.45 rows=3 width=16)
- Hash Cond: (direct_p_1.id = m_3.project)
- -> Seq Scan on ee_project direct_p_1 (cost=0.00..4.13 rows=113 width=24)
- -> Hash (cost=35.97..35.97 rows=3 width=8)
- -> Unique (cost=35.93..35.94 rows=3 width=8)
- -> Sort (cost=35.93..35.94 rows=3 width=8)
- Sort Key: m_3.project
- -> Hash Join (cost=14.55..35.91 rows=3 width=8)
- Hash Cond: (m_3.member_user = u_1.id)
- -> Seq Scan on ee_membership m_3 (cost=0.00..19.86 rows=562 width=16)
- Filter: (((status)::text = 'APPROVED'::text) AND ((role)::text = ANY ('{BASE,ADMIN,LEADER}'::text[])))
- -> Hash (cost=14.53..14.53 rows=2 width=8)
- -> Seq Scan on ee_user u_1 (cost=0.00..14.53 rows=2 width=8)
- Filter: ((login_name)::name = "current_user"())
- -> Index Scan using ee_project_rgt_key on ee_project p_3 (cost=0.14..1.08 rows=13 width=24)
- Index Cond: (rgt <= direct_p_1.rgt)
- Filter: (lft >= direct_p_1.lft)
- -> Hash (cost=1.55..1.55 rows=55 width=524)
- -> Seq Scan on ee_species s_1 (cost=0.00..1.55 rows=55 width=524)
- -> Hash (cost=64.13..64.13 rows=2613 width=16)
- -> Seq Scan on ee_tracker t (cost=0.00..64.13 rows=2613 width=16)
- -> Hash (cost=62.07..62.07 rows=2307 width=8)
- -> Seq Scan on ee_individual i (cost=0.00..62.07 rows=2307 width=8)
- -> Hash (cost=4.13..4.13 rows=113 width=8)
- -> Seq Scan on ee_project p (cost=0.00..4.13 rows=113 width=8)
- -> Index Scan using message_pkey on message m (cost=0.42..4.19 rows=1 width=16)
- Index Cond: (id = p_1.id)
- -> Hash (cost=243.26..243.26 rows=953 width=16)
- -> HashAggregate (cost=224.20..233.73 rows=953 width=16)
- Group Key: s_2.device, t_1.device_info_serial
- -> Hash Join (cost=142.20..219.43 rows=953 width=16)
- Hash Cond: (s_2.device = t_1.id)
- -> Hash Join (cost=45.41..120.14 rows=953 width=8)
- Hash Cond: (s_2.project = p_4.id)
- -> Seq Scan on ee_track_session s_2 (cost=0.00..68.33 rows=2333 width=16)
- -> Hash (cost=44.93..44.93 rows=38 width=8)
- -> HashAggregate (cost=44.17..44.55 rows=38 width=8)
- Group Key: p_4.id
- -> Nested Loop (cost=36.15..44.08 rows=38 width=8)
- -> Hash Join (cost=36.01..40.45 rows=3 width=16)
- Hash Cond: (direct_p_2.id = m_4.project)
- -> Seq Scan on ee_project direct_p_2 (cost=0.00..4.13 rows=113 width=24)
- -> Hash (cost=35.97..35.97 rows=3 width=8)
- -> Unique (cost=35.93..35.94 rows=3 width=8)
- -> Sort (cost=35.93..35.94 rows=3 width=8)
- Sort Key: m_4.project
- -> Hash Join (cost=14.55..35.91 rows=3 width=8)
- Hash Cond: (m_4.member_user = u_2.id)
- -> Seq Scan on ee_membership m_4 (cost=0.00..19.86 rows=562 width=16)
- Filter: (((status)::text = 'APPROVED'::text) AND ((role)::text = ANY ('{BASE,ADMIN,LEADER}'::text[])))
- -> Hash (cost=14.53..14.53 rows=2 width=8)
- -> Seq Scan on ee_user u_2 (cost=0.00..14.53 rows=2 width=8)
- Filter: ((login_name)::name = "current_user"())
- -> Index Scan using ee_project_rgt_key on ee_project p_4 (cost=0.14..1.08 rows=13 width=24)
- Index Cond: (rgt <= direct_p_2.rgt)
- Filter: (lft >= direct_p_2.lft)
- -> Hash (cost=64.13..64.13 rows=2613 width=16)
- -> Seq Scan on ee_tracker t_1 (cost=0.00..64.13 rows=2613 width=16)
- -> Hash (cost=41824.35..41824.35 rows=908 width=24)
- -> Unique (cost=41806.19..41815.27 rows=908 width=24)
- CTE ends
- -> Hash Anti Join (cost=163.35..240.43 rows=908 width=16)
- Hash Cond: (o_5.device = o_6.device)
- Join Filter: ((o_6.start_date <= o_5.end_date) AND (o_6.end_date > o_5.end_date))
- -> Hash Join (cost=45.41..106.03 rows=953 width=16)
- Hash Cond: (o_5.project = p_10.id)
- -> Seq Scan on ee_tracker_ownership o_5 (cost=0.00..53.83 rows=2483 width=24)
- -> Hash (cost=44.93..44.93 rows=38 width=8)
- -> HashAggregate (cost=44.17..44.55 rows=38 width=8)
- Group Key: p_10.id
- -> Nested Loop (cost=36.15..44.08 rows=38 width=8)
- -> Hash Join (cost=36.01..40.45 rows=3 width=16)
- Hash Cond: (direct_p_8.id = m_10.project)
- -> Seq Scan on ee_project direct_p_8 (cost=0.00..4.13 rows=113 width=24)
- -> Hash (cost=35.97..35.97 rows=3 width=8)
- -> Unique (cost=35.93..35.94 rows=3 width=8)
- -> Sort (cost=35.93..35.94 rows=3 width=8)
- Sort Key: m_10.project
- -> Hash Join (cost=14.55..35.91 rows=3 width=8)
- Hash Cond: (m_10.member_user = u_8.id)
- -> Seq Scan on ee_membership m_10 (cost=0.00..19.86 rows=562 width=16)
- Filter: (((status)::text = 'APPROVED'::text) AND ((role)::text = ANY ('{BASE,ADMIN,LEADER}'::text[])))
- -> Hash (cost=14.53..14.53 rows=2 width=8)
- -> Seq Scan on ee_user u_8 (cost=0.00..14.53 rows=2 width=8)
- Filter: ((login_name)::name = "current_user"())
- -> Index Scan using ee_project_rgt_key on ee_project p_10 (cost=0.14..1.08 rows=13 width=24)
- Index Cond: (rgt <= direct_p_8.rgt)
- Filter: (lft >= direct_p_8.lft)
- -> Hash (cost=106.03..106.03 rows=953 width=24)
- -> Hash Join (cost=45.41..106.03 rows=953 width=24)
- Hash Cond: (o_6.project = p_11.id)
- -> Seq Scan on ee_tracker_ownership o_6 (cost=0.00..53.83 rows=2483 width=32)
- -> Hash (cost=44.93..44.93 rows=38 width=8)
- -> HashAggregate (cost=44.17..44.55 rows=38 width=8)
- Group Key: p_11.id
- -> Nested Loop (cost=36.15..44.08 rows=38 width=8)
- -> Hash Join (cost=36.01..40.45 rows=3 width=16)
- Hash Cond: (direct_p_9.id = m_11.project)
- -> Seq Scan on ee_project direct_p_9 (cost=0.00..4.13 rows=113 width=24)
- -> Hash (cost=35.97..35.97 rows=3 width=8)
- -> Unique (cost=35.93..35.94 rows=3 width=8)
- -> Sort (cost=35.93..35.94 rows=3 width=8)
- Sort Key: m_11.project
- -> Hash Join (cost=14.55..35.91 rows=3 width=8)
- Hash Cond: (m_11.member_user = u_9.id)
- -> Seq Scan on ee_membership m_11 (cost=0.00..19.86 rows=562 width=16)
- Filter: (((status)::text = 'APPROVED'::text) AND ((role)::text = ANY ('{BASE,ADMIN,LEADER}'::text[])))
- -> Hash (cost=14.53..14.53 rows=2 width=8)
- -> Seq Scan on ee_user u_9 (cost=0.00..14.53 rows=2 width=8)
- Filter: ((login_name)::name = "current_user"())
- -> Index Scan using ee_project_rgt_key on ee_project p_11 (cost=0.14..1.08 rows=13 width=24)
- Index Cond: (rgt <= direct_p_9.rgt)
- Filter: (lft >= direct_p_9.lft)
- -> Sort (cost=41565.75..41568.02 rows=908 width=24)
- Sort Key: o_1.device, o_1.start_date, ((SubPlan 2))
- -> Hash Anti Join (cost=163.35..41521.14 rows=908 width=24)
- Hash Cond: (o_1.device = o_2.device)
- Join Filter: ((o_2.start_date < o_1.start_date) AND (o_2.end_date >= o_1.start_date))
- -> Hash Join (cost=45.41..106.03 rows=953 width=16)
- Hash Cond: (o_1.project = p_5.id)
- -> Seq Scan on ee_tracker_ownership o_1 (cost=0.00..53.83 rows=2483 width=24)
- -> Hash (cost=44.93..44.93 rows=38 width=8)
- -> HashAggregate (cost=44.17..44.55 rows=38 width=8)
- Group Key: p_5.id
- -> Nested Loop (cost=36.15..44.08 rows=38 width=8)
- -> Hash Join (cost=36.01..40.45 rows=3 width=16)
- Hash Cond: (direct_p_3.id = m_5.project)
- -> Seq Scan on ee_project direct_p_3 (cost=0.00..4.13 rows=113 width=24)
- -> Hash (cost=35.97..35.97 rows=3 width=8)
- -> Unique (cost=35.93..35.94 rows=3 width=8)
- -> Sort (cost=35.93..35.94 rows=3 width=8)
- Sort Key: m_5.project
- -> Hash Join (cost=14.55..35.91 rows=3 width=8)
- Hash Cond: (m_5.member_user = u_3.id)
- -> Seq Scan on ee_membership m_5 (cost=0.00..19.86 rows=562 width=16)
- Filter: (((status)::text = 'APPROVED'::text) AND ((role)::text = ANY ('{BASE,ADMIN,LEADER}'::text[])))
- -> Hash (cost=14.53..14.53 rows=2 width=8)
- -> Seq Scan on ee_user u_3 (cost=0.00..14.53 rows=2 width=8)
- Filter: ((login_name)::name = "current_user"())
- -> Index Scan using ee_project_rgt_key on ee_project p_5 (cost=0.14..1.08 rows=13 width=24)
- Index Cond: (rgt <= direct_p_3.rgt)
- Filter: (lft >= direct_p_3.lft)
- -> Hash (cost=106.03..106.03 rows=953 width=24)
- -> Hash Join (cost=45.41..106.03 rows=953 width=24)
- Hash Cond: (o_2.project = p_6.id)
- -> Seq Scan on ee_tracker_ownership o_2 (cost=0.00..53.83 rows=2483 width=32)
- -> Hash (cost=44.93..44.93 rows=38 width=8)
- -> HashAggregate (cost=44.17..44.55 rows=38 width=8)
- Group Key: p_6.id
- -> Nested Loop (cost=36.15..44.08 rows=38 width=8)
- -> Hash Join (cost=36.01..40.45 rows=3 width=16)
- Hash Cond: (direct_p_4.id = m_6.project)
- -> Seq Scan on ee_project direct_p_4 (cost=0.00..4.13 rows=113 width=24)
- -> Hash (cost=35.97..35.97 rows=3 width=8)
- -> Unique (cost=35.93..35.94 rows=3 width=8)
- -> Sort (cost=35.93..35.94 rows=3 width=8)
- Sort Key: m_6.project
- -> Hash Join (cost=14.55..35.91 rows=3 width=8)
- Hash Cond: (m_6.member_user = u_4.id)
- -> Seq Scan on ee_membership m_6 (cost=0.00..19.86 rows=562 width=16)
- Filter: (((status)::text = 'APPROVED'::text) AND ((role)::text = ANY ('{BASE,ADMIN,LEADER}'::text[])))
- -> Hash (cost=14.53..14.53 rows=2 width=8)
- -> Seq Scan on ee_user u_4 (cost=0.00..14.53 rows=2 width=8)
- Filter: ((login_name)::name = "current_user"())
- -> Index Scan using ee_project_rgt_key on ee_project p_6 (cost=0.14..1.08 rows=13 width=24)
- Index Cond: (rgt <= direct_p_4.rgt)
- Filter: (lft >= direct_p_4.lft)
- SubPlan 2
- -> Limit (cost=0.00..45.46 rows=1 width=8)
- -> Nested Loop Anti Join (cost=0.00..45.46 rows=1 width=8)
- Join Filter: ((e2.e < e.e) AND (e.tracker_id = e2.tracker_id))
- -> CTE Scan on ends e (cost=0.00..22.70 rows=2 width=16)
- Filter: ((o_1.start_date < e) AND (o_1.device = tracker_id))
- -> CTE Scan on ends e2 (cost=0.00..22.70 rows=2 width=16)
- Filter: ((o_1.start_date < e) AND (tracker_id = o_1.device))
- -> Hash Join (cost=42057.33..42079.24 rows=2 width=12)
- Hash Cond: (o_3.device = s_3.device)
- Join Filter: ((m_1.date_time >= o_3.start_date) AND (m_1.date_time <= ((SubPlan 4))))
- -> Unique (cost=41806.19..41815.27 rows=908 width=24)
- CTE ends
- -> Hash Anti Join (cost=163.35..240.43 rows=908 width=16)
- Hash Cond: (o_7.device = o_8.device)
- Join Filter: ((o_8.start_date <= o_7.end_date) AND (o_8.end_date > o_7.end_date))
- -> Hash Join (cost=45.41..106.03 rows=953 width=16)
- Hash Cond: (o_7.project = p_12.id)
- -> Seq Scan on ee_tracker_ownership o_7 (cost=0.00..53.83 rows=2483 width=24)
- -> Hash (cost=44.93..44.93 rows=38 width=8)
- -> HashAggregate (cost=44.17..44.55 rows=38 width=8)
- Group Key: p_12.id
- -> Nested Loop (cost=36.15..44.08 rows=38 width=8)
- -> Hash Join (cost=36.01..40.45 rows=3 width=16)
- Hash Cond: (direct_p_10.id = m_12.project)
- -> Seq Scan on ee_project direct_p_10 (cost=0.00..4.13 rows=113 width=24)
- -> Hash (cost=35.97..35.97 rows=3 width=8)
- -> Unique (cost=35.93..35.94 rows=3 width=8)
- -> Sort (cost=35.93..35.94 rows=3 width=8)
- Sort Key: m_12.project
- -> Hash Join (cost=14.55..35.91 rows=3 width=8)
- Hash Cond: (m_12.member_user = u_10.id)
- -> Seq Scan on ee_membership m_12 (cost=0.00..19.86 rows=562 width=16)
- Filter: (((status)::text = 'APPROVED'::text) AND ((role)::text = ANY ('{BASE,ADMIN,LEADER}'::text[])))
- -> Hash (cost=14.53..14.53 rows=2 width=8)
- -> Seq Scan on ee_user u_10 (cost=0.00..14.53 rows=2 width=8)
- Filter: ((login_name)::name = "current_user"())
- -> Index Scan using ee_project_rgt_key on ee_project p_12 (cost=0.14..1.08 rows=13 width=24)
- Index Cond: (rgt <= direct_p_10.rgt)
- Filter: (lft >= direct_p_10.lft)
- -> Hash (cost=106.03..106.03 rows=953 width=24)
- -> Hash Join (cost=45.41..106.03 rows=953 width=24)
- Hash Cond: (o_8.project = p_13.id)
- -> Seq Scan on ee_tracker_ownership o_8 (cost=0.00..53.83 rows=2483 width=32)
- -> Hash (cost=44.93..44.93 rows=38 width=8)
- -> HashAggregate (cost=44.17..44.55 rows=38 width=8)
- Group Key: p_13.id
- -> Nested Loop (cost=36.15..44.08 rows=38 width=8)
- -> Hash Join (cost=36.01..40.45 rows=3 width=16)
- Hash Cond: (direct_p_11.id = m_13.project)
- -> Seq Scan on ee_project direct_p_11 (cost=0.00..4.13 rows=113 width=24)
- -> Hash (cost=35.97..35.97 rows=3 width=8)
- -> Unique (cost=35.93..35.94 rows=3 width=8)
- -> Sort (cost=35.93..35.94 rows=3 width=8)
- Sort Key: m_13.project
- -> Hash Join (cost=14.55..35.91 rows=3 width=8)
- Hash Cond: (m_13.member_user = u_11.id)
- -> Seq Scan on ee_membership m_13 (cost=0.00..19.86 rows=562 width=16)
- Filter: (((status)::text = 'APPROVED'::text) AND ((role)::text = ANY ('{BASE,ADMIN,LEADER}'::text[])))
- -> Hash (cost=14.53..14.53 rows=2 width=8)
- -> Seq Scan on ee_user u_11 (cost=0.00..14.53 rows=2 width=8)
- Filter: ((login_name)::name = "current_user"())
- -> Index Scan using ee_project_rgt_key on ee_project p_13 (cost=0.14..1.08 rows=13 width=24)
- Index Cond: (rgt <= direct_p_11.rgt)
- Filter: (lft >= direct_p_11.lft)
- -> Sort (cost=41565.75..41568.02 rows=908 width=24)
- Sort Key: o_3.device, o_3.start_date, ((SubPlan 4))
- -> Hash Anti Join (cost=163.35..41521.14 rows=908 width=24)
- Hash Cond: (o_3.device = o_4.device)
- Join Filter: ((o_4.start_date < o_3.start_date) AND (o_4.end_date >= o_3.start_date))
- -> Hash Join (cost=45.41..106.03 rows=953 width=16)
- Hash Cond: (o_3.project = p_7.id)
- -> Seq Scan on ee_tracker_ownership o_3 (cost=0.00..53.83 rows=2483 width=24)
- -> Hash (cost=44.93..44.93 rows=38 width=8)
- -> HashAggregate (cost=44.17..44.55 rows=38 width=8)
- Group Key: p_7.id
- -> Nested Loop (cost=36.15..44.08 rows=38 width=8)
- -> Hash Join (cost=36.01..40.45 rows=3 width=16)
- Hash Cond: (direct_p_5.id = m_7.project)
- -> Seq Scan on ee_project direct_p_5 (cost=0.00..4.13 rows=113 width=24)
- -> Hash (cost=35.97..35.97 rows=3 width=8)
- -> Unique (cost=35.93..35.94 rows=3 width=8)
- -> Sort (cost=35.93..35.94 rows=3 width=8)
- Sort Key: m_7.project
- -> Hash Join (cost=14.55..35.91 rows=3 width=8)
- Hash Cond: (m_7.member_user = u_5.id)
- -> Seq Scan on ee_membership m_7 (cost=0.00..19.86 rows=562 width=16)
- Filter: (((status)::text = 'APPROVED'::text) AND ((role)::text = ANY ('{BASE,ADMIN,LEADER}'::text[])))
- -> Hash (cost=14.53..14.53 rows=2 width=8)
- -> Seq Scan on ee_user u_5 (cost=0.00..14.53 rows=2 width=8)
- Filter: ((login_name)::name = "current_user"())
- -> Index Scan using ee_project_rgt_key on ee_project p_7 (cost=0.14..1.08 rows=13 width=24)
- Index Cond: (rgt <= direct_p_5.rgt)
- Filter: (lft >= direct_p_5.lft)
- -> Hash (cost=106.03..106.03 rows=953 width=24)
- -> Hash Join (cost=45.41..106.03 rows=953 width=24)
- Hash Cond: (o_4.project = p_8.id)
- -> Seq Scan on ee_tracker_ownership o_4 (cost=0.00..53.83 rows=2483 width=32)
- -> Hash (cost=44.93..44.93 rows=38 width=8)
- -> HashAggregate (cost=44.17..44.55 rows=38 width=8)
- Group Key: p_8.id
- -> Nested Loop (cost=36.15..44.08 rows=38 width=8)
- -> Hash Join (cost=36.01..40.45 rows=3 width=16)
- Hash Cond: (direct_p_6.id = m_8.project)
- -> Seq Scan on ee_project direct_p_6 (cost=0.00..4.13 rows=113 width=24)
- -> Hash (cost=35.97..35.97 rows=3 width=8)
- -> Unique (cost=35.93..35.94 rows=3 width=8)
- -> Sort (cost=35.93..35.94 rows=3 width=8)
- Sort Key: m_8.project
- -> Hash Join (cost=14.55..35.91 rows=3 width=8)
- Hash Cond: (m_8.member_user = u_6.id)
- -> Seq Scan on ee_membership m_8 (cost=0.00..19.86 rows=562 width=16)
- Filter: (((status)::text = 'APPROVED'::text) AND ((role)::text = ANY ('{BASE,ADMIN,LEADER}'::text[])))
- -> Hash (cost=14.53..14.53 rows=2 width=8)
- -> Seq Scan on ee_user u_6 (cost=0.00..14.53 rows=2 width=8)
- Filter: ((login_name)::name = "current_user"())
- -> Index Scan using ee_project_rgt_key on ee_project p_8 (cost=0.14..1.08 rows=13 width=24)
- Index Cond: (rgt <= direct_p_6.rgt)
- Filter: (lft >= direct_p_6.lft)
- SubPlan 4
- -> Limit (cost=0.00..45.46 rows=1 width=8)
- -> Nested Loop Anti Join (cost=0.00..45.46 rows=1 width=8)
- Join Filter: ((e2_1.e < e_1.e) AND (e_1.tracker_id = e2_1.tracker_id))
- -> CTE Scan on ends e_1 (cost=0.00..22.70 rows=2 width=16)
- Filter: ((o_3.start_date < e) AND (o_3.device = tracker_id))
- -> CTE Scan on ends e2_1 (cost=0.00..22.70 rows=2 width=16)
- Filter: ((o_3.start_date < e) AND (tracker_id = o_3.device))
- -> Hash (cost=251.08..251.08 rows=5 width=28)
- -> Hash Join (cost=228.40..251.08 rows=5 width=28)
- Hash Cond: (t_2.device_info_serial = m_1.device_info_serial)
- -> HashAggregate (cost=224.20..233.73 rows=953 width=16)
- Group Key: s_3.device, t_2.device_info_serial
- -> Hash Join (cost=142.20..219.43 rows=953 width=16)
- Hash Cond: (s_3.device = t_2.id)
- -> Hash Join (cost=45.41..120.14 rows=953 width=8)
- Hash Cond: (s_3.project = p_9.id)
- -> Seq Scan on ee_track_session s_3 (cost=0.00..68.33 rows=2333 width=16)
- -> Hash (cost=44.93..44.93 rows=38 width=8)
- -> HashAggregate (cost=44.17..44.55 rows=38 width=8)
- Group Key: p_9.id
- -> Nested Loop (cost=36.15..44.08 rows=38 width=8)
- -> Hash Join (cost=36.01..40.45 rows=3 width=16)
- Hash Cond: (direct_p_7.id = m_9.project)
- -> Seq Scan on ee_project direct_p_7 (cost=0.00..4.13 rows=113 width=24)
- -> Hash (cost=35.97..35.97 rows=3 width=8)
- -> Unique (cost=35.93..35.94 rows=3 width=8)
- -> Sort (cost=35.93..35.94 rows=3 width=8)
- Sort Key: m_9.project
- -> Hash Join (cost=14.55..35.91 rows=3 width=8)
- Hash Cond: (m_9.member_user = u_7.id)
- -> Seq Scan on ee_membership m_9 (cost=0.00..19.86 rows=562 width=16)
- Filter: (((status)::text = 'APPROVED'::text) AND ((role)::text = ANY ('{BASE,ADMIN,LEADER}'::text[])))
- -> Hash (cost=14.53..14.53 rows=2 width=8)
- -> Seq Scan on ee_user u_7 (cost=0.00..14.53 rows=2 width=8)
- Filter: ((login_name)::name = "current_user"())
- -> Index Scan using ee_project_rgt_key on ee_project p_9 (cost=0.14..1.08 rows=13 width=24)
- Index Cond: (rgt <= direct_p_7.rgt)
- Filter: (lft >= direct_p_7.lft)
- -> Hash (cost=64.13..64.13 rows=2613 width=16)
- -> Seq Scan on ee_tracker t_2 (cost=0.00..64.13 rows=2613 width=16)
- -> Hash (cost=4.19..4.19 rows=1 width=24)
- -> Index Scan using message_pkey on message m_1 (cost=0.42..4.19 rows=1 width=24)
- Index Cond: (id = p_1.id)
- (394 rows)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement