explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JrNC

Settings
# exclusive inclusive rows x rows loops node
1. 0.312 1.618 ↓ 19.0 19 1

Nested Loop Left Join (cost=4.86..31.17 rows=1 width=775) (actual time=0.156..1.618 rows=19 loops=1)

2.          

Initplan (for Nested Loop Left Join)

3. 0.004 0.004 ↑ 1.0 1 1

Seq Scan on groups_clients groups_clients_1 (cost=0.00..1.40 rows=1 width=4) (actual time=0.002..0.004 rows=1 loops=1)

  • Filter: (client_alias_id = 25)
  • Rows Removed by Filter: 31
4. 0.017 1.017 ↓ 19.0 19 1

Nested Loop Left Join (cost=2.11..28.27 rows=1 width=2,039) (actual time=0.095..1.017 rows=19 loops=1)

5. 0.016 0.791 ↓ 19.0 19 1

Nested Loop Left Join (cost=2.11..14.96 rows=1 width=2,007) (actual time=0.084..0.791 rows=19 loops=1)

6. 0.045 0.756 ↓ 19.0 19 1

Nested Loop Left Join (cost=1.83..14.52 rows=1 width=1,971) (actual time=0.078..0.756 rows=19 loops=1)

  • Filter: ((con.search ~~ '%tes%'::text) OR (ci.search ~~ '%tes%'::text))
  • Rows Removed by Filter: 192
7. 0.108 0.500 ↓ 26.4 211 1

Nested Loop (cost=1.56..10.21 rows=8 width=1,963) (actual time=0.040..0.500 rows=211 loops=1)

8. 0.127 0.181 ↓ 26.4 211 1

Hash Join (cost=1.41..7.56 rows=8 width=1,463) (actual time=0.029..0.181 rows=211 loops=1)

  • Hash Cond: (p.created_alias_id = groups_clients.client_alias_id)
9. 0.041 0.041 ↓ 1.0 243 1

Seq Scan on patients p (cost=0.00..5.43 rows=241 width=1,467) (actual time=0.010..0.041 rows=243 loops=1)

  • Filter: (NOT deleted)
  • Rows Removed by Filter: 2
10. 0.002 0.013 ↓ 4.0 4 1

Hash (cost=1.40..1.40 rows=1 width=4) (actual time=0.013..0.013 rows=4 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
11. 0.011 0.011 ↓ 4.0 4 1

Seq Scan on groups_clients (cost=0.00..1.40 rows=1 width=4) (actual time=0.009..0.011 rows=4 loops=1)

  • Filter: (group_id = $109)
  • Rows Removed by Filter: 28
12. 0.211 0.211 ↑ 1.0 1 211

Index Scan using contacts_pkey on contacts con (cost=0.15..0.33 rows=1 width=504) (actual time=0.001..0.001 rows=1 loops=211)

  • Index Cond: (contact_id = p.contact_id)
13. 0.211 0.211 ↑ 1.0 1 211

Index Scan using contacts_info_pkey on contacts_info ci (cost=0.28..0.52 rows=1 width=56) (actual time=0.001..0.001 rows=1 loops=211)

  • Index Cond: (contact_info_id = con.contact_info_id)
14. 0.019 0.019 ↑ 1.0 1 19

Index Scan using addresses_pkey on addresses adrs (cost=0.27..0.44 rows=1 width=40) (actual time=0.001..0.001 rows=1 loops=19)

  • Index Cond: (con.address_id = address_id)
15. 0.000 0.209 ↓ 0.0 0 19

Subquery Scan on t (cost=0.00..13.30 rows=1 width=32) (actual time=0.011..0.011 rows=0 loops=19)

  • Filter: (t.row_num = 1)
16. 0.019 0.209 ↓ 0.0 0 19

WindowAgg (cost=0.00..13.29 rows=1 width=112) (actual time=0.011..0.011 rows=0 loops=19)

17. 0.001 0.190 ↓ 0.0 0 19

Nested Loop (cost=0.00..13.28 rows=1 width=104) (actual time=0.010..0.010 rows=0 loops=19)

  • Join Filter: (cr.contact_id = c.contact_id)
  • Rows Removed by Join Filter: 0
18. 0.057 0.057 ↓ 0.0 0 19

Seq Scan on contacts_relationships cr (cost=0.00..1.56 rows=1 width=72) (actual time=0.003..0.003 rows=0 loops=19)

  • Filter: ((patient_id = p.patient_id) AND (now() >= COALESCE(date_from, '1900-01-01 00:00:00'::timestamp without time zone)) AND (now() <= COALESCE(date_to, '2900-01-01 00:00:00'::timestamp without time zone)))
  • Rows Removed by Filter: 25
19. 0.132 0.132 ↑ 1.0 2 3

Seq Scan on contacts c (cost=0.00..11.69 rows=2 width=36) (actual time=0.020..0.044 rows=2 loops=3)

  • Filter: ((subtype)::text = 'MUTUALITY_BE'::text)
  • Rows Removed by Filter: 237
20. 0.019 0.076 ↑ 1.0 1 19

Aggregate (cost=1.35..1.36 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=19)

21. 0.057 0.057 ↓ 0.0 0 19

Seq Scan on patients_identity_documents pidt (cost=0.00..1.35 rows=1 width=548) (actual time=0.003..0.003 rows=0 loops=19)

  • Filter: (patient_id = p.patient_id)
  • Rows Removed by Filter: 38
22.          

SubPlan (for Nested Loop Left Join)

23. 0.190 0.190 ↑ 1.0 1 19

Result (cost=0.06..0.09 rows=1 width=32) (actual time=0.010..0.010 rows=1 loops=19)

24.          

Initplan (for Result)

25. 0.000 0.000 ↑ 1.0 1 19

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.000..0.000 rows=1 loops=19)

26. 0.000 0.000 ↑ 1.0 1 19

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.000..0.000 rows=1 loops=19)

27. 0.000 0.000 ↑ 1.0 1 19

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.000..0.000 rows=1 loops=19)

28. 0.000 0.000 ↑ 1.0 1 19

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.000..0.000 rows=1 loops=19)

29. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.01 rows=1 width=32) (never executed)

30. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.01 rows=1 width=32) (never executed)

31. 0.000 0.000 ↑ 1.0 1 19

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.000..0.000 rows=1 loops=19)

32. 0.019 0.019 ↑ 1.0 1 19

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.001..0.001 rows=1 loops=19)

Planning time : 1.638 ms
Execution time : 1.884 ms