explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nhHl

Settings
# exclusive inclusive rows x rows loops node
1. 0.087 0.716 ↓ 5.0 5 1

Nested Loop Left Join (cost=5.24..29.18 rows=1 width=775) (actual time=0.245..0.716 rows=5 loops=1)

2.          

Initplan (for Nested Loop Left Join)

3. 0.005 0.005 ↑ 1.0 1 1

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

  • Filter: (client_alias_id = 25)
  • Rows Removed by Filter: 40
4. 0.006 0.539 ↓ 5.0 5 1

Nested Loop Left Join (cost=2.23..26.03 rows=1 width=1,896) (actual time=0.182..0.539 rows=5 loops=1)

5. 0.006 0.413 ↓ 5.0 5 1

Nested Loop Left Join (cost=2.23..11.28 rows=1 width=1,864) (actual time=0.170..0.413 rows=5 loops=1)

6. 0.035 0.397 ↓ 5.0 5 1

Nested Loop Left Join (cost=1.96..10.79 rows=1 width=1,827) (actual time=0.158..0.397 rows=5 loops=1)

  • Filter: ((con.search ~~ '%tes%'::text) OR (ci.search ~~ '%tes%'::text))
  • Rows Removed by Filter: 69
7. 0.078 0.288 ↓ 24.7 74 1

Nested Loop (cost=1.68..9.01 rows=3 width=1,819) (actual time=0.066..0.288 rows=74 loops=1)

8. 0.038 0.136 ↓ 24.7 74 1

Hash Join (cost=1.41..6.46 rows=3 width=1,459) (actual time=0.051..0.136 rows=74 loops=1)

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

Seq Scan on patients p (cost=0.00..4.75 rows=100 width=1,463) (actual time=0.022..0.081 rows=101 loops=1)

  • Filter: (NOT deleted)
  • Rows Removed by Filter: 74
10. 0.004 0.017 ↓ 4.0 4 1

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

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

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

  • Filter: (group_id = $109)
  • Rows Removed by Filter: 37
12. 0.074 0.074 ↑ 1.0 1 74

Index Scan using contacts_pkey on contacts con (cost=0.27..0.85 rows=1 width=364) (actual time=0.001..0.001 rows=1 loops=74)

  • Index Cond: (contact_id = p.contact_id)
13. 0.074 0.074 ↑ 1.0 1 74

Index Scan using contacts_info_pkey on contacts_info ci (cost=0.28..0.58 rows=1 width=59) (actual time=0.001..0.001 rows=1 loops=74)

  • Index Cond: (contact_info_id = con.contact_info_id)
14. 0.010 0.010 ↓ 0.0 0 5

Index Scan using addresses_pkey on addresses adrs (cost=0.27..0.48 rows=1 width=41) (actual time=0.002..0.002 rows=0 loops=5)

  • Index Cond: (con.address_id = address_id)
15. 0.000 0.120 ↓ 0.0 0 5

Subquery Scan on t (cost=0.00..14.74 rows=1 width=32) (actual time=0.024..0.024 rows=0 loops=5)

  • Filter: (t.row_num = 1)
16. 0.005 0.120 ↓ 0.0 0 5

WindowAgg (cost=0.00..14.73 rows=1 width=112) (actual time=0.024..0.024 rows=0 loops=5)

17. 0.001 0.115 ↓ 0.0 0 5

Nested Loop (cost=0.00..14.71 rows=1 width=104) (actual time=0.023..0.023 rows=0 loops=5)

  • Join Filter: (cr.contact_id = c.contact_id)
  • Rows Removed by Join Filter: 1
18. 0.020 0.020 ↓ 0.0 0 5

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

  • 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.094 0.094 ↑ 1.0 2 2

Seq Scan on contacts c (cost=0.00..13.12 rows=2 width=36) (actual time=0.002..0.047 rows=2 loops=2)

  • Filter: ((subtype)::text = 'MUTUALITY_BE'::text)
  • Rows Removed by Filter: 248
20. 0.005 0.025 ↑ 1.0 1 5

Aggregate (cost=1.61..1.62 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=5)

21. 0.020 0.020 ↓ 0.0 0 5

Seq Scan on patients_identity_documents pidt (cost=0.00..1.60 rows=2 width=36) (actual time=0.004..0.004 rows=0 loops=5)

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

SubPlan (for Nested Loop Left Join)

23. 0.050 0.055 ↑ 1.0 1 5

Result (cost=0.06..0.09 rows=1 width=32) (actual time=0.011..0.011 rows=1 loops=5)

24.          

Initplan (for Result)

25. 0.005 0.005 ↑ 1.0 1 5

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

26. 0.000 0.000 ↑ 1.0 1 5

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

27. 0.000 0.000 ↑ 1.0 1 5

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

28. 0.000 0.000 ↑ 1.0 1 5

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

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 5

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

32. 0.005 0.005 ↑ 1.0 1 5

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

Planning time : 2.003 ms
Execution time : 1.092 ms