explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PR5m

Settings
# exclusive inclusive rows x rows loops node
1. 4.360 99.630 ↑ 4.4 9 1

Nested Loop Left Join (cost=11,668.05..20,082.03 rows=40 width=808) (actual time=92.243..99.630 rows=9 loops=1)

  • Output: s.id, sr.id, s.created_at, s.user_insert_id, s.remarks, s.active, sr.rel_id, s.type, sr.mode, sr.cia_id, "*SELECT* 1_3".oaci, sr.station_id, s_2.iata_code, sr.agent_id, (("*SELECT* 1_1".name)::text || (COALESCE("*SELECT* 1_1".station, ''::character varying))::text), sr.rate, sr.status_mask, sr.unit, sr.tax_type, sr.rate_min, sr.imp_id, v_imps.code, sr.unit_min, sr.unit_max, s.name, s.code, s.nominal_code, s.reporting_group, sr.from_date, sr.to_date, sr.each, sr.rate_max, sr.agent_type, sr.cia_type, sr.imp_type, sr.station_type, srd.id, srd.active, srd.unit, srd.unit_each, srd.unit_min, srd.unit_max, srd.rate, srd.parent_id, sr.type, sr.active
  • Join Filter: (((s_2.id = sr.station_id) AND ((c_1."group")::text = 'OWN'::text) AND ((sr.station_type)::text = 'SINGLE'::text)) OR (s_2.id = s_1.id))
  • Rows Removed by Join Filter: 36,360
2. 0.027 86.567 ↑ 3.4 9 1

Hash Left Join (cost=11,659.00..17,188.61 rows=31 width=1,809) (actual time=84.648..86.567 rows=9 loops=1)

  • Output: sr.id, sr.rel_id, sr.mode, sr.cia_id, sr.station_id, sr.agent_id, sr.rate, sr.status_mask, sr.unit, sr.tax_type, sr.rate_min, sr.imp_id, sr.unit_min, sr.unit_max, sr.from_date, sr.to_date, sr.each, sr.rate_max, sr.agent_type, sr.cia_type, sr.imp_type, sr.station_type, sr.type, sr.active, s.id, s.created_at, s.user_insert_id, s.remarks, s.active, s.type, s.name, s.code, s.nominal_code, s.reporting_group, "*SELECT* 1_1".name, "*SELECT* 1_1".station, "*SELECT* 1_3".oaci, v_imps.code, s_1.id, srd.id, srd.active, srd.unit, srd.unit_each, srd.unit_min, srd.unit_max, srd.rate, srd.parent_id
  • Hash Cond: (sr.station_id = generic_types_3.id)
  • Join Filter: ((sr.station_type)::text = 'GROUP'::text)
3. 0.011 86.174 ↑ 3.4 9 1

Merge Left Join (cost=11,620.77..17,150.26 rows=31 width=1,805) (actual time=84.260..86.174 rows=9 loops=1)

  • Output: sr.id, sr.rel_id, sr.mode, sr.cia_id, sr.station_id, sr.agent_id, sr.rate, sr.status_mask, sr.unit, sr.tax_type, sr.rate_min, sr.imp_id, sr.unit_min, sr.unit_max, sr.from_date, sr.to_date, sr.each, sr.rate_max, sr.agent_type, sr.cia_type, sr.imp_type, sr.station_type, sr.type, sr.active, s.id, s.created_at, s.user_insert_id, s.remarks, s.active, s.type, s.name, s.code, s.nominal_code, s.reporting_group, "*SELECT* 1_1".name, "*SELECT* 1_1".station, "*SELECT* 1_3".oaci, v_imps.code, srd.id, srd.active, srd.unit, srd.unit_each, srd.unit_min, srd.unit_max, srd.rate, srd.parent_id
  • Merge Cond: (sr.id = srd.parent_id)
4. 0.028 86.109 ↑ 3.4 9 1

Nested Loop Left Join (cost=11,619.63..17,149.02 rows=31 width=1,769) (actual time=84.199..86.109 rows=9 loops=1)

  • Output: sr.id, sr.rel_id, sr.mode, sr.cia_id, sr.station_id, sr.agent_id, sr.rate, sr.status_mask, sr.unit, sr.tax_type, sr.rate_min, sr.imp_id, sr.unit_min, sr.unit_max, sr.from_date, sr.to_date, sr.each, sr.rate_max, sr.agent_type, sr.cia_type, sr.imp_type, sr.station_type, sr.type, sr.active, s.id, s.created_at, s.user_insert_id, s.remarks, s.active, s.type, s.name, s.code, s.nominal_code, s.reporting_group, "*SELECT* 1_1".name, "*SELECT* 1_1".station, "*SELECT* 1_3".oaci, v_imps.code
5. 0.039 86.063 ↑ 3.4 9 1

Nested Loop (cost=11,618.98..17,003.46 rows=31 width=1,767) (actual time=84.182..86.063 rows=9 loops=1)

  • Output: sr.id, sr.rel_id, sr.mode, sr.cia_id, sr.station_id, sr.agent_id, sr.rate, sr.status_mask, sr.unit, sr.tax_type, sr.rate_min, sr.imp_id, sr.unit_min, sr.unit_max, sr.from_date, sr.to_date, sr.each, sr.rate_max, sr.agent_type, sr.cia_type, sr.imp_type, sr.station_type, sr.type, sr.active, s.id, s.created_at, s.user_insert_id, s.remarks, s.active, s.type, s.name, s.code, s.nominal_code, s.reporting_group, "*SELECT* 1_1".name, "*SELECT* 1_1".station, imp.id, "*SELECT* 1_3".oaci
  • Join Filter: ((("*SELECT* 1_3".id = sr.cia_id) AND ((sr.cia_type)::text = 'SINGLE'::text)) OR ("*SELECT* 1_3".id = "*SELECT* 3_2".id))
  • Rows Removed by Join Filter: 537
6. 0.532 78.198 ↓ 5.9 182 1

Nested Loop Left Join (cost=11,365.38..15,851.97 rows=31 width=1,768) (actual time=70.174..78.198 rows=182 loops=1)

  • Output: sr.id, sr.rel_id, sr.mode, sr.cia_id, sr.station_id, sr.agent_id, sr.rate, sr.status_mask, sr.unit, sr.tax_type, sr.rate_min, sr.imp_id, sr.unit_min, sr.unit_max, sr.from_date, sr.to_date, sr.each, sr.rate_max, sr.agent_type, sr.cia_type, sr.imp_type, sr.station_type, sr.type, sr.active, s.id, s.created_at, s.user_insert_id, s.remarks, s.active, s.type, s.name, s.code, s.nominal_code, s.reporting_group, "*SELECT* 1_1".name, "*SELECT* 1_1".station, imp.id, "*SELECT* 3_2".id
  • Join Filter: (((sr.cia_type)::text = 'GROUP'::text) AND (generic_types_1.id = sr.cia_id))
  • Rows Removed by Join Filter: 6,619
7. 0.365 51.890 ↓ 5.8 179 1

Nested Loop Left Join (cost=9,841.55..13,180.62 rows=31 width=1,764) (actual time=44.645..51.890 rows=179 loops=1)

  • Output: sr.id, sr.rel_id, sr.mode, sr.cia_id, sr.station_id, sr.agent_id, sr.rate, sr.status_mask, sr.unit, sr.tax_type, sr.rate_min, sr.imp_id, sr.unit_min, sr.unit_max, sr.from_date, sr.to_date, sr.each, sr.rate_max, sr.agent_type, sr.cia_type, sr.imp_type, sr.station_type, sr.type, sr.active, s.id, s.created_at, s.user_insert_id, s.remarks, s.active, s.type, s.name, s.code, s.nominal_code, s.reporting_group, "*SELECT* 1_1".name, "*SELECT* 1_1".station, imp.id
  • Join Filter: (((sr.imp_type)::text = 'GROUP'::text) AND (generic_types_2.id = sr.imp_id))
  • Rows Removed by Join Filter: 4,435
8. 4.362 50.788 ↓ 2.2 67 1

Nested Loop Left Join (cost=9,835.59..13,148.95 rows=31 width=1,760) (actual time=44.137..50.788 rows=67 loops=1)

  • Output: sr.id, sr.rel_id, sr.mode, sr.cia_id, sr.station_id, sr.agent_id, sr.rate, sr.status_mask, sr.unit, sr.tax_type, sr.rate_min, sr.imp_id, sr.unit_min, sr.unit_max, sr.from_date, sr.to_date, sr.each, sr.rate_max, sr.agent_type, sr.cia_type, sr.imp_type, sr.station_type, sr.type, sr.active, s.id, s.created_at, s.user_insert_id, s.remarks, s.active, s.type, s.name, s.code, s.nominal_code, s.reporting_group, "*SELECT* 1_1".name, "*SELECT* 1_1".station
  • Join Filter: ((("*SELECT* 1_1".id = sr.agent_id) AND ((sr.agent_type)::text = 'SINGLE'::text)) OR ("*SELECT* 1_1".id = "*SELECT* 1".id))
  • Rows Removed by Join Filter: 36,312
9. 0.070 23.244 ↓ 2.2 67 1

Nested Loop Left Join (cost=4,935.19..6,643.42 rows=31 width=732) (actual time=22.830..23.244 rows=67 loops=1)

  • Output: sr.id, sr.rel_id, sr.mode, sr.cia_id, sr.station_id, sr.agent_id, sr.rate, sr.status_mask, sr.unit, sr.tax_type, sr.rate_min, sr.imp_id, sr.unit_min, sr.unit_max, sr.from_date, sr.to_date, sr.each, sr.rate_max, sr.agent_type, sr.cia_type, sr.imp_type, sr.station_type, sr.type, sr.active, "*SELECT* 1".id, s.id, s.created_at, s.user_insert_id, s.remarks, s.active, s.type, s.name, s.code, s.nominal_code, s.reporting_group
  • Join Filter: (((sr.agent_type)::text = 'GROUP'::text) AND (generic_types.id = sr.agent_id))
  • Rows Removed by Join Filter: 201
10. 0.056 0.461 ↓ 2.2 67 1

Nested Loop (cost=0.42..77.14 rows=31 width=728) (actual time=0.108..0.461 rows=67 loops=1)

  • Output: s.id, s.created_at, s.user_insert_id, s.remarks, s.active, s.type, s.name, s.code, s.nominal_code, s.reporting_group, sr.id, sr.rel_id, sr.mode, sr.cia_id, sr.station_id, sr.agent_id, sr.rate, sr.status_mask, sr.unit, sr.tax_type, sr.rate_min, sr.imp_id, sr.unit_min, sr.unit_max, sr.from_date, sr.to_date, sr.each, sr.rate_max, sr.agent_type, sr.cia_type, sr.imp_type, sr.station_type, sr.type, sr.active
  • Inner Unique: true
11. 0.245 0.245 ↓ 1.1 80 1

Index Scan using services_rules_pkey on public.services_rules sr (cost=0.27..40.93 rows=74 width=644) (actual time=0.089..0.245 rows=80 loops=1)

  • Output: sr.id, sr.created_at, sr.user_insert_id, sr.remarks, sr.active, sr.rel_id, sr.type, sr.mode, sr.rate, sr.status_mask, sr.unit, sr.tax_type, sr.rate_min, sr.unit_min, sr.unit_max, sr.from_date, sr.to_date, sr.each, sr.cia_id, sr.station_id, sr.agent_id, sr.imp_id, sr.rate_max, sr.cia_type, sr.imp_type, sr.station_type, sr.agent_type
  • Filter: (((sr.mode)::text = 'IMPORT'::text) AND ((sr.active = 1) OR (sr.active = 2)))
  • Rows Removed by Filter: 204
12. 0.160 0.160 ↑ 1.0 1 80

Index Scan using services_pkey on public.services s (cost=0.14..0.49 rows=1 width=84) (actual time=0.002..0.002 rows=1 loops=80)

  • Output: s.id, s.name, s.code, s.type, s.parent_id, s.priority, s.remarks, s.created_at, s.active, s.user_insert_id, s.nominal_code, s.reporting_group
  • Index Cond: (s.id = sr.rel_id)
  • Filter: (s.active = 1)
  • Rows Removed by Filter: 0
13. 0.000 22.713 ↓ 3.0 3 67

Materialize (cost=4,934.77..6,565.74 rows=1 width=8) (actual time=0.130..0.339 rows=3 loops=67)

  • Output: generic_types.id, "*SELECT* 1".id
14. 0.007 22.714 ↓ 3.0 3 1

Nested Loop (cost=4,934.77..6,565.73 rows=1 width=8) (actual time=8.700..22.714 rows=3 loops=1)

  • Output: generic_types.id, "*SELECT* 1".id
  • Join Filter: (rel.group_id = generic_types.id)
  • Rows Removed by Join Filter: 30
15. 0.084 0.084 ↓ 1.5 3 1

Index Scan using generic_types_pkey on public.generic_types (cost=0.14..21.05 rows=2 width=4) (actual time=0.044..0.084 rows=3 loops=1)

  • Output: generic_types.id, generic_types.name, generic_types.code, generic_types.type, generic_types.parent_id, generic_types.priority, generic_types.remarks, generic_types.created_at, generic_types.active, generic_types.user_insert_id
  • Filter: ((generic_types.type)::text = 'GROUP_AGENT'::text)
  • Rows Removed by Filter: 261
16. 0.011 22.623 ↑ 4.6 11 3

Materialize (cost=4,934.63..6,543.27 rows=51 width=8) (actual time=2.883..7.541 rows=11 loops=3)

  • Output: rel.group_id, "*SELECT* 1".id
17. 0.098 22.612 ↑ 4.6 11 1

Hash Join (cost=4,934.63..6,543.02 rows=51 width=8) (actual time=8.641..22.612 rows=11 loops=1)

  • Output: rel.group_id, "*SELECT* 1".id
  • Hash Cond: ("*SELECT* 1".id = rel.element_id)
18. 0.042 22.117 ↓ 77.4 542 1

Append (cost=4,900.40..6,501.17 rows=7 width=4) (actual time=8.205..22.117 rows=542 loops=1)

19. 0.039 8.504 ↓ 94.8 474 1

Subquery Scan on *SELECT* 1 (cost=4,900.40..4,909.78 rows=5 width=4) (actual time=8.204..8.504 rows=474 loops=1)

  • Output: "*SELECT* 1".id
20. 0.289 8.465 ↓ 94.8 474 1

Hash Join (cost=4,900.40..4,909.73 rows=5 width=20,836) (actual time=8.203..8.465 rows=474 loops=1)

  • Output: users.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::integer, NULL::integer, NULL::character varying, NULL::timestamp without time zone, NULL::character varying, NULL::integer, NULL::integer, NULL::character varying(255), NULL::integer, NULL::timestamp with time zone, NULL::integer, NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::timestamp without time zone, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer
  • Hash Cond: (users.id = rel_u.user_id1)
21. 0.215 5.055 ↑ 1.1 506 1

Sort (cost=4,544.80..4,546.22 rows=571 width=7,340) (actual time=5.028..5.055 rows=506 loops=1)

  • Output: users.id, users.active, users.name, users.type, users.parent_id, users.address, users.card_type, users.card_id, users.telephone, users.email, users.station, users.post_code, users.country, users.city, users.login, users.login_method, users.created_at, users.remarks, users.iso_code, users.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
  • Sort Key: users.parent_id DESC
  • Sort Method: quicksort Memory: 152kB
22. 0.258 4.840 ↑ 1.1 506 1

Unique (cost=2,682.54..2,719.65 rows=571 width=7,340) (actual time=4.554..4.840 rows=506 loops=1)

  • Output: users.id, users.active, users.name, users.type, users.parent_id, users.address, users.card_type, users.card_id, users.telephone, users.email, users.station, users.post_code, users.country, users.city, users.login, users.login_method, users.created_at, users.remarks, users.iso_code, users.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
23. 0.550 4.582 ↑ 1.1 506 1

Sort (cost=2,682.54..2,683.96 rows=571 width=7,340) (actual time=4.552..4.582 rows=506 loops=1)

  • Output: users.id, users.active, users.name, users.type, users.parent_id, users.address, users.card_type, users.card_id, users.telephone, users.email, users.station, users.post_code, users.country, users.city, users.login, users.login_method, users.created_at, users.remarks, users.iso_code, users.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
  • Sort Key: users.id, users.active, users.name, users.type, users.parent_id, users.address, users.card_type, users.card_id, users.telephone, users.email, users.station, users.post_code, users.country, users.city, users.login, users.login_method, users.created_at, users.remarks, users.iso_code, users.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
  • Sort Method: quicksort Memory: 152kB
24. 0.038 4.032 ↑ 1.1 506 1

Append (cost=0.00..857.39 rows=571 width=7,340) (actual time=0.011..4.032 rows=506 loops=1)

25. 1.340 1.340 ↑ 1.1 506 1

Seq Scan on public.users (cost=0.00..279.19 rows=570 width=212) (actual time=0.009..1.340 rows=506 loops=1)

  • Output: users.id, users.active, users.name, users.type, users.parent_id, users.address, users.card_type, users.card_id, users.telephone, users.email, users.station, users.post_code, users.country, users.city, users.login, users.login_method, users.created_at, users.remarks, users.iso_code, users.user_insert_id, NULL::integer, NULL::integer, NULL::character varying, NULL::timestamp without time zone, NULL::character varying
  • Filter: ((users.parent_id IS NULL) AND (users.parent_id IS NULL) AND ((users.type)::text = 'AGENT'::text))
  • Rows Removed by Filter: 7,522
26. 0.000 2.654 ↓ 0.0 0 1

Nested Loop Left Join (cost=286.60..569.64 rows=1 width=159) (actual time=2.654..2.654 rows=0 loops=1)

  • Output: u1.id, u1.active, u2_1.name, u2_1.type, u1.parent_id, u1.address, u1.card_type, u1.card_id, u1.telephone, u1.email, u1.station, u1.post_code, u1.country, u1.city, u1.login, u1.login_method, u2_1.created_at, u2_1.remarks, u2_1.iso_code, u2_1.user_insert_id, sec.id, sec.user_id, sec.security_number, sec.security_valid_until, sec.station
  • Join Filter: (u1.id = sec.user_id)
27. 0.065 2.654 ↓ 0.0 0 1

Hash Join (cost=286.60..567.31 rows=1 width=132) (actual time=2.654..2.654 rows=0 loops=1)

  • Output: u1.id, u1.active, u1.parent_id, u1.address, u1.card_type, u1.card_id, u1.telephone, u1.email, u1.station, u1.post_code, u1.country, u1.city, u1.login, u1.login_method, u2_1.name, u2_1.type, u2_1.created_at, u2_1.remarks, u2_1.iso_code, u2_1.user_insert_id
  • Inner Unique: true
  • Hash Cond: (u1.parent_id = u2_1.id)
28. 1.178 1.178 ↑ 1.1 506 1

Seq Scan on public.users u1 (cost=0.00..279.19 rows=581 width=85) (actual time=0.005..1.178 rows=506 loops=1)

  • Output: u1.id, u1.created_at, u1.user_insert_id, u1.remarks, u1.active, u1.name, u1.surname, u1.login, u1.password, u1.password_change_date, u1.ini_date, u1.end_date, u1.type, u1.parent_id, u1.card_id, u1.card_type, u1.address, u1.telephone, u1.email, u1.station, u1.post_code, u1.code, u1.login_method, u1.station_id, u1.concept_id, u1.roles, u1.last_login, u1.city, u1.country, u1.iso_code, u1.province, u1.change_password, u1.function_id, u1.department_id, u1.seniority, u1.next_of_kin_name, u1.next_of_kin_phone, u1.status_mask
  • Filter: ((u1.parent_id IS NULL) AND ((u1.type)::text = 'AGENT'::text))
  • Rows Removed by Filter: 7,522
29. 0.193 1.411 ↑ 1.0 582 1

Hash (cost=279.19..279.19 rows=593 width=51) (actual time=1.411..1.411 rows=582 loops=1)

  • Output: u2_1.name, u2_1.type, u2_1.created_at, u2_1.remarks, u2_1.iso_code, u2_1.user_insert_id, u2_1.id
  • Buckets: 1,024 Batches: 1 Memory Usage: 55kB
30. 1.218 1.218 ↑ 1.0 582 1

Seq Scan on public.users u2_1 (cost=0.00..279.19 rows=593 width=51) (actual time=0.006..1.218 rows=582 loops=1)

  • Output: u2_1.name, u2_1.type, u2_1.created_at, u2_1.remarks, u2_1.iso_code, u2_1.user_insert_id, u2_1.id
  • Filter: ((u2_1.type)::text = 'AGENT'::text)
  • Rows Removed by Filter: 7,446
31. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.agents_security sec (cost=0.00..1.59 rows=59 width=27) (never executed)

  • Output: sec.id, sec.user_id, sec.security_number, sec.security_valid_until, sec.station
32. 0.109 3.121 ↓ 297.0 594 1

Hash (cost=355.58..355.58 rows=2 width=4) (actual time=3.121..3.121 rows=594 loops=1)

  • Output: rel_u.user_id1
  • Buckets: 1,024 Batches: 1 Memory Usage: 29kB
33. 0.137 3.012 ↓ 297.0 594 1

Hash Join (cost=302.89..355.58 rows=2 width=4) (actual time=2.526..3.012 rows=594 loops=1)

  • Output: rel_u.user_id1
  • Hash Cond: (rel_u.user_id2 = u2.id)
34. 0.038 0.383 ↑ 1.2 600 1

Append (cost=0.00..49.91 rows=735 width=8) (actual time=0.018..0.383 rows=600 loops=1)

35. 0.345 0.345 ↑ 1.2 600 1

Seq Scan on public.rel_users rel_u (cost=0.00..46.24 rows=735 width=8) (actual time=0.018..0.345 rows=600 loops=1)

  • Output: rel_u.user_id1, rel_u.user_id2
  • Filter: (((rel_u.type)::text = 'CUSTOMER'::text) AND (rel_u.active = 1))
  • Rows Removed by Filter: 1,151
36. 0.105 2.492 ↓ 16.9 457 1

Hash (cost=302.55..302.55 rows=27 width=8) (actual time=2.492..2.492 rows=457 loops=1)

  • Output: u2.id, b.user_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 26kB
37. 0.137 2.387 ↓ 16.9 457 1

Hash Join (cost=21.30..302.55 rows=27 width=8) (actual time=0.242..2.387 rows=457 loops=1)

  • Output: u2.id, b.user_id
  • Hash Cond: (u2.id = b.user_id)
38. 2.039 2.039 ↑ 1.0 469 1

Seq Scan on public.users u2 (cost=0.00..279.19 rows=477 width=4) (actual time=0.008..2.039 rows=469 loops=1)

  • Output: u2.id, u2.created_at, u2.user_insert_id, u2.remarks, u2.active, u2.name, u2.surname, u2.login, u2.password, u2.password_change_date, u2.ini_date, u2.end_date, u2.type, u2.parent_id, u2.card_id, u2.card_type, u2.address, u2.telephone, u2.email, u2.station, u2.post_code, u2.code, u2.login_method, u2.station_id, u2.concept_id, u2.roles, u2.last_login, u2.city, u2.country, u2.iso_code, u2.province, u2.change_password, u2.function_id, u2.department_id, u2.seniority, u2.next_of_kin_name, u2.next_of_kin_phone, u2.status_mask
  • Filter: ((u2.type)::text = 'CUSTOMER'::text)
  • Rows Removed by Filter: 7,559
39. 0.087 0.211 ↓ 1.0 466 1

Hash (cost=15.58..15.58 rows=458 width=4) (actual time=0.211..0.211 rows=466 loops=1)

  • Output: b.user_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 25kB
40. 0.124 0.124 ↓ 1.0 466 1

Seq Scan on public.users_billings b (cost=0.00..15.58 rows=458 width=4) (actual time=0.011..0.124 rows=466 loops=1)

  • Output: b.user_id
41. 0.001 4.086 ↓ 5.0 5 1

Subquery Scan on *SELECT* 2 (cost=679.65..783.89 rows=1 width=4) (actual time=3.728..4.086 rows=5 loops=1)

  • Output: "*SELECT* 2".id
42. 0.013 4.085 ↓ 5.0 5 1

Nested Loop (cost=679.65..783.88 rows=1 width=20,836) (actual time=3.727..4.085 rows=5 loops=1)

  • Output: u.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::integer, NULL::integer, NULL::character varying, NULL::timestamp without time zone, NULL::character varying, NULL::integer, NULL::integer, NULL::character varying(255), NULL::integer, NULL::timestamp with time zone, NULL::integer, NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::timestamp without time zone, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer
  • Inner Unique: true
43. 0.028 4.047 ↑ 7.0 5 1

Hash Join (cost=679.37..732.91 rows=35 width=12) (actual time=3.700..4.047 rows=5 loops=1)

  • Output: u.id, rel_u_1.user_id2, b_1.user_id
  • Hash Cond: (rel_u_1.user_id2 = b_1.user_id)
44. 0.093 3.858 ↑ 7.6 5 1

Hash Join (cost=658.06..711.11 rows=38 width=8) (actual time=3.512..3.858 rows=5 loops=1)

  • Output: u.id, rel_u_1.user_id2
  • Hash Cond: (rel_u_1.user_id1 = u.id)
45. 0.037 0.311 ↑ 1.2 600 1

Append (cost=0.00..49.91 rows=735 width=8) (actual time=0.007..0.311 rows=600 loops=1)

46. 0.274 0.274 ↑ 1.2 600 1

Seq Scan on public.rel_users rel_u_1 (cost=0.00..46.24 rows=735 width=8) (actual time=0.006..0.274 rows=600 loops=1)

  • Output: rel_u_1.user_id1, rel_u_1.user_id2
  • Filter: (((rel_u_1.type)::text = 'CUSTOMER'::text) AND (rel_u_1.active = 1))
  • Rows Removed by Filter: 1,151
47. 0.017 3.454 ↓ 5.8 75 1

Hash (cost=657.90..657.90 rows=13 width=4) (actual time=3.454..3.454 rows=75 loops=1)

  • Output: u.id
  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
48. 0.009 3.437 ↓ 5.8 75 1

Subquery Scan on u (cost=657.74..657.90 rows=13 width=4) (actual time=3.425..3.437 rows=75 loops=1)

  • Output: u.id
49. 0.061 3.428 ↓ 5.8 75 1

Sort (cost=657.74..657.77 rows=13 width=7,340) (actual time=3.424..3.428 rows=75 loops=1)

  • Output: users_1.id, users_1.active, users_1.name, users_1.type, users_1.parent_id, users_1.address, users_1.card_type, users_1.card_id, users_1.telephone, users_1.email, users_1.station, users_1.post_code, users_1.country, users_1.city, users_1.login, users_1.login_method, users_1.created_at, users_1.remarks, users_1.iso_code, users_1.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
  • Sort Key: users_1.parent_id DESC
  • Sort Method: quicksort Memory: 38kB
50. 0.176 3.367 ↓ 5.8 75 1

HashAggregate (cost=657.37..657.50 rows=13 width=7,340) (actual time=3.327..3.367 rows=75 loops=1)

  • Output: users_1.id, users_1.active, users_1.name, users_1.type, users_1.parent_id, users_1.address, users_1.card_type, users_1.card_id, users_1.telephone, users_1.email, users_1.station, users_1.post_code, users_1.country, users_1.city, users_1.login, users_1.login_method, users_1.created_at, users_1.remarks, users_1.iso_code, users_1.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
  • Group Key: users_1.id, users_1.active, users_1.name, users_1.type, users_1.parent_id, users_1.address, users_1.card_type, users_1.card_id, users_1.telephone, users_1.email, users_1.station, users_1.post_code, users_1.country, users_1.city, users_1.login, users_1.login_method, users_1.created_at, users_1.remarks, users_1.iso_code, users_1.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
51. 0.009 3.191 ↓ 5.8 75 1

Append (cost=0.00..656.55 rows=13 width=7,340) (actual time=1.092..3.191 rows=75 loops=1)

52. 1.027 1.027 ↓ 0.0 0 1

Seq Scan on public.users users_1 (cost=0.00..279.19 rows=12 width=212) (actual time=1.027..1.027 rows=0 loops=1)

  • Output: users_1.id, users_1.active, users_1.name, users_1.type, users_1.parent_id, users_1.address, users_1.card_type, users_1.card_id, users_1.telephone, users_1.email, users_1.station, users_1.post_code, users_1.country, users_1.city, users_1.login, users_1.login_method, users_1.created_at, users_1.remarks, users_1.iso_code, users_1.user_insert_id, NULL::integer, NULL::integer, NULL::character varying, NULL::timestamp without time zone, NULL::character varying
  • Filter: ((users_1.parent_id IS NULL) AND (users_1.parent_id IS NOT NULL) AND ((users_1.type)::text = 'AGENT'::text))
  • Rows Removed by Filter: 8,028
53. 0.418 2.155 ↓ 75.0 75 1

Nested Loop Left Join (cost=0.28..377.17 rows=1 width=159) (actual time=0.064..2.155 rows=75 loops=1)

  • Output: u1_1.id, u1_1.active, u2_3.name, u2_3.type, u1_1.parent_id, u1_1.address, u1_1.card_type, u1_1.card_id, u1_1.telephone, u1_1.email, u1_1.station, u1_1.post_code, u1_1.country, u1_1.city, u1_1.login, u1_1.login_method, u2_3.created_at, u2_3.remarks, u2_3.iso_code, u2_3.user_insert_id, sec_1.id, sec_1.user_id, sec_1.security_number, sec_1.security_valid_until, sec_1.station
  • Join Filter: (u1_1.id = sec_1.user_id)
  • Rows Removed by Join Filter: 4,994
54. 0.029 1.293 ↓ 74.0 74 1

Nested Loop (cost=0.28..374.84 rows=1 width=132) (actual time=0.036..1.293 rows=74 loops=1)

  • Output: u1_1.id, u1_1.active, u1_1.parent_id, u1_1.address, u1_1.card_type, u1_1.card_id, u1_1.telephone, u1_1.email, u1_1.station, u1_1.post_code, u1_1.country, u1_1.city, u1_1.login, u1_1.login_method, u2_3.name, u2_3.type, u2_3.created_at, u2_3.remarks, u2_3.iso_code, u2_3.user_insert_id
  • Inner Unique: true
55. 1.036 1.036 ↓ 6.3 76 1

Seq Scan on public.users u1_1 (cost=0.00..279.19 rows=12 width=85) (actual time=0.005..1.036 rows=76 loops=1)

  • Output: u1_1.id, u1_1.created_at, u1_1.user_insert_id, u1_1.remarks, u1_1.active, u1_1.name, u1_1.surname, u1_1.login, u1_1.password, u1_1.password_change_date, u1_1.ini_date, u1_1.end_date, u1_1.type, u1_1.parent_id, u1_1.card_id, u1_1.card_type, u1_1.address, u1_1.telephone, u1_1.email, u1_1.station, u1_1.post_code, u1_1.code, u1_1.login_method, u1_1.station_id, u1_1.concept_id, u1_1.roles, u1_1.last_login, u1_1.city, u1_1.country, u1_1.iso_code, u1_1.province, u1_1.change_password, u1_1.function_id, u1_1.department_id, u1_1.seniority, u1_1.next_of_kin_name, u1_1.next_of_kin_phone, u1_1.status_mask
  • Filter: ((u1_1.parent_id IS NOT NULL) AND ((u1_1.type)::text = 'AGENT'::text))
  • Rows Removed by Filter: 7,952
56. 0.228 0.228 ↑ 1.0 1 76

Index Scan using users_pkey on public.users u2_3 (cost=0.28..7.97 rows=1 width=51) (actual time=0.003..0.003 rows=1 loops=76)

  • Output: u2_3.id, u2_3.created_at, u2_3.user_insert_id, u2_3.remarks, u2_3.active, u2_3.name, u2_3.surname, u2_3.login, u2_3.password, u2_3.password_change_date, u2_3.ini_date, u2_3.end_date, u2_3.type, u2_3.parent_id, u2_3.card_id, u2_3.card_type, u2_3.address, u2_3.telephone, u2_3.email, u2_3.station, u2_3.post_code, u2_3.code, u2_3.login_method, u2_3.station_id, u2_3.concept_id, u2_3.roles, u2_3.last_login, u2_3.city, u2_3.country, u2_3.iso_code, u2_3.province, u2_3.change_password, u2_3.function_id, u2_3.department_id, u2_3.seniority, u2_3.next_of_kin_name, u2_3.next_of_kin_phone, u2_3.status_mask
  • Index Cond: (u2_3.id = u1_1.parent_id)
  • Filter: ((u2_3.type)::text = 'AGENT'::text)
57. 0.444 0.444 ↓ 1.2 68 74

Seq Scan on public.agents_security sec_1 (cost=0.00..1.59 rows=59 width=27) (actual time=0.002..0.006 rows=68 loops=74)

  • Output: sec_1.id, sec_1.user_id, sec_1.security_number, sec_1.security_valid_until, sec_1.station
58. 0.074 0.161 ↓ 1.0 466 1

Hash (cost=15.58..15.58 rows=458 width=4) (actual time=0.161..0.161 rows=466 loops=1)

  • Output: b_1.user_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 25kB
59. 0.087 0.087 ↓ 1.0 466 1

Seq Scan on public.users_billings b_1 (cost=0.00..15.58 rows=458 width=4) (actual time=0.015..0.087 rows=466 loops=1)

  • Output: b_1.user_id
60. 0.025 0.025 ↑ 1.0 1 5

Index Scan using users_pkey on public.users u2_2 (cost=0.28..1.46 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=5)

  • Output: u2_2.id, u2_2.created_at, u2_2.user_insert_id, u2_2.remarks, u2_2.active, u2_2.name, u2_2.surname, u2_2.login, u2_2.password, u2_2.password_change_date, u2_2.ini_date, u2_2.end_date, u2_2.type, u2_2.parent_id, u2_2.card_id, u2_2.card_type, u2_2.address, u2_2.telephone, u2_2.email, u2_2.station, u2_2.post_code, u2_2.code, u2_2.login_method, u2_2.station_id, u2_2.concept_id, u2_2.roles, u2_2.last_login, u2_2.city, u2_2.country, u2_2.iso_code, u2_2.province, u2_2.change_password, u2_2.function_id, u2_2.department_id, u2_2.seniority, u2_2.next_of_kin_name, u2_2.next_of_kin_phone, u2_2.status_mask
  • Index Cond: (u2_2.id = rel_u_1.user_id2)
  • Filter: ((u2_2.type)::text = 'CUSTOMER'::text)
61. 0.011 9.485 ↓ 63.0 63 1

Subquery Scan on *SELECT* 3 (cost=707.36..807.46 rows=1 width=4) (actual time=4.058..9.485 rows=63 loops=1)

  • Output: "*SELECT* 3".id
62. 2.370 9.474 ↓ 63.0 63 1

Nested Loop (cost=707.36..807.45 rows=1 width=20,836) (actual time=4.057..9.474 rows=63 loops=1)

  • Output: u_1.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::integer, NULL::integer, NULL::character varying, NULL::timestamp without time zone, NULL::character varying, NULL::integer, NULL::integer, NULL::character varying(255), NULL::integer, NULL::timestamp with time zone, NULL::integer, NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::timestamp without time zone, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer
  • Join Filter: (u2_4.id = b_2.user_id)
  • Rows Removed by Join Filter: 29,295
63. 0.005 4.584 ↓ 63.0 63 1

Nested Loop (cost=707.36..786.15 rows=1 width=12) (actual time=4.039..4.584 rows=63 loops=1)

  • Output: u_1.id, rel_u_2.user_id2, u2_4.id
  • Inner Unique: true
64. 0.094 4.390 ↓ 3.5 63 1

Hash Join (cost=707.08..759.93 rows=18 width=8) (actual time=4.023..4.390 rows=63 loops=1)

  • Output: u_1.id, rel_u_2.user_id2
  • Hash Cond: (rel_u_2.user_id1 = u_1.parent_id)
65. 0.038 0.312 ↑ 1.2 600 1

Append (cost=0.00..49.91 rows=735 width=8) (actual time=0.006..0.312 rows=600 loops=1)

66. 0.274 0.274 ↑ 1.2 600 1

Seq Scan on public.rel_users rel_u_2 (cost=0.00..46.24 rows=735 width=8) (actual time=0.006..0.274 rows=600 loops=1)

  • Output: rel_u_2.user_id1, rel_u_2.user_id2
  • Filter: (((rel_u_2.type)::text = 'CUSTOMER'::text) AND (rel_u_2.active = 1))
  • Rows Removed by Filter: 1,151
67. 0.021 3.984 ↓ 11.3 68 1

Hash (cost=707.00..707.00 rows=6 width=8) (actual time=3.984..3.984 rows=68 loops=1)

  • Output: u_1.id, u_1.parent_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
68. 0.275 3.963 ↓ 11.3 68 1

Subquery Scan on u_1 (cost=706.81..707.00 rows=6 width=8) (actual time=3.937..3.963 rows=68 loops=1)

  • Output: u_1.id, u_1.parent_id
  • Filter: (NOT (hashed SubPlan 3))
  • Rows Removed by Filter: 7
69. 0.072 3.347 ↓ 5.8 75 1

Sort (cost=657.74..657.77 rows=13 width=7,340) (actual time=3.341..3.347 rows=75 loops=1)

  • Output: users_2.id, users_2.active, users_2.name, users_2.type, users_2.parent_id, users_2.address, users_2.card_type, users_2.card_id, users_2.telephone, users_2.email, users_2.station, users_2.post_code, users_2.country, users_2.city, users_2.login, users_2.login_method, users_2.created_at, users_2.remarks, users_2.iso_code, users_2.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
  • Sort Key: users_2.parent_id DESC
  • Sort Method: quicksort Memory: 38kB
70. 0.175 3.275 ↓ 5.8 75 1

HashAggregate (cost=657.37..657.50 rows=13 width=7,340) (actual time=3.236..3.275 rows=75 loops=1)

  • Output: users_2.id, users_2.active, users_2.name, users_2.type, users_2.parent_id, users_2.address, users_2.card_type, users_2.card_id, users_2.telephone, users_2.email, users_2.station, users_2.post_code, users_2.country, users_2.city, users_2.login, users_2.login_method, users_2.created_at, users_2.remarks, users_2.iso_code, users_2.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
  • Group Key: users_2.id, users_2.active, users_2.name, users_2.type, users_2.parent_id, users_2.address, users_2.card_type, users_2.card_id, users_2.telephone, users_2.email, users_2.station, users_2.post_code, users_2.country, users_2.city, users_2.login, users_2.login_method, users_2.created_at, users_2.remarks, users_2.iso_code, users_2.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
71. 0.009 3.100 ↓ 5.8 75 1

Append (cost=0.00..656.55 rows=13 width=7,340) (actual time=1.061..3.100 rows=75 loops=1)

72. 1.020 1.020 ↓ 0.0 0 1

Seq Scan on public.users users_2 (cost=0.00..279.19 rows=12 width=212) (actual time=1.020..1.020 rows=0 loops=1)

  • Output: users_2.id, users_2.active, users_2.name, users_2.type, users_2.parent_id, users_2.address, users_2.card_type, users_2.card_id, users_2.telephone, users_2.email, users_2.station, users_2.post_code, users_2.country, users_2.city, users_2.login, users_2.login_method, users_2.created_at, users_2.remarks, users_2.iso_code, users_2.user_insert_id, NULL::integer, NULL::integer, NULL::character varying, NULL::timestamp without time zone, NULL::character varying
  • Filter: ((users_2.parent_id IS NULL) AND (users_2.parent_id IS NOT NULL) AND ((users_2.type)::text = 'AGENT'::text))
  • Rows Removed by Filter: 8,028
73. 0.469 2.071 ↓ 75.0 75 1

Nested Loop Left Join (cost=0.28..377.17 rows=1 width=159) (actual time=0.039..2.071 rows=75 loops=1)

  • Output: u1_2.id, u1_2.active, u2_5.name, u2_5.type, u1_2.parent_id, u1_2.address, u1_2.card_type, u1_2.card_id, u1_2.telephone, u1_2.email, u1_2.station, u1_2.post_code, u1_2.country, u1_2.city, u1_2.login, u1_2.login_method, u2_5.created_at, u2_5.remarks, u2_5.iso_code, u2_5.user_insert_id, sec_2.id, sec_2.user_id, sec_2.security_number, sec_2.security_valid_until, sec_2.station
  • Join Filter: (u1_2.id = sec_2.user_id)
  • Rows Removed by Join Filter: 4,994
74. 0.049 1.232 ↓ 74.0 74 1

Nested Loop (cost=0.28..374.84 rows=1 width=132) (actual time=0.025..1.232 rows=74 loops=1)

  • Output: u1_2.id, u1_2.active, u1_2.parent_id, u1_2.address, u1_2.card_type, u1_2.card_id, u1_2.telephone, u1_2.email, u1_2.station, u1_2.post_code, u1_2.country, u1_2.city, u1_2.login, u1_2.login_method, u2_5.name, u2_5.type, u2_5.created_at, u2_5.remarks, u2_5.iso_code, u2_5.user_insert_id
  • Inner Unique: true
75. 1.031 1.031 ↓ 6.3 76 1

Seq Scan on public.users u1_2 (cost=0.00..279.19 rows=12 width=85) (actual time=0.006..1.031 rows=76 loops=1)

  • Output: u1_2.id, u1_2.created_at, u1_2.user_insert_id, u1_2.remarks, u1_2.active, u1_2.name, u1_2.surname, u1_2.login, u1_2.password, u1_2.password_change_date, u1_2.ini_date, u1_2.end_date, u1_2.type, u1_2.parent_id, u1_2.card_id, u1_2.card_type, u1_2.address, u1_2.telephone, u1_2.email, u1_2.station, u1_2.post_code, u1_2.code, u1_2.login_method, u1_2.station_id, u1_2.concept_id, u1_2.roles, u1_2.last_login, u1_2.city, u1_2.country, u1_2.iso_code, u1_2.province, u1_2.change_password, u1_2.function_id, u1_2.department_id, u1_2.seniority, u1_2.next_of_kin_name, u1_2.next_of_kin_phone, u1_2.status_mask
  • Filter: ((u1_2.parent_id IS NOT NULL) AND ((u1_2.type)::text = 'AGENT'::text))
  • Rows Removed by Filter: 7,952
76. 0.152 0.152 ↑ 1.0 1 76

Index Scan using users_pkey on public.users u2_5 (cost=0.28..7.97 rows=1 width=51) (actual time=0.002..0.002 rows=1 loops=76)

  • Output: u2_5.id, u2_5.created_at, u2_5.user_insert_id, u2_5.remarks, u2_5.active, u2_5.name, u2_5.surname, u2_5.login, u2_5.password, u2_5.password_change_date, u2_5.ini_date, u2_5.end_date, u2_5.type, u2_5.parent_id, u2_5.card_id, u2_5.card_type, u2_5.address, u2_5.telephone, u2_5.email, u2_5.station, u2_5.post_code, u2_5.code, u2_5.login_method, u2_5.station_id, u2_5.concept_id, u2_5.roles, u2_5.last_login, u2_5.city, u2_5.country, u2_5.iso_code, u2_5.province, u2_5.change_password, u2_5.function_id, u2_5.department_id, u2_5.seniority, u2_5.next_of_kin_name, u2_5.next_of_kin_phone, u2_5.status_mask
  • Index Cond: (u2_5.id = u1_2.parent_id)
  • Filter: ((u2_5.type)::text = 'AGENT'::text)
77. 0.370 0.370 ↓ 1.2 68 74

Seq Scan on public.agents_security sec_2 (cost=0.00..1.59 rows=59 width=27) (actual time=0.002..0.005 rows=68 loops=74)

  • Output: sec_2.id, sec_2.user_id, sec_2.security_number, sec_2.security_valid_until, sec_2.station
78.          

SubPlan (for Subquery Scan)

79. 0.062 0.341 ↑ 1.1 923 1

Append (cost=0.00..46.62 rows=983 width=4) (actual time=0.008..0.341 rows=923 loops=1)

80. 0.279 0.279 ↑ 1.1 923 1

Seq Scan on public.rel_users rel_users_2 (cost=0.00..41.70 rows=983 width=4) (actual time=0.008..0.279 rows=923 loops=1)

  • Output: rel_users_2.user_id1
  • Filter: ((rel_users_2.type)::text = 'CUSTOMER'::text)
  • Rows Removed by Filter: 828
81. 0.189 0.189 ↑ 1.0 1 63

Index Scan using users_pkey on public.users u2_4 (cost=0.28..1.46 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=63)

  • Output: u2_4.id, u2_4.created_at, u2_4.user_insert_id, u2_4.remarks, u2_4.active, u2_4.name, u2_4.surname, u2_4.login, u2_4.password, u2_4.password_change_date, u2_4.ini_date, u2_4.end_date, u2_4.type, u2_4.parent_id, u2_4.card_id, u2_4.card_type, u2_4.address, u2_4.telephone, u2_4.email, u2_4.station, u2_4.post_code, u2_4.code, u2_4.login_method, u2_4.station_id, u2_4.concept_id, u2_4.roles, u2_4.last_login, u2_4.city, u2_4.country, u2_4.iso_code, u2_4.province, u2_4.change_password, u2_4.function_id, u2_4.department_id, u2_4.seniority, u2_4.next_of_kin_name, u2_4.next_of_kin_phone, u2_4.status_mask
  • Index Cond: (u2_4.id = rel_u_2.user_id2)
  • Filter: ((u2_4.type)::text = 'CUSTOMER'::text)
82. 2.520 2.520 ↓ 1.0 466 63

Seq Scan on public.users_billings b_2 (cost=0.00..15.58 rows=458 width=4) (actual time=0.001..0.040 rows=466 loops=63)

  • Output: b_2.id, b_2.user_id, b_2.credit_client, b_2.bank_account_number, b_2.cass_number, b_2.inherit, b_2.valid_until, b_2.vat, b_2.bank_sort_code, b_2.bank_name, b_2.currency_code, b_2.shed_currency, b_2.invoice_channel, b_2.legal_statement, b_2.customer_reference, b_2.payment_conditions, b_2.client_address, b_2.status_mask, b_2.address, b_2.post_code, b_2.city, b_2.country, b_2.iso_code, b_2.account_number, b_2.invoice_frequency, b_2.invoice_language, b_2.invoice_mode
83. 0.171 0.397 ↓ 1.1 1,019 1

Hash (cost=22.23..22.23 rows=960 width=8) (actual time=0.397..0.397 rows=1,019 loops=1)

  • Output: rel.group_id, rel.element_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 48kB
84. 0.226 0.226 ↓ 1.1 1,019 1

Seq Scan on public.rel_groups rel (cost=0.00..22.23 rows=960 width=8) (actual time=0.011..0.226 rows=1,019 loops=1)

  • Output: rel.group_id, rel.element_id
  • Filter: (rel.active = 1)
  • Rows Removed by Filter: 16
85. 2.076 23.182 ↓ 77.4 542 67

Materialize (cost=4,900.40..6,501.21 rows=7 width=1,036) (actual time=0.106..0.346 rows=542 loops=67)

  • Output: "*SELECT* 1_1".name, "*SELECT* 1_1".station, "*SELECT* 1_1".id
86. 0.039 21.106 ↓ 77.4 542 1

Append (cost=4,900.40..6,501.17 rows=7 width=1,036) (actual time=7.097..21.106 rows=542 loops=1)

87. 0.045 7.426 ↓ 94.8 474 1

Subquery Scan on *SELECT* 1_1 (cost=4,900.40..4,909.78 rows=5 width=1,036) (actual time=7.096..7.426 rows=474 loops=1)

  • Output: "*SELECT* 1_1".name, "*SELECT* 1_1".station, "*SELECT* 1_1".id
88. 0.283 7.381 ↓ 94.8 474 1

Hash Join (cost=4,900.40..4,909.73 rows=5 width=20,836) (actual time=7.094..7.381 rows=474 loops=1)

  • Output: users_3.id, NULL::integer, users_3.name, NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), users_3.station, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::integer, NULL::integer, NULL::character varying, NULL::timestamp without time zone, NULL::character varying, NULL::integer, NULL::integer, NULL::character varying(255), NULL::integer, NULL::timestamp with time zone, NULL::integer, NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::timestamp without time zone, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer
  • Hash Cond: (users_3.id = rel_u_3.user_id1)
89. 0.193 4.969 ↑ 1.1 506 1

Sort (cost=4,544.80..4,546.22 rows=571 width=7,340) (actual time=4.942..4.969 rows=506 loops=1)

  • Output: users_3.id, users_3.active, users_3.name, users_3.type, users_3.parent_id, users_3.address, users_3.card_type, users_3.card_id, users_3.telephone, users_3.email, users_3.station, users_3.post_code, users_3.country, users_3.city, users_3.login, users_3.login_method, users_3.created_at, users_3.remarks, users_3.iso_code, users_3.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
  • Sort Key: users_3.parent_id DESC
  • Sort Method: quicksort Memory: 152kB
90. 0.260 4.776 ↑ 1.1 506 1

Unique (cost=2,682.54..2,719.65 rows=571 width=7,340) (actual time=4.489..4.776 rows=506 loops=1)

  • Output: users_3.id, users_3.active, users_3.name, users_3.type, users_3.parent_id, users_3.address, users_3.card_type, users_3.card_id, users_3.telephone, users_3.email, users_3.station, users_3.post_code, users_3.country, users_3.city, users_3.login, users_3.login_method, users_3.created_at, users_3.remarks, users_3.iso_code, users_3.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
91. 0.488 4.516 ↑ 1.1 506 1

Sort (cost=2,682.54..2,683.96 rows=571 width=7,340) (actual time=4.487..4.516 rows=506 loops=1)

  • Output: users_3.id, users_3.active, users_3.name, users_3.type, users_3.parent_id, users_3.address, users_3.card_type, users_3.card_id, users_3.telephone, users_3.email, users_3.station, users_3.post_code, users_3.country, users_3.city, users_3.login, users_3.login_method, users_3.created_at, users_3.remarks, users_3.iso_code, users_3.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
  • Sort Key: users_3.id, users_3.active, users_3.name, users_3.type, users_3.parent_id, users_3.address, users_3.card_type, users_3.card_id, users_3.telephone, users_3.email, users_3.station, users_3.post_code, users_3.country, users_3.city, users_3.login, users_3.login_method, users_3.created_at, users_3.remarks, users_3.iso_code, users_3.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
  • Sort Method: quicksort Memory: 152kB
92. 0.039 4.028 ↑ 1.1 506 1

Append (cost=0.00..857.39 rows=571 width=7,340) (actual time=0.011..4.028 rows=506 loops=1)

93. 1.321 1.321 ↑ 1.1 506 1

Seq Scan on public.users users_3 (cost=0.00..279.19 rows=570 width=212) (actual time=0.010..1.321 rows=506 loops=1)

  • Output: users_3.id, users_3.active, users_3.name, users_3.type, users_3.parent_id, users_3.address, users_3.card_type, users_3.card_id, users_3.telephone, users_3.email, users_3.station, users_3.post_code, users_3.country, users_3.city, users_3.login, users_3.login_method, users_3.created_at, users_3.remarks, users_3.iso_code, users_3.user_insert_id, NULL::integer, NULL::integer, NULL::character varying, NULL::timestamp without time zone, NULL::character varying
  • Filter: ((users_3.parent_id IS NULL) AND (users_3.parent_id IS NULL) AND ((users_3.type)::text = 'AGENT'::text))
  • Rows Removed by Filter: 7,522
94. 0.001 2.668 ↓ 0.0 0 1

Nested Loop Left Join (cost=286.60..569.64 rows=1 width=159) (actual time=2.668..2.668 rows=0 loops=1)

  • Output: u1_3.id, u1_3.active, u2_7.name, u2_7.type, u1_3.parent_id, u1_3.address, u1_3.card_type, u1_3.card_id, u1_3.telephone, u1_3.email, u1_3.station, u1_3.post_code, u1_3.country, u1_3.city, u1_3.login, u1_3.login_method, u2_7.created_at, u2_7.remarks, u2_7.iso_code, u2_7.user_insert_id, sec_3.id, sec_3.user_id, sec_3.security_number, sec_3.security_valid_until, sec_3.station
  • Join Filter: (u1_3.id = sec_3.user_id)
95. 0.067 2.667 ↓ 0.0 0 1

Hash Join (cost=286.60..567.31 rows=1 width=132) (actual time=2.667..2.667 rows=0 loops=1)

  • Output: u1_3.id, u1_3.active, u1_3.parent_id, u1_3.address, u1_3.card_type, u1_3.card_id, u1_3.telephone, u1_3.email, u1_3.station, u1_3.post_code, u1_3.country, u1_3.city, u1_3.login, u1_3.login_method, u2_7.name, u2_7.type, u2_7.created_at, u2_7.remarks, u2_7.iso_code, u2_7.user_insert_id
  • Inner Unique: true
  • Hash Cond: (u1_3.parent_id = u2_7.id)
96. 1.155 1.155 ↑ 1.1 506 1

Seq Scan on public.users u1_3 (cost=0.00..279.19 rows=581 width=85) (actual time=0.006..1.155 rows=506 loops=1)

  • Output: u1_3.id, u1_3.created_at, u1_3.user_insert_id, u1_3.remarks, u1_3.active, u1_3.name, u1_3.surname, u1_3.login, u1_3.password, u1_3.password_change_date, u1_3.ini_date, u1_3.end_date, u1_3.type, u1_3.parent_id, u1_3.card_id, u1_3.card_type, u1_3.address, u1_3.telephone, u1_3.email, u1_3.station, u1_3.post_code, u1_3.code, u1_3.login_method, u1_3.station_id, u1_3.concept_id, u1_3.roles, u1_3.last_login, u1_3.city, u1_3.country, u1_3.iso_code, u1_3.province, u1_3.change_password, u1_3.function_id, u1_3.department_id, u1_3.seniority, u1_3.next_of_kin_name, u1_3.next_of_kin_phone, u1_3.status_mask
  • Filter: ((u1_3.parent_id IS NULL) AND ((u1_3.type)::text = 'AGENT'::text))
  • Rows Removed by Filter: 7,522
97. 0.194 1.445 ↑ 1.0 582 1

Hash (cost=279.19..279.19 rows=593 width=51) (actual time=1.445..1.445 rows=582 loops=1)

  • Output: u2_7.name, u2_7.type, u2_7.created_at, u2_7.remarks, u2_7.iso_code, u2_7.user_insert_id, u2_7.id
  • Buckets: 1,024 Batches: 1 Memory Usage: 55kB
98. 1.251 1.251 ↑ 1.0 582 1

Seq Scan on public.users u2_7 (cost=0.00..279.19 rows=593 width=51) (actual time=0.007..1.251 rows=582 loops=1)

  • Output: u2_7.name, u2_7.type, u2_7.created_at, u2_7.remarks, u2_7.iso_code, u2_7.user_insert_id, u2_7.id
  • Filter: ((u2_7.type)::text = 'AGENT'::text)
  • Rows Removed by Filter: 7,446
99. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.agents_security sec_3 (cost=0.00..1.59 rows=59 width=27) (never executed)

  • Output: sec_3.id, sec_3.user_id, sec_3.security_number, sec_3.security_valid_until, sec_3.station
100. 0.110 2.129 ↓ 297.0 594 1

Hash (cost=355.58..355.58 rows=2 width=4) (actual time=2.128..2.129 rows=594 loops=1)

  • Output: rel_u_3.user_id1
  • Buckets: 1,024 Batches: 1 Memory Usage: 29kB
101. 0.153 2.019 ↓ 297.0 594 1

Hash Join (cost=302.89..355.58 rows=2 width=4) (actual time=1.583..2.019 rows=594 loops=1)

  • Output: rel_u_3.user_id1
  • Hash Cond: (rel_u_3.user_id2 = u2_6.id)
102. 0.040 0.331 ↑ 1.2 600 1

Append (cost=0.00..49.91 rows=735 width=8) (actual time=0.016..0.331 rows=600 loops=1)

103. 0.291 0.291 ↑ 1.2 600 1

Seq Scan on public.rel_users rel_u_3 (cost=0.00..46.24 rows=735 width=8) (actual time=0.016..0.291 rows=600 loops=1)

  • Output: rel_u_3.user_id1, rel_u_3.user_id2
  • Filter: (((rel_u_3.type)::text = 'CUSTOMER'::text) AND (rel_u_3.active = 1))
  • Rows Removed by Filter: 1,151
104. 0.092 1.535 ↓ 16.9 457 1

Hash (cost=302.55..302.55 rows=27 width=8) (actual time=1.535..1.535 rows=457 loops=1)

  • Output: u2_6.id, b_3.user_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 26kB
105. 0.134 1.443 ↓ 16.9 457 1

Hash Join (cost=21.30..302.55 rows=27 width=8) (actual time=0.207..1.443 rows=457 loops=1)

  • Output: u2_6.id, b_3.user_id
  • Hash Cond: (u2_6.id = b_3.user_id)
106. 1.153 1.153 ↑ 1.0 469 1

Seq Scan on public.users u2_6 (cost=0.00..279.19 rows=477 width=4) (actual time=0.019..1.153 rows=469 loops=1)

  • Output: u2_6.id, u2_6.created_at, u2_6.user_insert_id, u2_6.remarks, u2_6.active, u2_6.name, u2_6.surname, u2_6.login, u2_6.password, u2_6.password_change_date, u2_6.ini_date, u2_6.end_date, u2_6.type, u2_6.parent_id, u2_6.card_id, u2_6.card_type, u2_6.address, u2_6.telephone, u2_6.email, u2_6.station, u2_6.post_code, u2_6.code, u2_6.login_method, u2_6.station_id, u2_6.concept_id, u2_6.roles, u2_6.last_login, u2_6.city, u2_6.country, u2_6.iso_code, u2_6.province, u2_6.change_password, u2_6.function_id, u2_6.department_id, u2_6.seniority, u2_6.next_of_kin_name, u2_6.next_of_kin_phone, u2_6.status_mask
  • Filter: ((u2_6.type)::text = 'CUSTOMER'::text)
  • Rows Removed by Filter: 7,559
107. 0.085 0.156 ↓ 1.0 466 1

Hash (cost=15.58..15.58 rows=458 width=4) (actual time=0.155..0.156 rows=466 loops=1)

  • Output: b_3.user_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 25kB
108. 0.071 0.071 ↓ 1.0 466 1

Seq Scan on public.users_billings b_3 (cost=0.00..15.58 rows=458 width=4) (actual time=0.006..0.071 rows=466 loops=1)

  • Output: b_3.user_id
109. 0.002 4.051 ↓ 5.0 5 1

Subquery Scan on *SELECT* 2_1 (cost=679.65..783.89 rows=1 width=1,036) (actual time=3.691..4.051 rows=5 loops=1)

  • Output: "*SELECT* 2_1".name, "*SELECT* 2_1".station, "*SELECT* 2_1".id
110. 0.015 4.049 ↓ 5.0 5 1

Nested Loop (cost=679.65..783.88 rows=1 width=20,836) (actual time=3.689..4.049 rows=5 loops=1)

  • Output: u_2.id, NULL::integer, u_2.name, NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), u_2.station, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::integer, NULL::integer, NULL::character varying, NULL::timestamp without time zone, NULL::character varying, NULL::integer, NULL::integer, NULL::character varying(255), NULL::integer, NULL::timestamp with time zone, NULL::integer, NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::timestamp without time zone, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer
  • Inner Unique: true
111. 0.035 4.014 ↑ 7.0 5 1

Hash Join (cost=679.37..732.91 rows=35 width=1,044) (actual time=3.666..4.014 rows=5 loops=1)

  • Output: u_2.id, u_2.name, u_2.station, rel_u_4.user_id2, b_4.user_id
  • Hash Cond: (rel_u_4.user_id2 = b_4.user_id)
112. 0.077 3.813 ↑ 7.6 5 1

Hash Join (cost=658.06..711.11 rows=38 width=1,040) (actual time=3.466..3.813 rows=5 loops=1)

  • Output: u_2.id, u_2.name, u_2.station, rel_u_4.user_id2
  • Hash Cond: (rel_u_4.user_id1 = u_2.id)
113. 0.037 0.310 ↑ 1.2 600 1

Append (cost=0.00..49.91 rows=735 width=8) (actual time=0.007..0.310 rows=600 loops=1)

114. 0.273 0.273 ↑ 1.2 600 1

Seq Scan on public.rel_users rel_u_4 (cost=0.00..46.24 rows=735 width=8) (actual time=0.007..0.273 rows=600 loops=1)

  • Output: rel_u_4.user_id1, rel_u_4.user_id2
  • Filter: (((rel_u_4.type)::text = 'CUSTOMER'::text) AND (rel_u_4.active = 1))
  • Rows Removed by Filter: 1,151
115. 0.021 3.426 ↓ 5.8 75 1

Hash (cost=657.90..657.90 rows=13 width=1,036) (actual time=3.426..3.426 rows=75 loops=1)

  • Output: u_2.id, u_2.name, u_2.station
  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
116. 0.016 3.405 ↓ 5.8 75 1

Subquery Scan on u_2 (cost=657.74..657.90 rows=13 width=1,036) (actual time=3.387..3.405 rows=75 loops=1)

  • Output: u_2.id, u_2.name, u_2.station
117. 0.103 3.389 ↓ 5.8 75 1

Sort (cost=657.74..657.77 rows=13 width=7,340) (actual time=3.385..3.389 rows=75 loops=1)

  • Output: users_4.id, users_4.active, users_4.name, users_4.type, users_4.parent_id, users_4.address, users_4.card_type, users_4.card_id, users_4.telephone, users_4.email, users_4.station, users_4.post_code, users_4.country, users_4.city, users_4.login, users_4.login_method, users_4.created_at, users_4.remarks, users_4.iso_code, users_4.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
  • Sort Key: users_4.parent_id DESC
  • Sort Method: quicksort Memory: 38kB
118. 0.172 3.286 ↓ 5.8 75 1

HashAggregate (cost=657.37..657.50 rows=13 width=7,340) (actual time=3.244..3.286 rows=75 loops=1)

  • Output: users_4.id, users_4.active, users_4.name, users_4.type, users_4.parent_id, users_4.address, users_4.card_type, users_4.card_id, users_4.telephone, users_4.email, users_4.station, users_4.post_code, users_4.country, users_4.city, users_4.login, users_4.login_method, users_4.created_at, users_4.remarks, users_4.iso_code, users_4.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
  • Group Key: users_4.id, users_4.active, users_4.name, users_4.type, users_4.parent_id, users_4.address, users_4.card_type, users_4.card_id, users_4.telephone, users_4.email, users_4.station, users_4.post_code, users_4.country, users_4.city, users_4.login, users_4.login_method, users_4.created_at, users_4.remarks, users_4.iso_code, users_4.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
119. 0.009 3.114 ↓ 5.8 75 1

Append (cost=0.00..656.55 rows=13 width=7,340) (actual time=1.099..3.114 rows=75 loops=1)

120. 1.043 1.043 ↓ 0.0 0 1

Seq Scan on public.users users_4 (cost=0.00..279.19 rows=12 width=212) (actual time=1.043..1.043 rows=0 loops=1)

  • Output: users_4.id, users_4.active, users_4.name, users_4.type, users_4.parent_id, users_4.address, users_4.card_type, users_4.card_id, users_4.telephone, users_4.email, users_4.station, users_4.post_code, users_4.country, users_4.city, users_4.login, users_4.login_method, users_4.created_at, users_4.remarks, users_4.iso_code, users_4.user_insert_id, NULL::integer, NULL::integer, NULL::character varying, NULL::timestamp without time zone, NULL::character varying
  • Filter: ((users_4.parent_id IS NULL) AND (users_4.parent_id IS NOT NULL) AND ((users_4.type)::text = 'AGENT'::text))
  • Rows Removed by Filter: 8,028
121. 0.464 2.062 ↓ 75.0 75 1

Nested Loop Left Join (cost=0.28..377.17 rows=1 width=159) (actual time=0.055..2.062 rows=75 loops=1)

  • Output: u1_4.id, u1_4.active, u2_9.name, u2_9.type, u1_4.parent_id, u1_4.address, u1_4.card_type, u1_4.card_id, u1_4.telephone, u1_4.email, u1_4.station, u1_4.post_code, u1_4.country, u1_4.city, u1_4.login, u1_4.login_method, u2_9.created_at, u2_9.remarks, u2_9.iso_code, u2_9.user_insert_id, sec_4.id, sec_4.user_id, sec_4.security_number, sec_4.security_valid_until, sec_4.station
  • Join Filter: (u1_4.id = sec_4.user_id)
  • Rows Removed by Join Filter: 4,994
122. 0.057 1.228 ↓ 74.0 74 1

Nested Loop (cost=0.28..374.84 rows=1 width=132) (actual time=0.041..1.228 rows=74 loops=1)

  • Output: u1_4.id, u1_4.active, u1_4.parent_id, u1_4.address, u1_4.card_type, u1_4.card_id, u1_4.telephone, u1_4.email, u1_4.station, u1_4.post_code, u1_4.country, u1_4.city, u1_4.login, u1_4.login_method, u2_9.name, u2_9.type, u2_9.created_at, u2_9.remarks, u2_9.iso_code, u2_9.user_insert_id
  • Inner Unique: true
123. 1.019 1.019 ↓ 6.3 76 1

Seq Scan on public.users u1_4 (cost=0.00..279.19 rows=12 width=85) (actual time=0.010..1.019 rows=76 loops=1)

  • Output: u1_4.id, u1_4.created_at, u1_4.user_insert_id, u1_4.remarks, u1_4.active, u1_4.name, u1_4.surname, u1_4.login, u1_4.password, u1_4.password_change_date, u1_4.ini_date, u1_4.end_date, u1_4.type, u1_4.parent_id, u1_4.card_id, u1_4.card_type, u1_4.address, u1_4.telephone, u1_4.email, u1_4.station, u1_4.post_code, u1_4.code, u1_4.login_method, u1_4.station_id, u1_4.concept_id, u1_4.roles, u1_4.last_login, u1_4.city, u1_4.country, u1_4.iso_code, u1_4.province, u1_4.change_password, u1_4.function_id, u1_4.department_id, u1_4.seniority, u1_4.next_of_kin_name, u1_4.next_of_kin_phone, u1_4.status_mask
  • Filter: ((u1_4.parent_id IS NOT NULL) AND ((u1_4.type)::text = 'AGENT'::text))
  • Rows Removed by Filter: 7,952
124. 0.152 0.152 ↑ 1.0 1 76

Index Scan using users_pkey on public.users u2_9 (cost=0.28..7.97 rows=1 width=51) (actual time=0.002..0.002 rows=1 loops=76)

  • Output: u2_9.id, u2_9.created_at, u2_9.user_insert_id, u2_9.remarks, u2_9.active, u2_9.name, u2_9.surname, u2_9.login, u2_9.password, u2_9.password_change_date, u2_9.ini_date, u2_9.end_date, u2_9.type, u2_9.parent_id, u2_9.card_id, u2_9.card_type, u2_9.address, u2_9.telephone, u2_9.email, u2_9.station, u2_9.post_code, u2_9.code, u2_9.login_method, u2_9.station_id, u2_9.concept_id, u2_9.roles, u2_9.last_login, u2_9.city, u2_9.country, u2_9.iso_code, u2_9.province, u2_9.change_password, u2_9.function_id, u2_9.department_id, u2_9.seniority, u2_9.next_of_kin_name, u2_9.next_of_kin_phone, u2_9.status_mask
  • Index Cond: (u2_9.id = u1_4.parent_id)
  • Filter: ((u2_9.type)::text = 'AGENT'::text)
125. 0.370 0.370 ↓ 1.2 68 74

Seq Scan on public.agents_security sec_4 (cost=0.00..1.59 rows=59 width=27) (actual time=0.001..0.005 rows=68 loops=74)

  • Output: sec_4.id, sec_4.user_id, sec_4.security_number, sec_4.security_valid_until, sec_4.station
126. 0.090 0.166 ↓ 1.0 466 1

Hash (cost=15.58..15.58 rows=458 width=4) (actual time=0.166..0.166 rows=466 loops=1)

  • Output: b_4.user_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 25kB
127. 0.076 0.076 ↓ 1.0 466 1

Seq Scan on public.users_billings b_4 (cost=0.00..15.58 rows=458 width=4) (actual time=0.008..0.076 rows=466 loops=1)

  • Output: b_4.user_id
128. 0.020 0.020 ↑ 1.0 1 5

Index Scan using users_pkey on public.users u2_8 (cost=0.28..1.46 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=5)

  • Output: u2_8.id, u2_8.created_at, u2_8.user_insert_id, u2_8.remarks, u2_8.active, u2_8.name, u2_8.surname, u2_8.login, u2_8.password, u2_8.password_change_date, u2_8.ini_date, u2_8.end_date, u2_8.type, u2_8.parent_id, u2_8.card_id, u2_8.card_type, u2_8.address, u2_8.telephone, u2_8.email, u2_8.station, u2_8.post_code, u2_8.code, u2_8.login_method, u2_8.station_id, u2_8.concept_id, u2_8.roles, u2_8.last_login, u2_8.city, u2_8.country, u2_8.iso_code, u2_8.province, u2_8.change_password, u2_8.function_id, u2_8.department_id, u2_8.seniority, u2_8.next_of_kin_name, u2_8.next_of_kin_phone, u2_8.status_mask
  • Index Cond: (u2_8.id = rel_u_4.user_id2)
  • Filter: ((u2_8.type)::text = 'CUSTOMER'::text)
129. 0.011 9.590 ↓ 63.0 63 1

Subquery Scan on *SELECT* 3_1 (cost=707.36..807.46 rows=1 width=1,036) (actual time=4.175..9.590 rows=63 loops=1)

  • Output: "*SELECT* 3_1".name, "*SELECT* 3_1".station, "*SELECT* 3_1".id
130. 2.329 9.579 ↓ 63.0 63 1

Nested Loop (cost=707.36..807.45 rows=1 width=20,836) (actual time=4.174..9.579 rows=63 loops=1)

  • Output: u_3.id, NULL::integer, u_3.name, NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), u_3.station, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::integer, NULL::integer, NULL::character varying, NULL::timestamp without time zone, NULL::character varying, NULL::integer, NULL::integer, NULL::character varying(255), NULL::integer, NULL::timestamp with time zone, NULL::integer, NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::timestamp without time zone, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer
  • Join Filter: (u2_10.id = b_5.user_id)
  • Rows Removed by Join Filter: 29,295
131. 0.032 4.667 ↓ 63.0 63 1

Nested Loop (cost=707.36..786.15 rows=1 width=1,044) (actual time=4.153..4.667 rows=63 loops=1)

  • Output: u_3.id, u_3.name, u_3.station, rel_u_5.user_id2, u2_10.id
  • Inner Unique: true
132. 0.099 4.509 ↓ 3.5 63 1

Hash Join (cost=707.08..759.93 rows=18 width=1,040) (actual time=4.136..4.509 rows=63 loops=1)

  • Output: u_3.id, u_3.name, u_3.station, rel_u_5.user_id2
  • Hash Cond: (rel_u_5.user_id1 = u_3.parent_id)
133. 0.038 0.314 ↑ 1.2 600 1

Append (cost=0.00..49.91 rows=735 width=8) (actual time=0.007..0.314 rows=600 loops=1)

134. 0.276 0.276 ↑ 1.2 600 1

Seq Scan on public.rel_users rel_u_5 (cost=0.00..46.24 rows=735 width=8) (actual time=0.006..0.276 rows=600 loops=1)

  • Output: rel_u_5.user_id1, rel_u_5.user_id2
  • Filter: (((rel_u_5.type)::text = 'CUSTOMER'::text) AND (rel_u_5.active = 1))
  • Rows Removed by Filter: 1,151
135. 0.030 4.096 ↓ 11.3 68 1

Hash (cost=707.00..707.00 rows=6 width=1,040) (actual time=4.096..4.096 rows=68 loops=1)

  • Output: u_3.id, u_3.name, u_3.station, u_3.parent_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
136. 0.287 4.066 ↓ 11.3 68 1

Subquery Scan on u_3 (cost=706.81..707.00 rows=6 width=1,040) (actual time=4.038..4.066 rows=68 loops=1)

  • Output: u_3.id, u_3.name, u_3.station, u_3.parent_id
  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 7
137. 0.079 3.421 ↓ 5.8 75 1

Sort (cost=657.74..657.77 rows=13 width=7,340) (actual time=3.416..3.421 rows=75 loops=1)

  • Output: users_5.id, users_5.active, users_5.name, users_5.type, users_5.parent_id, users_5.address, users_5.card_type, users_5.card_id, users_5.telephone, users_5.email, users_5.station, users_5.post_code, users_5.country, users_5.city, users_5.login, users_5.login_method, users_5.created_at, users_5.remarks, users_5.iso_code, users_5.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
  • Sort Key: users_5.parent_id DESC
  • Sort Method: quicksort Memory: 38kB
138. 0.165 3.342 ↓ 5.8 75 1

HashAggregate (cost=657.37..657.50 rows=13 width=7,340) (actual time=3.302..3.342 rows=75 loops=1)

  • Output: users_5.id, users_5.active, users_5.name, users_5.type, users_5.parent_id, users_5.address, users_5.card_type, users_5.card_id, users_5.telephone, users_5.email, users_5.station, users_5.post_code, users_5.country, users_5.city, users_5.login, users_5.login_method, users_5.created_at, users_5.remarks, users_5.iso_code, users_5.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
  • Group Key: users_5.id, users_5.active, users_5.name, users_5.type, users_5.parent_id, users_5.address, users_5.card_type, users_5.card_id, users_5.telephone, users_5.email, users_5.station, users_5.post_code, users_5.country, users_5.city, users_5.login, users_5.login_method, users_5.created_at, users_5.remarks, users_5.iso_code, users_5.user_insert_id, (NULL::integer), (NULL::integer), (NULL::character varying), (NULL::timestamp without time zone), (NULL::character varying)
139. 0.010 3.177 ↓ 5.8 75 1

Append (cost=0.00..656.55 rows=13 width=7,340) (actual time=1.112..3.177 rows=75 loops=1)

140. 1.070 1.070 ↓ 0.0 0 1

Seq Scan on public.users users_5 (cost=0.00..279.19 rows=12 width=212) (actual time=1.070..1.070 rows=0 loops=1)

  • Output: users_5.id, users_5.active, users_5.name, users_5.type, users_5.parent_id, users_5.address, users_5.card_type, users_5.card_id, users_5.telephone, users_5.email, users_5.station, users_5.post_code, users_5.country, users_5.city, users_5.login, users_5.login_method, users_5.created_at, users_5.remarks, users_5.iso_code, users_5.user_insert_id, NULL::integer, NULL::integer, NULL::character varying, NULL::timestamp without time zone, NULL::character varying
  • Filter: ((users_5.parent_id IS NULL) AND (users_5.parent_id IS NOT NULL) AND ((users_5.type)::text = 'AGENT'::text))
  • Rows Removed by Filter: 8,028
141. 0.448 2.097 ↓ 75.0 75 1

Nested Loop Left Join (cost=0.28..377.17 rows=1 width=159) (actual time=0.041..2.097 rows=75 loops=1)

  • Output: u1_5.id, u1_5.active, u2_11.name, u2_11.type, u1_5.parent_id, u1_5.address, u1_5.card_type, u1_5.card_id, u1_5.telephone, u1_5.email, u1_5.station, u1_5.post_code, u1_5.country, u1_5.city, u1_5.login, u1_5.login_method, u2_11.created_at, u2_11.remarks, u2_11.iso_code, u2_11.user_insert_id, sec_5.id, sec_5.user_id, sec_5.security_number, sec_5.security_valid_until, sec_5.station
  • Join Filter: (u1_5.id = sec_5.user_id)
  • Rows Removed by Join Filter: 4,994
142. 0.041 1.205 ↓ 74.0 74 1

Nested Loop (cost=0.28..374.84 rows=1 width=132) (actual time=0.024..1.205 rows=74 loops=1)

  • Output: u1_5.id, u1_5.active, u1_5.parent_id, u1_5.address, u1_5.card_type, u1_5.card_id, u1_5.telephone, u1_5.email, u1_5.station, u1_5.post_code, u1_5.country, u1_5.city, u1_5.login, u1_5.login_method, u2_11.name, u2_11.type, u2_11.created_at, u2_11.remarks, u2_11.iso_code, u2_11.user_insert_id
  • Inner Unique: true
143. 1.012 1.012 ↓ 6.3 76 1

Seq Scan on public.users u1_5 (cost=0.00..279.19 rows=12 width=85) (actual time=0.006..1.012 rows=76 loops=1)

  • Output: u1_5.id, u1_5.created_at, u1_5.user_insert_id, u1_5.remarks, u1_5.active, u1_5.name, u1_5.surname, u1_5.login, u1_5.password, u1_5.password_change_date, u1_5.ini_date, u1_5.end_date, u1_5.type, u1_5.parent_id, u1_5.card_id, u1_5.card_type, u1_5.address, u1_5.telephone, u1_5.email, u1_5.station, u1_5.post_code, u1_5.code, u1_5.login_method, u1_5.station_id, u1_5.concept_id, u1_5.roles, u1_5.last_login, u1_5.city, u1_5.country, u1_5.iso_code, u1_5.province, u1_5.change_password, u1_5.function_id, u1_5.department_id, u1_5.seniority, u1_5.next_of_kin_name, u1_5.next_of_kin_phone, u1_5.status_mask
  • Filter: ((u1_5.parent_id IS NOT NULL) AND ((u1_5.type)::text = 'AGENT'::text))
  • Rows Removed by Filter: 7,952
144. 0.152 0.152 ↑ 1.0 1 76

Index Scan using users_pkey on public.users u2_11 (cost=0.28..7.97 rows=1 width=51) (actual time=0.002..0.002 rows=1 loops=76)

  • Output: u2_11.id, u2_11.created_at, u2_11.user_insert_id, u2_11.remarks, u2_11.active, u2_11.name, u2_11.surname, u2_11.login, u2_11.password, u2_11.password_change_date, u2_11.ini_date, u2_11.end_date, u2_11.type, u2_11.parent_id, u2_11.card_id, u2_11.card_type, u2_11.address, u2_11.telephone, u2_11.email, u2_11.station, u2_11.post_code, u2_11.code, u2_11.login_method, u2_11.station_id, u2_11.concept_id, u2_11.roles, u2_11.last_login, u2_11.city, u2_11.country, u2_11.iso_code, u2_11.province, u2_11.change_password, u2_11.function_id, u2_11.department_id, u2_11.seniority, u2_11.next_of_kin_name, u2_11.next_of_kin_phone, u2_11.status_mask
  • Index Cond: (u2_11.id = u1_5.parent_id)
  • Filter: ((u2_11.type)::text = 'AGENT'::text)
145. 0.444 0.444 ↓ 1.2 68 74

Seq Scan on public.agents_security sec_5 (cost=0.00..1.59 rows=59 width=27) (actual time=0.001..0.006 rows=68 loops=74)

  • Output: sec_5.id, sec_5.user_id, sec_5.security_number, sec_5.security_valid_until, sec_5.station
146.          

SubPlan (for Subquery Scan)

147. 0.061 0.358 ↑ 1.1 923 1

Append (cost=0.00..46.62 rows=983 width=4) (actual time=0.008..0.358 rows=923 loops=1)

148. 0.297 0.297 ↑ 1.1 923 1

Seq Scan on public.rel_users (cost=0.00..41.70 rows=983 width=4) (actual time=0.008..0.297 rows=923 loops=1)

  • Output: rel_users.user_id1
  • Filter: ((rel_users.type)::text = 'CUSTOMER'::text)
  • Rows Removed by Filter: 828
149. 0.126 0.126 ↑ 1.0 1 63

Index Scan using users_pkey on public.users u2_10 (cost=0.28..1.46 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=63)

  • Output: u2_10.id, u2_10.created_at, u2_10.user_insert_id, u2_10.remarks, u2_10.active, u2_10.name, u2_10.surname, u2_10.login, u2_10.password, u2_10.password_change_date, u2_10.ini_date, u2_10.end_date, u2_10.type, u2_10.parent_id, u2_10.card_id, u2_10.card_type, u2_10.address, u2_10.telephone, u2_10.email, u2_10.station, u2_10.post_code, u2_10.code, u2_10.login_method, u2_10.station_id, u2_10.concept_id, u2_10.roles, u2_10.last_login, u2_10.city, u2_10.country, u2_10.iso_code, u2_10.province, u2_10.change_password, u2_10.function_id, u2_10.department_id, u2_10.seniority, u2_10.next_of_kin_name, u2_10.next_of_kin_phone, u2_10.status_mask
  • Index Cond: (u2_10.id = rel_u_5.user_id2)
  • Filter: ((u2_10.type)::text = 'CUSTOMER'::text)
150. 2.583 2.583 ↓ 1.0 466 63

Seq Scan on public.users_billings b_5 (cost=0.00..15.58 rows=458 width=4) (actual time=0.001..0.041 rows=466 loops=63)

  • Output: b_5.id, b_5.user_id, b_5.credit_client, b_5.bank_account_number, b_5.cass_number, b_5.inherit, b_5.valid_until, b_5.vat, b_5.bank_sort_code, b_5.bank_name, b_5.currency_code, b_5.shed_currency, b_5.invoice_channel, b_5.legal_statement, b_5.customer_reference, b_5.payment_conditions, b_5.client_address, b_5.status_mask, b_5.address, b_5.post_code, b_5.city, b_5.country, b_5.iso_code, b_5.account_number, b_5.invoice_frequency, b_5.invoice_language, b_5.invoice_mode
151. 0.267 0.737 ↓ 68.0 68 67

Materialize (cost=5.96..31.13 rows=1 width=8) (actual time=0.002..0.011 rows=68 loops=67)

  • Output: generic_types_2.id, imp.id
152. 0.046 0.470 ↓ 68.0 68 1

Nested Loop (cost=5.96..31.13 rows=1 width=8) (actual time=0.129..0.470 rows=68 loops=1)

  • Output: generic_types_2.id, imp.id
  • Inner Unique: true
153. 0.143 0.356 ↓ 22.7 68 1

Hash Join (cost=5.81..30.57 rows=3 width=8) (actual time=0.106..0.356 rows=68 loops=1)

  • Output: generic_types_2.id, rel_2.element_id
  • Inner Unique: true
  • Hash Cond: (rel_2.group_id = generic_types_2.id)
154. 0.156 0.156 ↓ 1.1 1,019 1

Seq Scan on public.rel_groups rel_2 (cost=0.00..22.23 rows=960 width=8) (actual time=0.009..0.156 rows=1,019 loops=1)

  • Output: rel_2.id, rel_2.created_at, rel_2.user_insert_id, rel_2.remarks, rel_2.active, rel_2.group_id, rel_2.element_id, rel_2.type, rel_2.status_mask
  • Filter: (rel_2.active = 1)
  • Rows Removed by Filter: 16
155. 0.014 0.057 ↓ 2.3 7 1

Hash (cost=5.78..5.78 rows=3 width=4) (actual time=0.057..0.057 rows=7 loops=1)

  • Output: generic_types_2.id
  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
156. 0.043 0.043 ↓ 2.3 7 1

Seq Scan on public.generic_types generic_types_2 (cost=0.00..5.78 rows=3 width=4) (actual time=0.019..0.043 rows=7 loops=1)

  • Output: generic_types_2.id
  • Filter: ((generic_types_2.type)::text = 'GROUP_IMP'::text)
  • Rows Removed by Filter: 257
157. 0.068 0.068 ↑ 1.0 1 68

Index Scan using generic_types_pkey on public.generic_types imp (cost=0.14..0.19 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=68)

  • Output: imp.id, imp.name, imp.code, imp.type, imp.parent_id, imp.priority, imp.remarks, imp.created_at, imp.active, imp.user_insert_id
  • Index Cond: (imp.id = rel_2.element_id)
  • Filter: ((imp.type)::text = 'IMP'::text)
158. 0.277 25.776 ↓ 37.0 37 179

Materialize (cost=1,523.83..2,670.81 rows=1 width=8) (actual time=0.071..0.144 rows=37 loops=179)

  • Output: generic_types_1.id, "*SELECT* 3_2".id
159. 0.251 25.499 ↓ 37.0 37 1

Nested Loop (cost=1,523.83..2,670.81 rows=1 width=8) (actual time=12.612..25.499 rows=37 loops=1)

  • Output: generic_types_1.id, "*SELECT* 3_2".id
  • Join Filter: (rel_1.element_id = "*SELECT* 3_2".id)
  • Rows Removed by Join Filter: 3,065
160. 0.141 0.366 ↓ 4.7 33 1

Hash Join (cost=5.85..30.61 rows=7 width=8) (actual time=0.068..0.366 rows=33 loops=1)

  • Output: generic_types_1.id, rel_1.element_id
  • Inner Unique: true
  • Hash Cond: (rel_1.group_id = generic_types_1.id)
161. 0.183 0.183 ↓ 1.1 1,019 1

Seq Scan on public.rel_groups rel_1 (cost=0.00..22.23 rows=960 width=8) (actual time=0.006..0.183 rows=1,019 loops=1)

  • Output: rel_1.id, rel_1.created_at, rel_1.user_insert_id, rel_1.remarks, rel_1.active, rel_1.group_id, rel_1.element_id, rel_1.type, rel_1.status_mask
  • Filter: (rel_1.active = 1)
  • Rows Removed by Filter: 16
162. 0.011 0.042 ↓ 1.2 7 1

Hash (cost=5.78..5.78 rows=6 width=4) (actual time=0.042..0.042 rows=7 loops=1)

  • Output: generic_types_1.id
  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
163. 0.031 0.031 ↓ 1.2 7 1

Seq Scan on public.generic_types generic_types_1 (cost=0.00..5.78 rows=6 width=4) (actual time=0.017..0.031 rows=7 loops=1)

  • Output: generic_types_1.id
  • Filter: ((generic_types_1.type)::text = 'GROUP_CARRIER'::text)
  • Rows Removed by Filter: 257
164. 0.000 24.882 ↓ 31.3 94 33

Materialize (cost=1,517.98..2,639.90 rows=3 width=4) (actual time=0.380..0.754 rows=94 loops=33)

  • Output: "*SELECT* 3_2".id
165. 21.360 25.155 ↓ 31.3 94 1

Gather (cost=1,517.98..2,639.88 rows=3 width=4) (actual time=12.524..25.155 rows=94 loops=1)

  • Output: "*SELECT* 3_2".id
  • Workers Planned: 2
  • Workers Launched: 2
166. 0.004 3.795 ↓ 10.3 31 3 / 3

Parallel Append (cost=517.98..1,639.58 rows=3 width=4) (actual time=2.034..3.795 rows=31 loops=3)

  • Worker 0: actual time=0.000..0.000 rows=0 loops=1
  • Worker 1: actual time=0.000..0.000 rows=0 loops=1
167. 0.000 0.769 ↓ 0.0 0 1 / 3

Subquery Scan on *SELECT* 3_2 (cost=616.13..658.01 rows=1 width=4) (actual time=2.308..2.308 rows=0 loops=1)

  • Output: "*SELECT* 3_2".id
168. 0.000 0.769 ↓ 0.0 0 1 / 3

Nested Loop (cost=616.13..658.00 rows=1 width=20,832) (actual time=2.307..2.307 rows=0 loops=1)

  • Output: "*SELECT* 1_4".id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying, NULL::character varying, NULL::integer, NULL::integer, NULL::integer, NULL::character varying(255), NULL::integer, NULL::timestamp with time zone, NULL::integer, NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::timestamp without time zone, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::integer, NULL::integer
  • Inner Unique: true
169. 0.012 0.769 ↓ 0.0 0 1 / 3

Hash Join (cost=615.85..653.33 rows=4 width=12) (actual time=2.307..2.307 rows=0 loops=1)

  • Output: "*SELECT* 1_4".id, rel_u_6.user_id2, b_6.user_id
  • Hash Cond: (rel_u_6.user_id2 = b_6.user_id)
170. 0.005 0.708 ↓ 0.0 0 1 / 3

Parallel Hash Join (cost=594.54..631.97 rows=5 width=8) (actual time=2.119..2.123 rows=0 loops=1)

  • Output: "*SELECT* 1_4".id, rel_u_6.user_id2
  • Hash Cond: (rel_u_6.user_id1 = "*SELECT* 1_4".parent_id)
171. 0.000 0.000 ↓ 0.0 0 / 3

Parallel Append (cost=0.00..35.24 rows=578 width=8) (never executed)

172. 0.000 0.000 ↓ 0.0 0 / 3

Parallel Seq Scan on public.rel_users rel_u_6 (cost=0.00..32.35 rows=578 width=8) (never executed)

  • Output: rel_u_6.user_id1, rel_u_6.user_id2
  • Filter: ((rel_u_6.type)::text = 'CUSTOMER'::text)
173. 0.000 0.702 ↓ 0.0 0 1 / 3

Parallel Hash (cost=594.53..594.53 rows=1 width=8) (actual time=2.107..2.107 rows=0 loops=1)

  • Output: "*SELECT* 1_4".id, "*SELECT* 1_4".parent_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 0kB
174. 0.000 0.702 ↓ 0.0 0 1 / 3

Parallel Append (cost=49.64..594.53 rows=1 width=8) (actual time=2.106..2.106 rows=0 loops=1)

175. 0.000 0.356 ↓ 0.0 0 1 / 3

Subquery Scan on *SELECT* 1_4 (cost=50.52..349.76 rows=1 width=8) (actual time=1.069..1.069 rows=0 loops=1)

  • Output: "*SELECT* 1_4".id, "*SELECT* 1_4".parent_id
  • Filter: (NOT (hashed SubPlan 6))
176. 0.356 0.356 ↓ 0.0 0 1 / 3

Seq Scan on public.users u_4 (cost=1.45..300.68 rows=1 width=7,392) (actual time=1.068..1.068 rows=0 loops=1)

  • Output: u_4.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), u_4.parent_id, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying, NULL::character varying, NULL::integer, NULL::character varying, NULL::character varying
  • Filter: ((u_4.parent_id IS NULL) AND (u_4.parent_id IS NOT NULL) AND (NOT (hashed SubPlan 7)) AND ((u_4.type)::text = 'CARRIER'::text))
  • Rows Removed by Filter: 8,028
177.          

SubPlan (for Seq Scan)

178. 0.000 0.000 ↓ 0.0 0 / 3

Seq Scan on public.rel_cias rel_cias_2 (cost=0.00..1.36 rows=36 width=4) (never executed)

  • Output: rel_cias_2.user_id
179.          

SubPlan (for Subquery Scan)

180. 0.021 0.114 ↑ 1.1 923 1 / 3

Append (cost=0.00..46.62 rows=983 width=4) (actual time=0.009..0.343 rows=923 loops=1)

181. 0.094 0.094 ↑ 1.1 923 1 / 3

Seq Scan on public.rel_users rel_users_3 (cost=0.00..41.70 rows=983 width=4) (actual time=0.008..0.281 rows=923 loops=1)

  • Output: rel_users_3.user_id1
  • Filter: ((rel_users_3.type)::text = 'CUSTOMER'::text)
  • Rows Removed by Filter: 828
182. 0.201 0.294 ↓ 0.0 0 1 / 3

Subquery Scan on *SELECT* 3_4 (cost=49.64..298.32 rows=1 width=8) (actual time=0.883..0.883 rows=0 loops=1)

  • Output: "*SELECT* 3_4".id, "*SELECT* 3_4".parent_id
  • Filter: (NOT (hashed SubPlan 6))
  • Rows Removed by Filter: 46
183. 0.009 0.093 ↓ 46.0 46 1 / 3

Nested Loop (cost=0.56..249.24 rows=1 width=7,824) (actual time=0.037..0.280 rows=46 loops=1)

  • Output: u_5.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), u_5.parent_id, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(3), NULL::character varying(255), NULL::integer, NULL::character varying(3), NULL::character varying(2)
  • Inner Unique: true
184. 0.005 0.053 ↓ 47.0 47 1 / 3

Nested Loop (cost=0.28..246.60 rows=1 width=12) (actual time=0.014..0.158 rows=47 loops=1)

  • Output: u_5.id, u_5.parent_id, cia_d.cia_id
  • Inner Unique: true
185. 0.003 0.003 ↓ 1.9 67 1 / 3

Seq Scan on public.rel_cias cia_d (cost=0.00..1.36 rows=36 width=8) (actual time=0.003..0.010 rows=67 loops=1)

  • Output: cia_d.id, cia_d.created_at, cia_d.user_insert_id, cia_d.remarks, cia_d.active, cia_d.user_id, cia_d.cia_id, cia_d.type, cia_d.status_mask
186. 0.045 0.045 ↑ 1.0 1 67 / 3

Index Scan using users_pkey on public.users u_5 (cost=0.28..6.64 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=67)

  • Output: u_5.id, u_5.created_at, u_5.user_insert_id, u_5.remarks, u_5.active, u_5.name, u_5.surname, u_5.login, u_5.password, u_5.password_change_date, u_5.ini_date, u_5.end_date, u_5.type, u_5.parent_id, u_5.card_id, u_5.card_type, u_5.address, u_5.telephone, u_5.email, u_5.station, u_5.post_code, u_5.code, u_5.login_method, u_5.station_id, u_5.concept_id, u_5.roles, u_5.last_login, u_5.city, u_5.country, u_5.iso_code, u_5.province, u_5.change_password, u_5.function_id, u_5.department_id, u_5.seniority, u_5.next_of_kin_name, u_5.next_of_kin_phone, u_5.status_mask
  • Index Cond: (u_5.id = cia_d.user_id)
  • Filter: ((u_5.parent_id IS NOT NULL) AND (u_5.parent_id IS NOT NULL) AND ((u_5.type)::text = 'CARRIER'::text))
  • Rows Removed by Filter: 0
187. 0.031 0.031 ↑ 1.0 1 47 / 3

Index Only Scan using companies_pkey on public.companies c_2 (cost=0.28..2.63 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=47)

  • Output: c_2.id
  • Index Cond: (c_2.id = cia_d.cia_id)
  • Heap Fetches: 44
188. 0.000 0.051 ↓ 0.0 0 1 / 3

Subquery Scan on *SELECT* 2_4 (cost=49.64..296.20 rows=1 width=8) (actual time=0.153..0.153 rows=0 loops=1)

  • Output: "*SELECT* 2_4".id, "*SELECT* 2_4".parent_id
  • Filter: (NOT (hashed SubPlan 6))
189. 0.000 0.051 ↓ 0.0 0 1 / 3

Nested Loop (cost=0.56..247.12 rows=1 width=7,824) (actual time=0.152..0.152 rows=0 loops=1)

  • Output: u_6.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), u_6.parent_id, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(3), NULL::character varying(255), NULL::integer, NULL::character varying(3), NULL::character varying(2)
  • Inner Unique: true
190. 0.003 0.050 ↓ 0.0 0 1 / 3

Nested Loop (cost=0.28..244.49 rows=1 width=12) (actual time=0.151..0.151 rows=0 loops=1)

  • Output: u_6.id, u_6.parent_id, cia_d_1.cia_id
  • Inner Unique: true
191. 0.003 0.003 ↓ 1.9 67 1 / 3

Seq Scan on public.rel_cias cia_d_1 (cost=0.00..1.36 rows=36 width=8) (actual time=0.004..0.009 rows=67 loops=1)

  • Output: cia_d_1.id, cia_d_1.created_at, cia_d_1.user_insert_id, cia_d_1.remarks, cia_d_1.active, cia_d_1.user_id, cia_d_1.cia_id, cia_d_1.type, cia_d_1.status_mask
192. 0.045 0.045 ↓ 0.0 0 67 / 3

Index Scan using users_pkey on public.users u_6 (cost=0.28..6.64 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=67)

  • Output: u_6.id, u_6.created_at, u_6.user_insert_id, u_6.remarks, u_6.active, u_6.name, u_6.surname, u_6.login, u_6.password, u_6.password_change_date, u_6.ini_date, u_6.end_date, u_6.type, u_6.parent_id, u_6.card_id, u_6.card_type, u_6.address, u_6.telephone, u_6.email, u_6.station, u_6.post_code, u_6.code, u_6.login_method, u_6.station_id, u_6.concept_id, u_6.roles, u_6.last_login, u_6.city, u_6.country, u_6.iso_code, u_6.province, u_6.change_password, u_6.function_id, u_6.department_id, u_6.seniority, u_6.next_of_kin_name, u_6.next_of_kin_phone, u_6.status_mask
  • Index Cond: (u_6.id = cia_d_1.user_id)
  • Filter: ((u_6.parent_id IS NULL) AND (u_6.parent_id IS NOT NULL) AND ((u_6.type)::text = 'CARRIER'::text))
  • Rows Removed by Filter: 1
193. 0.000 0.000 ↓ 0.0 0 / 3

Index Only Scan using companies_pkey on public.companies c_3 (cost=0.28..2.63 rows=1 width=4) (never executed)

  • Output: c_3.id
  • Index Cond: (c_3.id = cia_d_1.cia_id)
  • Heap Fetches: 0
194. 0.024 0.049 ↓ 1.0 466 1 / 3

Hash (cost=15.58..15.58 rows=458 width=4) (actual time=0.146..0.147 rows=466 loops=1)

  • Output: b_6.user_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 25kB
195. 0.025 0.025 ↓ 1.0 466 1 / 3

Seq Scan on public.users_billings b_6 (cost=0.00..15.58 rows=458 width=4) (actual time=0.008..0.074 rows=466 loops=1)

  • Output: b_6.user_id
196. 0.000 0.000 ↓ 0.0 0 / 3

Index Scan using users_pkey on public.users u2_12 (cost=0.28..1.17 rows=1 width=4) (never executed)

  • Output: u2_12.id, u2_12.created_at, u2_12.user_insert_id, u2_12.remarks, u2_12.active, u2_12.name, u2_12.surname, u2_12.login, u2_12.password, u2_12.password_change_date, u2_12.ini_date, u2_12.end_date, u2_12.type, u2_12.parent_id, u2_12.card_id, u2_12.card_type, u2_12.address, u2_12.telephone, u2_12.email, u2_12.station, u2_12.post_code, u2_12.code, u2_12.login_method, u2_12.station_id, u2_12.concept_id, u2_12.roles, u2_12.last_login, u2_12.city, u2_12.country, u2_12.iso_code, u2_12.province, u2_12.change_password, u2_12.function_id, u2_12.department_id, u2_12.seniority, u2_12.next_of_kin_name, u2_12.next_of_kin_phone, u2_12.status_mask
  • Index Cond: (u2_12.id = rel_u_6.user_id2)
  • Filter: ((u2_12.type)::text = 'CUSTOMER'::text)
197. 0.003 0.806 ↓ 52.0 52 1 / 3

Subquery Scan on *SELECT* 2_2 (cost=517.98..559.86 rows=1 width=4) (actual time=1.875..2.418 rows=52 loops=1)

  • Output: "*SELECT* 2_2".id
198. 0.013 0.803 ↓ 52.0 52 1 / 3

Nested Loop (cost=517.98..559.85 rows=1 width=20,832) (actual time=1.874..2.410 rows=52 loops=1)

  • Output: "*SELECT* 1_5".id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying, NULL::character varying, NULL::integer, NULL::integer, NULL::integer, NULL::character varying(255), NULL::integer, NULL::timestamp with time zone, NULL::integer, NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::timestamp without time zone, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::integer, NULL::integer
  • Inner Unique: true
199. 0.016 0.755 ↓ 13.0 52 1 / 3

Hash Join (cost=517.70..555.18 rows=4 width=12) (actual time=1.852..2.266 rows=52 loops=1)

  • Output: "*SELECT* 1_5".id, rel_u_7.user_id2, b_7.user_id
  • Hash Cond: (rel_u_7.user_id2 = b_7.user_id)
200. 0.037 0.688 ↓ 11.0 55 1 / 3

Parallel Hash Join (cost=496.39..533.82 rows=5 width=8) (actual time=1.663..2.065 rows=55 loops=1)

  • Output: "*SELECT* 1_5".id, rel_u_7.user_id2
  • Hash Cond: (rel_u_7.user_id1 = "*SELECT* 1_5".id)
201. 0.019 0.113 ↓ 1.6 923 1 / 3

Parallel Append (cost=0.00..35.24 rows=578 width=8) (actual time=0.006..0.339 rows=923 loops=1)

202. 0.094 0.094 ↓ 1.6 923 1 / 3

Parallel Seq Scan on public.rel_users rel_u_7 (cost=0.00..32.35 rows=578 width=8) (actual time=0.005..0.283 rows=923 loops=1)

  • Output: rel_u_7.user_id1, rel_u_7.user_id2
  • Filter: ((rel_u_7.type)::text = 'CUSTOMER'::text)
  • Rows Removed by Filter: 828
203. 0.005 0.538 ↓ 46.0 46 1 / 3

Parallel Hash (cost=496.38..496.38 rows=1 width=4) (actual time=1.615..1.615 rows=46 loops=1)

  • Output: "*SELECT* 1_5".id
  • Buckets: 1,024 Batches: 1 Memory Usage: 40kB
204. 0.002 0.533 ↓ 46.0 46 1 / 3

Parallel Append (cost=0.56..496.38 rows=1 width=4) (actual time=0.204..1.600 rows=46 loops=1)

205. 0.000 0.349 ↓ 0.0 0 1 / 3

Subquery Scan on *SELECT* 1_5 (cost=1.45..300.69 rows=1 width=4) (actual time=1.046..1.046 rows=0 loops=1)

  • Output: "*SELECT* 1_5".id
206. 0.349 0.349 ↓ 0.0 0 1 / 3

Seq Scan on public.users u_7 (cost=1.45..300.68 rows=1 width=7,392) (actual time=1.046..1.046 rows=0 loops=1)

  • Output: u_7.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying, NULL::character varying, NULL::integer, NULL::character varying, NULL::character varying
  • Filter: ((u_7.parent_id IS NULL) AND (u_7.parent_id IS NOT NULL) AND (NOT (hashed SubPlan 5)) AND ((u_7.type)::text = 'CARRIER'::text))
  • Rows Removed by Filter: 8,028
207. 0.000 0.000 ↓ 0.0 0 / 3

Seq Scan on public.rel_cias rel_cias_1 (cost=0.00..1.36 rows=36 width=4) (never executed)

  • Output: rel_cias_1.user_id
208. 0.003 0.130 ↓ 46.0 46 1 / 3

Subquery Scan on *SELECT* 3_5 (cost=0.56..249.25 rows=1 width=4) (actual time=0.046..0.390 rows=46 loops=1)

  • Output: "*SELECT* 3_5".id
209. 0.007 0.127 ↓ 46.0 46 1 / 3

Nested Loop (cost=0.56..249.24 rows=1 width=7,824) (actual time=0.045..0.382 rows=46 loops=1)

  • Output: u_8.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(3), NULL::character varying(255), NULL::integer, NULL::character varying(3), NULL::character varying(2)
  • Inner Unique: true
210. 0.010 0.058 ↓ 47.0 47 1 / 3

Nested Loop (cost=0.28..246.60 rows=1 width=8) (actual time=0.024..0.173 rows=47 loops=1)

  • Output: u_8.id, cia_d_2.cia_id
  • Inner Unique: true
211. 0.003 0.003 ↓ 1.9 67 1 / 3

Seq Scan on public.rel_cias cia_d_2 (cost=0.00..1.36 rows=36 width=8) (actual time=0.003..0.010 rows=67 loops=1)

  • Output: cia_d_2.id, cia_d_2.created_at, cia_d_2.user_insert_id, cia_d_2.remarks, cia_d_2.active, cia_d_2.user_id, cia_d_2.cia_id, cia_d_2.type, cia_d_2.status_mask
212. 0.045 0.045 ↑ 1.0 1 67 / 3

Index Scan using users_pkey on public.users u_8 (cost=0.28..6.64 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=67)

  • Output: u_8.id, u_8.created_at, u_8.user_insert_id, u_8.remarks, u_8.active, u_8.name, u_8.surname, u_8.login, u_8.password, u_8.password_change_date, u_8.ini_date, u_8.end_date, u_8.type, u_8.parent_id, u_8.card_id, u_8.card_type, u_8.address, u_8.telephone, u_8.email, u_8.station, u_8.post_code, u_8.code, u_8.login_method, u_8.station_id, u_8.concept_id, u_8.roles, u_8.last_login, u_8.city, u_8.country, u_8.iso_code, u_8.province, u_8.change_password, u_8.function_id, u_8.department_id, u_8.seniority, u_8.next_of_kin_name, u_8.next_of_kin_phone, u_8.status_mask
  • Index Cond: (u_8.id = cia_d_2.user_id)
  • Filter: ((u_8.parent_id IS NOT NULL) AND (u_8.parent_id IS NOT NULL) AND ((u_8.type)::text = 'CARRIER'::text))
  • Rows Removed by Filter: 0
213. 0.063 0.063 ↑ 1.0 1 47 / 3

Index Only Scan using companies_pkey on public.companies c_4 (cost=0.28..2.63 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=47)

  • Output: c_4.id
  • Index Cond: (c_4.id = cia_d_2.cia_id)
  • Heap Fetches: 44
214. 0.000 0.053 ↓ 0.0 0 1 / 3

Subquery Scan on *SELECT* 2_5 (cost=0.56..247.13 rows=1 width=4) (actual time=0.158..0.158 rows=0 loops=1)

  • Output: "*SELECT* 2_5".id
215. 0.000 0.052 ↓ 0.0 0 1 / 3

Nested Loop (cost=0.56..247.12 rows=1 width=7,824) (actual time=0.157..0.157 rows=0 loops=1)

  • Output: u_9.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(3), NULL::character varying(255), NULL::integer, NULL::character varying(3), NULL::character varying(2)
  • Inner Unique: true
216. 0.004 0.052 ↓ 0.0 0 1 / 3

Nested Loop (cost=0.28..244.49 rows=1 width=8) (actual time=0.156..0.156 rows=0 loops=1)

  • Output: u_9.id, cia_d_3.cia_id
  • Inner Unique: true
217. 0.004 0.004 ↓ 1.9 67 1 / 3

Seq Scan on public.rel_cias cia_d_3 (cost=0.00..1.36 rows=36 width=8) (actual time=0.005..0.011 rows=67 loops=1)

  • Output: cia_d_3.id, cia_d_3.created_at, cia_d_3.user_insert_id, cia_d_3.remarks, cia_d_3.active, cia_d_3.user_id, cia_d_3.cia_id, cia_d_3.type, cia_d_3.status_mask
218. 0.045 0.045 ↓ 0.0 0 67 / 3

Index Scan using users_pkey on public.users u_9 (cost=0.28..6.64 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=67)

  • Output: u_9.id, u_9.created_at, u_9.user_insert_id, u_9.remarks, u_9.active, u_9.name, u_9.surname, u_9.login, u_9.password, u_9.password_change_date, u_9.ini_date, u_9.end_date, u_9.type, u_9.parent_id, u_9.card_id, u_9.card_type, u_9.address, u_9.telephone, u_9.email, u_9.station, u_9.post_code, u_9.code, u_9.login_method, u_9.station_id, u_9.concept_id, u_9.roles, u_9.last_login, u_9.city, u_9.country, u_9.iso_code, u_9.province, u_9.change_password, u_9.function_id, u_9.department_id, u_9.seniority, u_9.next_of_kin_name, u_9.next_of_kin_phone, u_9.status_mask
  • Index Cond: (u_9.id = cia_d_3.user_id)
  • Filter: ((u_9.parent_id IS NULL) AND (u_9.parent_id IS NOT NULL) AND ((u_9.type)::text = 'CARRIER'::text))
  • Rows Removed by Filter: 1
219. 0.000 0.000 ↓ 0.0 0 / 3

Index Only Scan using companies_pkey on public.companies c_5 (cost=0.28..2.63 rows=1 width=4) (never executed)

  • Output: c_5.id
  • Index Cond: (c_5.id = cia_d_3.cia_id)
  • Heap Fetches: 0
220. 0.027 0.051 ↓ 1.0 466 1 / 3

Hash (cost=15.58..15.58 rows=458 width=4) (actual time=0.154..0.154 rows=466 loops=1)

  • Output: b_7.user_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 25kB
221. 0.024 0.024 ↓ 1.0 466 1 / 3

Seq Scan on public.users_billings b_7 (cost=0.00..15.58 rows=458 width=4) (actual time=0.007..0.073 rows=466 loops=1)

  • Output: b_7.user_id
222. 0.035 0.035 ↑ 1.0 1 52 / 3

Index Scan using users_pkey on public.users u2_13 (cost=0.28..1.17 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=52)

  • Output: u2_13.id, u2_13.created_at, u2_13.user_insert_id, u2_13.remarks, u2_13.active, u2_13.name, u2_13.surname, u2_13.login, u2_13.password, u2_13.password_change_date, u2_13.ini_date, u2_13.end_date, u2_13.type, u2_13.parent_id, u2_13.card_id, u2_13.card_type, u2_13.address, u2_13.telephone, u2_13.email, u2_13.station, u2_13.post_code, u2_13.code, u2_13.login_method, u2_13.station_id, u2_13.concept_id, u2_13.roles, u2_13.last_login, u2_13.city, u2_13.country, u2_13.iso_code, u2_13.province, u2_13.change_password, u2_13.function_id, u2_13.department_id, u2_13.seniority, u2_13.next_of_kin_name, u2_13.next_of_kin_phone, u2_13.status_mask
  • Index Cond: (u2_13.id = rel_u_7.user_id2)
  • Filter: ((u2_13.type)::text = 'CUSTOMER'::text)
223. 0.003 2.216 ↓ 42.0 42 1 / 3

Subquery Scan on *SELECT* 1_2 (cost=322.92..421.70 rows=1 width=4) (actual time=6.101..6.647 rows=42 loops=1)

  • Output: "*SELECT* 1_2".id
224. 0.019 2.213 ↓ 42.0 42 1 / 3

Nested Loop (cost=322.92..421.69 rows=1 width=20,832) (actual time=6.100..6.639 rows=42 loops=1)

  • Output: "*SELECT* 1_6".id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying, NULL::character varying, NULL::integer, NULL::integer, NULL::integer, NULL::character varying(255), NULL::integer, NULL::timestamp with time zone, NULL::integer, NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::timestamp without time zone, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::integer, NULL::integer
  • Inner Unique: true
225. 0.006 2.166 ↑ 1.2 42 1 / 3

Hash Join (cost=322.64..361.10 rows=52 width=12) (actual time=6.078..6.497 rows=42 loops=1)

  • Output: "*SELECT* 1_6".id, rel_u_8.user_id2, b_8.user_id
  • Hash Cond: (rel_u_8.user_id2 = b_8.user_id)
226. 0.113 2.111 ↑ 1.6 42 1 / 3

Parallel Hash Join (cost=301.33..339.02 rows=68 width=8) (actual time=5.925..6.334 rows=42 loops=1)

  • Output: "*SELECT* 1_6".id, rel_u_8.user_id2
  • Hash Cond: (rel_u_8.user_id1 = "*SELECT* 1_6".id)
227. 0.019 0.116 ↓ 1.6 923 1 / 3

Parallel Append (cost=0.00..35.24 rows=578 width=8) (actual time=0.007..0.347 rows=923 loops=1)

228. 0.097 0.097 ↓ 1.6 923 1 / 3

Parallel Seq Scan on public.rel_users rel_u_8 (cost=0.00..32.35 rows=578 width=8) (actual time=0.006..0.291 rows=923 loops=1)

  • Output: rel_u_8.user_id1, rel_u_8.user_id2
  • Filter: ((rel_u_8.type)::text = 'CUSTOMER'::text)
  • Rows Removed by Filter: 828
229. 0.006 1.883 ↓ 1.9 30 1 / 3

Parallel Hash (cost=301.13..301.13 rows=16 width=4) (actual time=5.649..5.649 rows=30 loops=1)

  • Output: "*SELECT* 1_6".id
  • Buckets: 1,024 Batches: 1 Memory Usage: 40kB
230. 0.001 1.877 ↓ 1.9 30 1 / 3

Parallel Append (cost=0.56..301.13 rows=16 width=4) (actual time=0.227..5.632 rows=30 loops=1)

231. 0.001 0.686 ↑ 3.5 11 1 / 3

Subquery Scan on *SELECT* 1_6 (cost=1.45..301.06 rows=38 width=4) (actual time=0.054..2.059 rows=11 loops=1)

  • Output: "*SELECT* 1_6".id
232. 0.682 0.686 ↑ 3.5 11 1 / 3

Seq Scan on public.users u_10 (cost=1.45..300.68 rows=38 width=7,392) (actual time=0.053..2.057 rows=11 loops=1)

  • Output: u_10.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying, NULL::character varying, NULL::integer, NULL::character varying, NULL::character varying
  • Filter: ((u_10.parent_id IS NULL) AND (u_10.parent_id IS NULL) AND (NOT (hashed SubPlan 4)) AND ((u_10.type)::text = 'CARRIER'::text))
  • Rows Removed by Filter: 8,017
233.          

SubPlan (for Seq Scan)

234. 0.004 0.004 ↓ 1.9 67 1 / 3

Seq Scan on public.rel_cias (cost=0.00..1.36 rows=36 width=4) (actual time=0.003..0.011 rows=67 loops=1)

  • Output: rel_cias.user_id
235. 0.000 0.048 ↓ 0.0 0 1 / 3

Subquery Scan on *SELECT* 3_6 (cost=0.56..247.13 rows=1 width=4) (actual time=0.143..0.144 rows=0 loops=1)

  • Output: "*SELECT* 3_6".id
236. 0.000 0.048 ↓ 0.0 0 1 / 3

Nested Loop (cost=0.56..247.12 rows=1 width=7,824) (actual time=0.143..0.143 rows=0 loops=1)

  • Output: u_11.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(3), NULL::character varying(255), NULL::integer, NULL::character varying(3), NULL::character varying(2)
  • Inner Unique: true
237. 0.000 0.048 ↓ 0.0 0 1 / 3

Nested Loop (cost=0.28..244.49 rows=1 width=8) (actual time=0.143..0.143 rows=0 loops=1)

  • Output: u_11.id, cia_d_4.cia_id
  • Inner Unique: true
238. 0.003 0.003 ↓ 1.9 67 1 / 3

Seq Scan on public.rel_cias cia_d_4 (cost=0.00..1.36 rows=36 width=8) (actual time=0.005..0.010 rows=67 loops=1)

  • Output: cia_d_4.id, cia_d_4.created_at, cia_d_4.user_insert_id, cia_d_4.remarks, cia_d_4.active, cia_d_4.user_id, cia_d_4.cia_id, cia_d_4.type, cia_d_4.status_mask
239. 0.045 0.045 ↓ 0.0 0 67 / 3

Index Scan using users_pkey on public.users u_11 (cost=0.28..6.64 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=67)

  • Output: u_11.id, u_11.created_at, u_11.user_insert_id, u_11.remarks, u_11.active, u_11.name, u_11.surname, u_11.login, u_11.password, u_11.password_change_date, u_11.ini_date, u_11.end_date, u_11.type, u_11.parent_id, u_11.card_id, u_11.card_type, u_11.address, u_11.telephone, u_11.email, u_11.station, u_11.post_code, u_11.code, u_11.login_method, u_11.station_id, u_11.concept_id, u_11.roles, u_11.last_login, u_11.city, u_11.country, u_11.iso_code, u_11.province, u_11.change_password, u_11.function_id, u_11.department_id, u_11.seniority, u_11.next_of_kin_name, u_11.next_of_kin_phone, u_11.status_mask
  • Index Cond: (u_11.id = cia_d_4.user_id)
  • Filter: ((u_11.parent_id IS NOT NULL) AND (u_11.parent_id IS NULL) AND ((u_11.type)::text = 'CARRIER'::text))
  • Rows Removed by Filter: 1
240. 0.000 0.000 ↓ 0.0 0 / 3

Index Only Scan using companies_pkey on public.companies c_6 (cost=0.28..2.63 rows=1 width=4) (never executed)

  • Output: c_6.id
  • Index Cond: (c_6.id = cia_d_4.cia_id)
  • Heap Fetches: 0
241. 0.002 1.142 ↓ 19.0 19 1 / 3

Subquery Scan on *SELECT* 2_6 (cost=11.54..40.16 rows=1 width=4) (actual time=0.226..3.425 rows=19 loops=1)

  • Output: "*SELECT* 2_6".id
242. 0.006 1.140 ↓ 19.0 19 1 / 3

Nested Loop (cost=11.54..40.15 rows=1 width=7,824) (actual time=0.225..3.420 rows=19 loops=1)

  • Output: u_12.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(3), NULL::character varying(255), NULL::integer, NULL::character varying(3), NULL::character varying(2)
  • Inner Unique: true
243. 0.006 1.077 ↓ 19.0 19 1 / 3

Merge Join (cost=11.26..37.51 rows=1 width=8) (actual time=0.156..3.230 rows=19 loops=1)

  • Output: u_12.id, cia_d_5.cia_id
  • Merge Cond: (u_12.id = cia_d_5.user_id)
244. 1.045 1.045 ↑ 2.6 30 1 / 3

Index Scan using users_pkey on public.users u_12 (cost=0.28..669.06 rows=77 width=4) (actual time=0.041..3.135 rows=30 loops=1)

  • Output: u_12.id, u_12.created_at, u_12.user_insert_id, u_12.remarks, u_12.active, u_12.name, u_12.surname, u_12.login, u_12.password, u_12.password_change_date, u_12.ini_date, u_12.end_date, u_12.type, u_12.parent_id, u_12.card_id, u_12.card_type, u_12.address, u_12.telephone, u_12.email, u_12.station, u_12.post_code, u_12.code, u_12.login_method, u_12.station_id, u_12.concept_id, u_12.roles, u_12.last_login, u_12.city, u_12.country, u_12.iso_code, u_12.province, u_12.change_password, u_12.function_id, u_12.department_id, u_12.seniority, u_12.next_of_kin_name, u_12.next_of_kin_phone, u_12.status_mask
  • Filter: ((u_12.parent_id IS NULL) AND (u_12.parent_id IS NULL) AND ((u_12.type)::text = 'CARRIER'::text))
  • Rows Removed by Filter: 7,998
245. 0.017 0.025 ↓ 1.9 67 1 / 3

Sort (cost=2.29..2.38 rows=36 width=8) (actual time=0.070..0.076 rows=67 loops=1)

  • Output: cia_d_5.user_id, cia_d_5.cia_id
  • Sort Key: cia_d_5.user_id
  • Sort Method: quicksort Memory: 28kB
246. 0.008 0.008 ↓ 1.9 67 1 / 3

Seq Scan on public.rel_cias cia_d_5 (cost=0.00..1.36 rows=36 width=8) (actual time=0.016..0.025 rows=67 loops=1)

  • Output: cia_d_5.user_id, cia_d_5.cia_id
247. 0.057 0.057 ↑ 1.0 1 19 / 3

Index Only Scan using companies_pkey on public.companies c_7 (cost=0.28..2.63 rows=1 width=4) (actual time=0.009..0.009 rows=1 loops=19)

  • Output: c_7.id
  • Index Cond: (c_7.id = cia_d_5.cia_id)
  • Heap Fetches: 18
248. 0.024 0.049 ↓ 1.0 466 1 / 3

Hash (cost=15.58..15.58 rows=458 width=4) (actual time=0.146..0.146 rows=466 loops=1)

  • Output: b_8.user_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 25kB
249. 0.025 0.025 ↓ 1.0 466 1 / 3

Seq Scan on public.users_billings b_8 (cost=0.00..15.58 rows=458 width=4) (actual time=0.008..0.074 rows=466 loops=1)

  • Output: b_8.user_id
250. 0.028 0.028 ↑ 1.0 1 42 / 3

Index Scan using users_pkey on public.users u2_14 (cost=0.28..1.17 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=42)

  • Output: u2_14.id, u2_14.created_at, u2_14.user_insert_id, u2_14.remarks, u2_14.active, u2_14.name, u2_14.surname, u2_14.login, u2_14.password, u2_14.password_change_date, u2_14.ini_date, u2_14.end_date, u2_14.type, u2_14.parent_id, u2_14.card_id, u2_14.card_type, u2_14.address, u2_14.telephone, u2_14.email, u2_14.station, u2_14.post_code, u2_14.code, u2_14.login_method, u2_14.station_id, u2_14.concept_id, u2_14.roles, u2_14.last_login, u2_14.city, u2_14.country, u2_14.iso_code, u2_14.province, u2_14.change_password, u2_14.function_id, u2_14.department_id, u2_14.seniority, u2_14.next_of_kin_name, u2_14.next_of_kin_phone, u2_14.status_mask
  • Index Cond: (u2_14.id = rel_u_8.user_id2)
  • Filter: ((u2_14.type)::text = 'CUSTOMER'::text)
251. 0.097 7.826 ↑ 1.0 3 182

Materialize (cost=253.61..1,149.64 rows=3 width=7) (actual time=0.032..0.043 rows=3 loops=182)

  • Output: "*SELECT* 1_3".oaci, "*SELECT* 1_3".id
252. 0.004 7.729 ↑ 1.0 3 1

Append (cost=253.61..1,149.62 rows=3 width=7) (actual time=5.782..7.729 rows=3 loops=1)

253. 0.001 4.467 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1_3 (cost=253.61..277.08 rows=1 width=7) (actual time=4.467..4.467 rows=0 loops=1)

  • Output: "*SELECT* 1_3".oaci, "*SELECT* 1_3".id
254. 0.000 4.466 ↓ 0.0 0 1

Nested Loop (cost=253.61..277.07 rows=1 width=20,803) (actual time=4.466..4.466 rows=0 loops=1)

  • Output: "*SELECT* 2_7".id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, "*SELECT* 2_7".oaci, NULL::character varying, NULL::integer, NULL::integer, NULL::integer, NULL::character varying(255), NULL::integer, NULL::timestamp with time zone, NULL::integer, NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::timestamp without time zone, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::integer, NULL::integer
  • Inner Unique: true
255. 0.015 4.466 ↓ 0.0 0 1

Hash Join (cost=253.33..271.25 rows=5 width=15) (actual time=4.466..4.466 rows=0 loops=1)

  • Output: "*SELECT* 2_7".id, "*SELECT* 2_7".oaci, rel_u_9.user_id2, b_9.user_id
  • Hash Cond: (b_9.user_id = rel_u_9.user_id2)
256. 0.007 0.007 ↑ 458.0 1 1

Seq Scan on public.users_billings b_9 (cost=0.00..15.58 rows=458 width=4) (actual time=0.007..0.007 rows=1 loops=1)

  • Output: b_9.id, b_9.user_id, b_9.credit_client, b_9.bank_account_number, b_9.cass_number, b_9.inherit, b_9.valid_until, b_9.vat, b_9.bank_sort_code, b_9.bank_name, b_9.currency_code, b_9.shed_currency, b_9.invoice_channel, b_9.legal_statement, b_9.customer_reference, b_9.payment_conditions, b_9.client_address, b_9.status_mask, b_9.address, b_9.post_code, b_9.city, b_9.country, b_9.iso_code, b_9.account_number, b_9.invoice_frequency, b_9.invoice_language, b_9.invoice_mode
257. 0.000 4.444 ↓ 0.0 0 1

Hash (cost=253.25..253.25 rows=6 width=11) (actual time=4.444..4.444 rows=0 loops=1)

  • Output: "*SELECT* 2_7".id, "*SELECT* 2_7".oaci, rel_u_9.user_id2
  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
258. 0.013 4.444 ↓ 0.0 0 1

Hash Join (cost=202.89..253.25 rows=6 width=11) (actual time=4.443..4.444 rows=0 loops=1)

  • Output: "*SELECT* 2_7".id, "*SELECT* 2_7".oaci, rel_u_9.user_id2
  • Hash Cond: (rel_u_9.user_id1 = "*SELECT* 2_7".id)
259. 0.000 0.008 ↑ 983.0 1 1

Append (cost=0.00..46.62 rows=983 width=8) (actual time=0.008..0.008 rows=1 loops=1)

260. 0.008 0.008 ↑ 983.0 1 1

Seq Scan on public.rel_users rel_u_9 (cost=0.00..41.70 rows=983 width=8) (actual time=0.008..0.008 rows=1 loops=1)

  • Output: rel_u_9.user_id1, rel_u_9.user_id2
  • Filter: ((rel_u_9.type)::text = 'CUSTOMER'::text)
261. 0.001 4.423 ↓ 0.0 0 1

Hash (cost=202.86..202.86 rows=2 width=7) (actual time=4.422..4.423 rows=0 loops=1)

  • Output: "*SELECT* 2_7".id, "*SELECT* 2_7".oaci
  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
262. 0.002 4.422 ↓ 0.0 0 1

Append (cost=11.54..202.86 rows=2 width=7) (actual time=4.422..4.422 rows=0 loops=1)

263. 0.001 3.661 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2_7 (cost=11.54..49.40 rows=1 width=7) (actual time=3.661..3.661 rows=0 loops=1)

  • Output: "*SELECT* 2_7".id, "*SELECT* 2_7".oaci
264. 0.013 3.660 ↓ 0.0 0 1

Nested Loop (cost=11.54..49.39 rows=1 width=7,811) (actual time=3.660..3.660 rows=0 loops=1)

  • Output: u_13.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, c_8.oaci, NULL::character varying(255), NULL::integer, NULL::character varying(3), NULL::character varying(2)
  • Inner Unique: true
265. 0.020 3.590 ↓ 19.0 19 1

Merge Join (cost=11.26..37.51 rows=1 width=8) (actual time=0.113..3.590 rows=19 loops=1)

  • Output: u_13.id, cia_d_6.cia_id
  • Merge Cond: (u_13.id = cia_d_6.user_id)
266. 3.530 3.530 ↑ 2.6 30 1

Index Scan using users_pkey on public.users u_13 (cost=0.28..669.06 rows=77 width=4) (actual time=0.035..3.530 rows=30 loops=1)

  • Output: u_13.id, u_13.created_at, u_13.user_insert_id, u_13.remarks, u_13.active, u_13.name, u_13.surname, u_13.login, u_13.password, u_13.password_change_date, u_13.ini_date, u_13.end_date, u_13.type, u_13.parent_id, u_13.card_id, u_13.card_type, u_13.address, u_13.telephone, u_13.email, u_13.station, u_13.post_code, u_13.code, u_13.login_method, u_13.station_id, u_13.concept_id, u_13.roles, u_13.last_login, u_13.city, u_13.country, u_13.iso_code, u_13.province, u_13.change_password, u_13.function_id, u_13.department_id, u_13.seniority, u_13.next_of_kin_name, u_13.next_of_kin_phone, u_13.status_mask
  • Filter: ((u_13.parent_id IS NULL) AND (u_13.parent_id IS NULL) AND ((u_13.type)::text = 'CARRIER'::text))
  • Rows Removed by Filter: 7,998
267. 0.027 0.040 ↓ 1.9 67 1

Sort (cost=2.29..2.38 rows=36 width=8) (actual time=0.035..0.040 rows=67 loops=1)

  • Output: cia_d_6.user_id, cia_d_6.cia_id
  • Sort Key: cia_d_6.user_id
  • Sort Method: quicksort Memory: 28kB
268. 0.013 0.013 ↓ 1.9 67 1

Seq Scan on public.rel_cias cia_d_6 (cost=0.00..1.36 rows=36 width=8) (actual time=0.005..0.013 rows=67 loops=1)

  • Output: cia_d_6.user_id, cia_d_6.cia_id
269. 0.057 0.057 ↓ 0.0 0 19

Index Scan using companies_pkey on public.companies c_8 (cost=0.28..6.08 rows=1 width=7) (actual time=0.003..0.003 rows=0 loops=19)

  • Output: c_8.id, c_8.sita, c_8.iata, c_8.oaci, c_8.name, c_8.active, c_8.remarks, c_8.created_at, c_8.user_insert_id, c_8.country
  • Index Cond: (c_8.id = cia_d_6.cia_id)
  • Filter: ((c_8.oaci)::text = 'ETD'::text)
  • Rows Removed by Filter: 1
270. 0.000 0.759 ↓ 0.0 0 1

Subquery Scan on *SELECT* 3_7 (cost=0.28..153.45 rows=1 width=7) (actual time=0.759..0.759 rows=0 loops=1)

  • Output: "*SELECT* 3_7".id, "*SELECT* 3_7".oaci
271. 0.002 0.759 ↓ 0.0 0 1

Nested Loop (cost=0.28..153.44 rows=1 width=7,811) (actual time=0.759..0.759 rows=0 loops=1)

  • Output: u_14.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, c_9.oaci, NULL::character varying(255), NULL::integer, NULL::character varying(3), NULL::character varying(2)
  • Inner Unique: true
272. 0.010 0.742 ↑ 1.0 1 1

Nested Loop (cost=0.00..142.57 rows=1 width=7) (actual time=0.019..0.742 rows=1 loops=1)

  • Output: cia_d_7.user_id, c_9.oaci
  • Join Filter: (cia_d_7.cia_id = c_9.id)
  • Rows Removed by Join Filter: 66
273. 0.725 0.725 ↑ 1.0 1 1

Seq Scan on public.companies c_9 (cost=0.00..140.76 rows=1 width=7) (actual time=0.008..0.725 rows=1 loops=1)

  • Output: c_9.id, c_9.sita, c_9.iata, c_9.oaci, c_9.name, c_9.active, c_9.remarks, c_9.created_at, c_9.user_insert_id, c_9.country
  • Filter: ((c_9.oaci)::text = 'ETD'::text)
  • Rows Removed by Filter: 3,920
274. 0.007 0.007 ↓ 1.9 67 1

Seq Scan on public.rel_cias cia_d_7 (cost=0.00..1.36 rows=36 width=8) (actual time=0.003..0.007 rows=67 loops=1)

  • Output: cia_d_7.id, cia_d_7.created_at, cia_d_7.user_insert_id, cia_d_7.remarks, cia_d_7.active, cia_d_7.user_id, cia_d_7.cia_id, cia_d_7.type, cia_d_7.status_mask
275. 0.015 0.015 ↓ 0.0 0 1

Index Scan using users_pkey on public.users u_14 (cost=0.28..6.64 rows=1 width=4) (actual time=0.015..0.015 rows=0 loops=1)

  • Output: u_14.id, u_14.created_at, u_14.user_insert_id, u_14.remarks, u_14.active, u_14.name, u_14.surname, u_14.login, u_14.password, u_14.password_change_date, u_14.ini_date, u_14.end_date, u_14.type, u_14.parent_id, u_14.card_id, u_14.card_type, u_14.address, u_14.telephone, u_14.email, u_14.station, u_14.post_code, u_14.code, u_14.login_method, u_14.station_id, u_14.concept_id, u_14.roles, u_14.last_login, u_14.city, u_14.country, u_14.iso_code, u_14.province, u_14.change_password, u_14.function_id, u_14.department_id, u_14.seniority, u_14.next_of_kin_name, u_14.next_of_kin_phone, u_14.status_mask
  • Index Cond: (u_14.id = cia_d_7.user_id)
  • Filter: ((u_14.parent_id IS NOT NULL) AND (u_14.parent_id IS NULL) AND ((u_14.type)::text = 'CARRIER'::text))
  • Rows Removed by Filter: 1
276. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on public.users u2_15 (cost=0.28..1.17 rows=1 width=4) (never executed)

  • Output: u2_15.id, u2_15.created_at, u2_15.user_insert_id, u2_15.remarks, u2_15.active, u2_15.name, u2_15.surname, u2_15.login, u2_15.password, u2_15.password_change_date, u2_15.ini_date, u2_15.end_date, u2_15.type, u2_15.parent_id, u2_15.card_id, u2_15.card_type, u2_15.address, u2_15.telephone, u2_15.email, u2_15.station, u2_15.post_code, u2_15.code, u2_15.login_method, u2_15.station_id, u2_15.concept_id, u2_15.roles, u2_15.last_login, u2_15.city, u2_15.country, u2_15.iso_code, u2_15.province, u2_15.change_password, u2_15.function_id, u2_15.department_id, u2_15.seniority, u2_15.next_of_kin_name, u2_15.next_of_kin_phone, u2_15.status_mask
  • Index Cond: (u2_15.id = rel_u_9.user_id2)
  • Filter: ((u2_15.type)::text = 'CUSTOMER'::text)
277. 0.001 1.688 ↓ 3.0 3 1

Subquery Scan on *SELECT* 2_3 (cost=330.65..386.64 rows=1 width=7) (actual time=1.312..1.688 rows=3 loops=1)

  • Output: "*SELECT* 2_3".oaci, "*SELECT* 2_3".id
278. 0.011 1.687 ↓ 3.0 3 1

Nested Loop (cost=330.65..386.63 rows=1 width=20,803) (actual time=1.311..1.687 rows=3 loops=1)

  • Output: "*SELECT* 2_8".id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, "*SELECT* 2_8".oaci, NULL::character varying, NULL::integer, NULL::integer, NULL::integer, NULL::character varying(255), NULL::integer, NULL::timestamp with time zone, NULL::integer, NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::timestamp without time zone, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::integer, NULL::integer
  • Inner Unique: true
279. 0.024 1.658 ↑ 1.7 3 1

Hash Join (cost=330.37..380.80 rows=5 width=15) (actual time=1.289..1.658 rows=3 loops=1)

  • Output: "*SELECT* 2_8".id, "*SELECT* 2_8".oaci, rel_u_10.user_id2, b_10.user_id
  • Hash Cond: (rel_u_10.user_id2 = b_10.user_id)
280. 0.124 1.466 ↑ 1.2 5 1

Hash Join (cost=309.06..359.42 rows=6 width=11) (actual time=1.098..1.466 rows=5 loops=1)

  • Output: "*SELECT* 2_8".id, "*SELECT* 2_8".oaci, rel_u_10.user_id2
  • Hash Cond: (rel_u_10.user_id1 = "*SELECT* 2_8".id)
281. 0.058 0.354 ↑ 1.1 923 1

Append (cost=0.00..46.62 rows=983 width=8) (actual time=0.008..0.354 rows=923 loops=1)

282. 0.296 0.296 ↑ 1.1 923 1

Seq Scan on public.rel_users rel_u_10 (cost=0.00..41.70 rows=983 width=8) (actual time=0.006..0.296 rows=923 loops=1)

  • Output: rel_u_10.user_id1, rel_u_10.user_id2
  • Filter: ((rel_u_10.type)::text = 'CUSTOMER'::text)
  • Rows Removed by Filter: 828
283. 0.008 0.988 ↑ 2.0 1 1

Hash (cost=309.04..309.04 rows=2 width=7) (actual time=0.988..0.988 rows=1 loops=1)

  • Output: "*SELECT* 2_8".id, "*SELECT* 2_8".oaci
  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
284. 0.001 0.980 ↑ 2.0 1 1

Append (cost=0.28..309.04 rows=2 width=7) (actual time=0.537..0.980 rows=1 loops=1)

285. 0.001 0.497 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2_8 (cost=0.28..153.45 rows=1 width=7) (actual time=0.497..0.497 rows=0 loops=1)

  • Output: "*SELECT* 2_8".id, "*SELECT* 2_8".oaci
286. 0.003 0.496 ↓ 0.0 0 1

Nested Loop (cost=0.28..153.44 rows=1 width=7,811) (actual time=0.496..0.496 rows=0 loops=1)

  • Output: u_15.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, c_10.oaci, NULL::character varying(255), NULL::integer, NULL::character varying(3), NULL::character varying(2)
  • Inner Unique: true
287. 0.011 0.478 ↑ 1.0 1 1

Nested Loop (cost=0.00..142.57 rows=1 width=7) (actual time=0.020..0.478 rows=1 loops=1)

  • Output: cia_d_8.user_id, c_10.oaci
  • Join Filter: (cia_d_8.cia_id = c_10.id)
  • Rows Removed by Join Filter: 66
288. 0.456 0.456 ↑ 1.0 1 1

Seq Scan on public.companies c_10 (cost=0.00..140.76 rows=1 width=7) (actual time=0.006..0.456 rows=1 loops=1)

  • Output: c_10.id, c_10.sita, c_10.iata, c_10.oaci, c_10.name, c_10.active, c_10.remarks, c_10.created_at, c_10.user_insert_id, c_10.country
  • Filter: ((c_10.oaci)::text = 'ETD'::text)
  • Rows Removed by Filter: 3,920
289. 0.011 0.011 ↓ 1.9 67 1

Seq Scan on public.rel_cias cia_d_8 (cost=0.00..1.36 rows=36 width=8) (actual time=0.005..0.011 rows=67 loops=1)

  • Output: cia_d_8.id, cia_d_8.created_at, cia_d_8.user_insert_id, cia_d_8.remarks, cia_d_8.active, cia_d_8.user_id, cia_d_8.cia_id, cia_d_8.type, cia_d_8.status_mask
290. 0.015 0.015 ↓ 0.0 0 1

Index Scan using users_pkey on public.users u_15 (cost=0.28..6.64 rows=1 width=4) (actual time=0.015..0.015 rows=0 loops=1)

  • Output: u_15.id, u_15.created_at, u_15.user_insert_id, u_15.remarks, u_15.active, u_15.name, u_15.surname, u_15.login, u_15.password, u_15.password_change_date, u_15.ini_date, u_15.end_date, u_15.type, u_15.parent_id, u_15.card_id, u_15.card_type, u_15.address, u_15.telephone, u_15.email, u_15.station, u_15.post_code, u_15.code, u_15.login_method, u_15.station_id, u_15.concept_id, u_15.roles, u_15.last_login, u_15.city, u_15.country, u_15.iso_code, u_15.province, u_15.change_password, u_15.function_id, u_15.department_id, u_15.seniority, u_15.next_of_kin_name, u_15.next_of_kin_phone, u_15.status_mask
  • Index Cond: (u_15.id = cia_d_8.user_id)
  • Filter: ((u_15.parent_id IS NULL) AND (u_15.parent_id IS NOT NULL) AND ((u_15.type)::text = 'CARRIER'::text))
  • Rows Removed by Filter: 1
291. 0.002 0.482 ↑ 1.0 1 1

Subquery Scan on *SELECT* 3_8 (cost=0.28..155.57 rows=1 width=7) (actual time=0.039..0.482 rows=1 loops=1)

  • Output: "*SELECT* 3_8".id, "*SELECT* 3_8".oaci
292. 0.005 0.480 ↑ 1.0 1 1

Nested Loop (cost=0.28..155.56 rows=1 width=7,811) (actual time=0.038..0.480 rows=1 loops=1)

  • Output: u_16.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, c_11.oaci, NULL::character varying(255), NULL::integer, NULL::character varying(3), NULL::character varying(2)
  • Inner Unique: true
293. 0.011 0.460 ↑ 1.0 1 1

Nested Loop (cost=0.00..142.57 rows=1 width=7) (actual time=0.018..0.460 rows=1 loops=1)

  • Output: cia_d_9.user_id, c_11.oaci
  • Join Filter: (cia_d_9.cia_id = c_11.id)
  • Rows Removed by Join Filter: 66
294. 0.441 0.441 ↑ 1.0 1 1

Seq Scan on public.companies c_11 (cost=0.00..140.76 rows=1 width=7) (actual time=0.005..0.441 rows=1 loops=1)

  • Output: c_11.id, c_11.sita, c_11.iata, c_11.oaci, c_11.name, c_11.active, c_11.remarks, c_11.created_at, c_11.user_insert_id, c_11.country
  • Filter: ((c_11.oaci)::text = 'ETD'::text)
  • Rows Removed by Filter: 3,920
295. 0.008 0.008 ↓ 1.9 67 1

Seq Scan on public.rel_cias cia_d_9 (cost=0.00..1.36 rows=36 width=8) (actual time=0.003..0.008 rows=67 loops=1)

  • Output: cia_d_9.id, cia_d_9.created_at, cia_d_9.user_insert_id, cia_d_9.remarks, cia_d_9.active, cia_d_9.user_id, cia_d_9.cia_id, cia_d_9.type, cia_d_9.status_mask
296. 0.015 0.015 ↑ 1.0 1 1

Index Scan using users_pkey on public.users u_16 (cost=0.28..6.64 rows=1 width=4) (actual time=0.015..0.015 rows=1 loops=1)

  • Output: u_16.id, u_16.created_at, u_16.user_insert_id, u_16.remarks, u_16.active, u_16.name, u_16.surname, u_16.login, u_16.password, u_16.password_change_date, u_16.ini_date, u_16.end_date, u_16.type, u_16.parent_id, u_16.card_id, u_16.card_type, u_16.address, u_16.telephone, u_16.email, u_16.station, u_16.post_code, u_16.code, u_16.login_method, u_16.station_id, u_16.concept_id, u_16.roles, u_16.last_login, u_16.city, u_16.country, u_16.iso_code, u_16.province, u_16.change_password, u_16.function_id, u_16.department_id, u_16.seniority, u_16.next_of_kin_name, u_16.next_of_kin_phone, u_16.status_mask
  • Index Cond: (u_16.id = cia_d_9.user_id)
  • Filter: ((u_16.parent_id IS NOT NULL) AND (u_16.parent_id IS NOT NULL) AND ((u_16.type)::text = 'CARRIER'::text))
297. 0.076 0.168 ↓ 1.0 466 1

Hash (cost=15.58..15.58 rows=458 width=4) (actual time=0.168..0.168 rows=466 loops=1)

  • Output: b_10.user_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 25kB
298. 0.092 0.092 ↓ 1.0 466 1

Seq Scan on public.users_billings b_10 (cost=0.00..15.58 rows=458 width=4) (actual time=0.008..0.092 rows=466 loops=1)

  • Output: b_10.user_id
299. 0.018 0.018 ↑ 1.0 1 3

Index Scan using users_pkey on public.users u2_16 (cost=0.28..1.17 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=3)

  • Output: u2_16.id, u2_16.created_at, u2_16.user_insert_id, u2_16.remarks, u2_16.active, u2_16.name, u2_16.surname, u2_16.login, u2_16.password, u2_16.password_change_date, u2_16.ini_date, u2_16.end_date, u2_16.type, u2_16.parent_id, u2_16.card_id, u2_16.card_type, u2_16.address, u2_16.telephone, u2_16.email, u2_16.station, u2_16.post_code, u2_16.code, u2_16.login_method, u2_16.station_id, u2_16.concept_id, u2_16.roles, u2_16.last_login, u2_16.city, u2_16.country, u2_16.iso_code, u2_16.province, u2_16.change_password, u2_16.function_id, u2_16.department_id, u2_16.seniority, u2_16.next_of_kin_name, u2_16.next_of_kin_phone, u2_16.status_mask
  • Index Cond: (u2_16.id = rel_u_10.user_id2)
  • Filter: ((u2_16.type)::text = 'CUSTOMER'::text)
300. 0.001 1.570 ↓ 0.0 0 1

Subquery Scan on *SELECT* 3_3 (cost=407.49..485.88 rows=1 width=7) (actual time=1.570..1.570 rows=0 loops=1)

  • Output: "*SELECT* 3_3".oaci, "*SELECT* 3_3".id
301. 0.000 1.569 ↓ 0.0 0 1

Nested Loop (cost=407.49..485.87 rows=1 width=20,803) (actual time=1.569..1.569 rows=0 loops=1)

  • Output: "*SELECT* 2_9".id, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, "*SELECT* 2_9".oaci, NULL::character varying, NULL::integer, NULL::integer, NULL::integer, NULL::character varying(255), NULL::integer, NULL::timestamp with time zone, NULL::integer, NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(2), NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::timestamp without time zone, NULL::integer, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::integer, NULL::integer, NULL::integer, NULL::integer
  • Join Filter: (u2_17.id = b_11.user_id)
302. 0.001 1.569 ↓ 0.0 0 1

Nested Loop (cost=407.49..464.57 rows=1 width=15) (actual time=1.569..1.569 rows=0 loops=1)

  • Output: "*SELECT* 2_9".id, "*SELECT* 2_9".oaci, rel_u_11.user_id2, u2_17.id
  • Inner Unique: true
303. 0.020 1.568 ↓ 0.0 0 1

Hash Join (cost=407.21..457.57 rows=6 width=11) (actual time=1.568..1.568 rows=0 loops=1)

  • Output: "*SELECT* 2_9".id, "*SELECT* 2_9".oaci, rel_u_11.user_id2
  • Hash Cond: (rel_u_11.user_id1 = "*SELECT* 2_9".parent_id)
304. 0.000 0.006 ↑ 983.0 1 1

Append (cost=0.00..46.62 rows=983 width=8) (actual time=0.006..0.006 rows=1 loops=1)

305. 0.006 0.006 ↑ 983.0 1 1

Seq Scan on public.rel_users rel_u_11 (cost=0.00..41.70 rows=983 width=8) (actual time=0.006..0.006 rows=1 loops=1)

  • Output: rel_u_11.user_id1, rel_u_11.user_id2
  • Filter: ((rel_u_11.type)::text = 'CUSTOMER'::text)
306. 0.001 1.542 ↓ 0.0 0 1

Hash (cost=407.19..407.19 rows=2 width=11) (actual time=1.542..1.542 rows=0 loops=1)

  • Output: "*SELECT* 2_9".id, "*SELECT* 2_9".oaci, "*SELECT* 2_9".parent_id
  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
307. 0.001 1.541 ↓ 0.0 0 1

Append (cost=49.36..407.19 rows=2 width=11) (actual time=1.541..1.541 rows=0 loops=1)

308. 0.000 0.475 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2_9 (cost=49.36..202.53 rows=1 width=11) (actual time=0.474..0.475 rows=0 loops=1)

  • Output: "*SELECT* 2_9".id, "*SELECT* 2_9".oaci, "*SELECT* 2_9".parent_id
  • Filter: (NOT (hashed SubPlan 2))
309. 0.003 0.474 ↓ 0.0 0 1

Nested Loop (cost=0.28..153.44 rows=1 width=7,811) (actual time=0.474..0.474 rows=0 loops=1)

  • Output: u_17.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), u_17.parent_id, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, c_12.oaci, NULL::character varying(255), NULL::integer, NULL::character varying(3), NULL::character varying(2)
  • Inner Unique: true
310. 0.010 0.461 ↑ 1.0 1 1

Nested Loop (cost=0.00..142.57 rows=1 width=7) (actual time=0.014..0.461 rows=1 loops=1)

  • Output: cia_d_10.user_id, c_12.oaci
  • Join Filter: (cia_d_10.cia_id = c_12.id)
  • Rows Removed by Join Filter: 66
311. 0.445 0.445 ↑ 1.0 1 1

Seq Scan on public.companies c_12 (cost=0.00..140.76 rows=1 width=7) (actual time=0.004..0.445 rows=1 loops=1)

  • Output: c_12.id, c_12.sita, c_12.iata, c_12.oaci, c_12.name, c_12.active, c_12.remarks, c_12.created_at, c_12.user_insert_id, c_12.country
  • Filter: ((c_12.oaci)::text = 'ETD'::text)
  • Rows Removed by Filter: 3,920
312. 0.006 0.006 ↓ 1.9 67 1

Seq Scan on public.rel_cias cia_d_10 (cost=0.00..1.36 rows=36 width=8) (actual time=0.002..0.006 rows=67 loops=1)

  • Output: cia_d_10.id, cia_d_10.created_at, cia_d_10.user_insert_id, cia_d_10.remarks, cia_d_10.active, cia_d_10.user_id, cia_d_10.cia_id, cia_d_10.type, cia_d_10.status_mask
313. 0.010 0.010 ↓ 0.0 0 1

Index Scan using users_pkey on public.users u_17 (cost=0.28..6.64 rows=1 width=8) (actual time=0.010..0.010 rows=0 loops=1)

  • Output: u_17.id, u_17.created_at, u_17.user_insert_id, u_17.remarks, u_17.active, u_17.name, u_17.surname, u_17.login, u_17.password, u_17.password_change_date, u_17.ini_date, u_17.end_date, u_17.type, u_17.parent_id, u_17.card_id, u_17.card_type, u_17.address, u_17.telephone, u_17.email, u_17.station, u_17.post_code, u_17.code, u_17.login_method, u_17.station_id, u_17.concept_id, u_17.roles, u_17.last_login, u_17.city, u_17.country, u_17.iso_code, u_17.province, u_17.change_password, u_17.function_id, u_17.department_id, u_17.seniority, u_17.next_of_kin_name, u_17.next_of_kin_phone, u_17.status_mask
  • Index Cond: (u_17.id = cia_d_10.user_id)
  • Filter: ((u_17.parent_id IS NULL) AND (u_17.parent_id IS NOT NULL) AND ((u_17.type)::text = 'CARRIER'::text))
  • Rows Removed by Filter: 1
314.          

SubPlan (for Subquery Scan)

315. 0.060 0.358 ↑ 1.1 923 1

Append (cost=0.00..46.62 rows=983 width=4) (actual time=0.008..0.358 rows=923 loops=1)

316. 0.298 0.298 ↑ 1.1 923 1

Seq Scan on public.rel_users rel_users_1 (cost=0.00..41.70 rows=983 width=4) (actual time=0.008..0.298 rows=923 loops=1)

  • Output: rel_users_1.user_id1
  • Filter: ((rel_users_1.type)::text = 'CUSTOMER'::text)
  • Rows Removed by Filter: 828
317. 0.597 1.065 ↓ 0.0 0 1

Subquery Scan on *SELECT* 3_9 (cost=49.36..204.65 rows=1 width=11) (actual time=1.065..1.065 rows=0 loops=1)

  • Output: "*SELECT* 3_9".id, "*SELECT* 3_9".oaci, "*SELECT* 3_9".parent_id
  • Filter: (NOT (hashed SubPlan 2))
  • Rows Removed by Filter: 1
318. 0.005 0.468 ↑ 1.0 1 1

Nested Loop (cost=0.28..155.56 rows=1 width=7,811) (actual time=0.031..0.468 rows=1 loops=1)

  • Output: u_18.id, NULL::integer, NULL::character varying(255), NULL::character varying(255), u_18.parent_id, NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::character varying(255), NULL::timestamp with time zone, NULL::character varying(255), NULL::character varying(2), NULL::integer, c_13.oaci, NULL::character varying(255), NULL::integer, NULL::character varying(3), NULL::character varying(2)
  • Inner Unique: true
319. 0.009 0.450 ↑ 1.0 1 1

Nested Loop (cost=0.00..142.57 rows=1 width=7) (actual time=0.013..0.450 rows=1 loops=1)

  • Output: cia_d_11.user_id, c_13.oaci
  • Join Filter: (cia_d_11.cia_id = c_13.id)
  • Rows Removed by Join Filter: 66
320. 0.434 0.434 ↑ 1.0 1 1

Seq Scan on public.companies c_13 (cost=0.00..140.76 rows=1 width=7) (actual time=0.004..0.434 rows=1 loops=1)

  • Output: c_13.id, c_13.sita, c_13.iata, c_13.oaci, c_13.name, c_13.active, c_13.remarks, c_13.created_at, c_13.user_insert_id, c_13.country
  • Filter: ((c_13.oaci)::text = 'ETD'::text)
  • Rows Removed by Filter: 3,920
321. 0.007 0.007 ↓ 1.9 67 1

Seq Scan on public.rel_cias cia_d_11 (cost=0.00..1.36 rows=36 width=8) (actual time=0.003..0.007 rows=67 loops=1)

  • Output: cia_d_11.id, cia_d_11.created_at, cia_d_11.user_insert_id, cia_d_11.remarks, cia_d_11.active, cia_d_11.user_id, cia_d_11.cia_id, cia_d_11.type, cia_d_11.status_mask
322. 0.013 0.013 ↑ 1.0 1 1

Index Scan using users_pkey on public.users u_18 (cost=0.28..6.64 rows=1 width=8) (actual time=0.013..0.013 rows=1 loops=1)

  • Output: u_18.id, u_18.created_at, u_18.user_insert_id, u_18.remarks, u_18.active, u_18.name, u_18.surname, u_18.login, u_18.password, u_18.password_change_date, u_18.ini_date, u_18.end_date, u_18.type, u_18.parent_id, u_18.card_id, u_18.card_type, u_18.address, u_18.telephone, u_18.email, u_18.station, u_18.post_code, u_18.code, u_18.login_method, u_18.station_id, u_18.concept_id, u_18.roles, u_18.last_login, u_18.city, u_18.country, u_18.iso_code, u_18.province, u_18.change_password, u_18.function_id, u_18.department_id, u_18.seniority, u_18.next_of_kin_name, u_18.next_of_kin_phone, u_18.status_mask
  • Index Cond: (u_18.id = cia_d_11.user_id)
  • Filter: ((u_18.parent_id IS NOT NULL) AND (u_18.parent_id IS NOT NULL) AND ((u_18.type)::text = 'CARRIER'::text))
323. 0.000 0.000 ↓ 0.0 0

Index Scan using users_pkey on public.users u2_17 (cost=0.28..1.17 rows=1 width=4) (never executed)

  • Output: u2_17.id, u2_17.created_at, u2_17.user_insert_id, u2_17.remarks, u2_17.active, u2_17.name, u2_17.surname, u2_17.login, u2_17.password, u2_17.password_change_date, u2_17.ini_date, u2_17.end_date, u2_17.type, u2_17.parent_id, u2_17.card_id, u2_17.card_type, u2_17.address, u2_17.telephone, u2_17.email, u2_17.station, u2_17.post_code, u2_17.code, u2_17.login_method, u2_17.station_id, u2_17.concept_id, u2_17.roles, u2_17.last_login, u2_17.city, u2_17.country, u2_17.iso_code, u2_17.province, u2_17.change_password, u2_17.function_id, u2_17.department_id, u2_17.seniority, u2_17.next_of_kin_name, u2_17.next_of_kin_phone, u2_17.status_mask
  • Index Cond: (u2_17.id = rel_u_11.user_id2)
  • Filter: ((u2_17.type)::text = 'CUSTOMER'::text)
324. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.users_billings b_11 (cost=0.00..15.58 rows=458 width=4) (never executed)

  • Output: b_11.id, b_11.user_id, b_11.credit_client, b_11.bank_account_number, b_11.cass_number, b_11.inherit, b_11.valid_until, b_11.vat, b_11.bank_sort_code, b_11.bank_name, b_11.currency_code, b_11.shed_currency, b_11.invoice_channel, b_11.legal_statement, b_11.customer_reference, b_11.payment_conditions, b_11.client_address, b_11.status_mask, b_11.address, b_11.post_code, b_11.city, b_11.country, b_11.iso_code, b_11.account_number, b_11.invoice_frequency, b_11.invoice_language, b_11.invoice_mode
325. 0.009 0.018 ↓ 0.0 0 9

Bitmap Heap Scan on public.generic_types v_imps (cost=0.65..4.69 rows=1 width=19) (actual time=0.002..0.002 rows=0 loops=9)

  • Output: v_imps.id, v_imps.name, v_imps.code, v_imps.type, v_imps.parent_id, v_imps.priority, v_imps.remarks, v_imps.created_at, v_imps.active, v_imps.user_insert_id
  • Recheck Cond: ((sr.imp_id = v_imps.id) OR (v_imps.id = imp.id))
  • Filter: ((((v_imps.type)::text = 'IMP'::text) AND (sr.imp_id = v_imps.id) AND ((sr.imp_type)::text = 'SINGLE'::text)) OR (v_imps.id = imp.id))
326. 0.009 0.009 ↓ 0.0 0 9

BitmapOr (cost=0.65..0.65 rows=2 width=0) (actual time=0.001..0.001 rows=0 loops=9)

327. 0.000 0.000 ↓ 0.0 0 9

Bitmap Index Scan on generic_types_pkey (cost=0.00..0.26 rows=1 width=0) (actual time=0.000..0.000 rows=0 loops=9)

  • Index Cond: (sr.imp_id = v_imps.id)
328. 0.000 0.000 ↓ 0.0 0 9

Bitmap Index Scan on generic_types_pkey (cost=0.00..0.27 rows=1 width=0) (actual time=0.000..0.000 rows=0 loops=9)

  • Index Cond: (v_imps.id = imp.id)
329. 0.018 0.054 ↑ 1.0 2 1

Sort (cost=1.15..1.15 rows=2 width=36) (actual time=0.054..0.054 rows=2 loops=1)

  • Output: srd.id, srd.active, srd.unit, srd.unit_each, srd.unit_min, srd.unit_max, srd.rate, srd.parent_id
  • Sort Key: srd.parent_id
  • Sort Method: quicksort Memory: 25kB
330. 0.036 0.036 ↑ 1.0 2 1

Seq Scan on public.services_rules_details srd (cost=0.00..1.14 rows=2 width=36) (actual time=0.035..0.036 rows=2 loops=1)

  • Output: srd.id, srd.active, srd.unit, srd.unit_each, srd.unit_min, srd.unit_max, srd.rate, srd.parent_id
  • Filter: ((srd.active = 1) OR (srd.active = 2))
  • Rows Removed by Filter: 7
331. 0.001 0.366 ↓ 0.0 0 1

Hash (cost=38.21..38.21 rows=1 width=8) (actual time=0.365..0.366 rows=0 loops=1)

  • Output: generic_types_3.id, s_1.id
  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
332. 0.001 0.365 ↓ 0.0 0 1

Nested Loop (cost=6.07..38.21 rows=1 width=8) (actual time=0.365..0.365 rows=0 loops=1)

  • Output: generic_types_3.id, s_1.id
  • Join Filter: ((s_1.iso_code)::text = (c.iso_code)::text)
333. 0.006 0.364 ↓ 0.0 0 1

Nested Loop (cost=6.07..31.46 rows=1 width=11) (actual time=0.364..0.364 rows=0 loops=1)

  • Output: generic_types_3.id, s_1.iso_code, s_1.id
  • Inner Unique: true
334. 0.112 0.318 ↓ 2.0 2 1

Hash Join (cost=5.79..30.54 rows=1 width=8) (actual time=0.082..0.318 rows=2 loops=1)

  • Output: generic_types_3.id, rel_3.element_id
  • Inner Unique: true
  • Hash Cond: (rel_3.group_id = generic_types_3.id)
335. 0.153 0.153 ↓ 1.1 1,019 1

Seq Scan on public.rel_groups rel_3 (cost=0.00..22.23 rows=960 width=8) (actual time=0.009..0.153 rows=1,019 loops=1)

  • Output: rel_3.id, rel_3.created_at, rel_3.user_insert_id, rel_3.remarks, rel_3.active, rel_3.group_id, rel_3.element_id, rel_3.type, rel_3.status_mask
  • Filter: (rel_3.active = 1)
  • Rows Removed by Filter: 16
336. 0.012 0.053 ↑ 1.0 1 1

Hash (cost=5.78..5.78 rows=1 width=4) (actual time=0.053..0.053 rows=1 loops=1)

  • Output: generic_types_3.id
  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
337. 0.041 0.041 ↑ 1.0 1 1

Seq Scan on public.generic_types generic_types_3 (cost=0.00..5.78 rows=1 width=4) (actual time=0.015..0.041 rows=1 loops=1)

  • Output: generic_types_3.id
  • Filter: ((generic_types_3.type)::text = 'GROUP_STATION'::text)
  • Rows Removed by Filter: 263
338. 0.040 0.040 ↓ 0.0 0 2

Index Scan using stations_pkey on public.stations s_1 (cost=0.28..0.60 rows=1 width=7) (actual time=0.020..0.020 rows=0 loops=2)

  • Output: s_1.id, s_1.name, s_1.type, s_1.timezone, s_1.remarks, s_1.created_at, s_1.active, s_1.user_insert_id, s_1.iata_code, s_1.oaci_code, s_1.address, s_1.post_code, s_1.country, s_1.system_active, s_1.iso_code
  • Index Cond: (s_1.id = rel_3.element_id)
  • Filter: (s_1.system_active = 1)
  • Rows Removed by Filter: 1
339. 0.000 0.000 ↓ 0.0 0

Seq Scan on public.countries c (cost=0.00..6.36 rows=31 width=3) (never executed)

  • Output: c.id, c.user_insert_id, c.created_at, c.active, c.country, c.iso_code, c."group
  • Filter: ((c."group")::text = 'OWN'::text)
340. 2.368 8.703 ↓ 1.0 4,040 9

Materialize (cost=9.05..166.83 rows=3,923 width=12) (actual time=0.017..0.967 rows=4,040 loops=9)

  • Output: s_2.iata_code, s_2.id, c_1."group
341. 1.294 6.335 ↓ 1.0 4,040 1

Hash Left Join (cost=9.05..147.21 rows=3,923 width=12) (actual time=0.148..6.335 rows=4,040 loops=1)

  • Output: s_2.iata_code, s_2.id, c_1."group
  • Hash Cond: ((s_2.iso_code)::text = (c_1.iso_code)::text)
342. 4.922 4.922 ↑ 1.0 3,062 1

Seq Scan on public.stations s_2 (cost=0.00..83.62 rows=3,062 width=10) (actual time=0.005..4.922 rows=3,062 loops=1)

  • Output: s_2.id, s_2.name, s_2.type, s_2.timezone, s_2.remarks, s_2.created_at, s_2.active, s_2.user_insert_id, s_2.iata_code, s_2.oaci_code, s_2.address, s_2.post_code, s_2.country, s_2.system_active, s_2.iso_code
343. 0.052 0.119 ↓ 1.0 270 1

Hash (cost=5.69..5.69 rows=269 width=8) (actual time=0.119..0.119 rows=270 loops=1)

  • Output: c_1.iso_code, c_1."group
  • Buckets: 1,024 Batches: 1 Memory Usage: 19kB
344. 0.067 0.067 ↓ 1.0 270 1

Seq Scan on public.countries c_1 (cost=0.00..5.69 rows=269 width=8) (actual time=0.014..0.067 rows=270 loops=1)

  • Output: c_1.iso_code, c_1."group
Planning time : 42.908 ms
Execution time : 107.095 ms