explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ugnk

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 9,586.853 ↑ 1.0 1 1

Limit (cost=2.43..793.13 rows=1 width=2,320) (actual time=9,586.853..9,586.853 rows=1 loops=1)

2. 9,363.788 9,586.852 ↑ 1.0 1 1

GroupAggregate (cost=2.43..793.13 rows=1 width=2,320) (actual time=9,586.852..9,586.852 rows=1 loops=1)

3. 81.975 223.064 ↓ 3,658.2 380,452 1

Nested Loop Left Join (cost=2.43..791.80 rows=104 width=2,320) (actual time=0.286..223.064 rows=380,452 loops=1)

  • Join Filter: (clients.id = appointment_client_links.client_id)
4. 1.332 85.701 ↓ 113.5 454 1

Nested Loop Left Join (cost=1.14..92.72 rows=4 width=1,361) (actual time=0.242..85.701 rows=454 loops=1)

  • Join Filter: (sp2.client_id = clients.id)
5. 0.571 83.461 ↓ 454.0 454 1

Nested Loop Left Join (cost=0.72..74.80 rows=1 width=694) (actual time=0.236..83.461 rows=454 loops=1)

  • Join Filter: (clients.id = sl.client_id)
6. 0.221 1.624 ↓ 454.0 454 1

Nested Loop Left Join (cost=0.72..16.77 rows=1 width=694) (actual time=0.027..1.624 rows=454 loops=1)

  • Join Filter: (clients.id = sub_clients.client_id)
7. 0.014 0.014 ↑ 1.0 1 1

Index Scan using clients_pkey on clients (cost=0.43..8.45 rows=1 width=467) (actual time=0.013..0.014 rows=1 loops=1)

  • Index Cond: (id = 1700736)
  • Filter: ((NOT demo_entity) AND (NOT deleted))
8. 1.389 1.389 ↓ 454.0 454 1

Index Scan using sub_clients_client_id_idx on sub_clients (cost=0.29..8.31 rows=1 width=231) (actual time=0.012..1.389 rows=454 loops=1)

  • Index Cond: (client_id = 1700736)
9. 81.266 81.266 ↓ 0.0 0 454

Seq Scan on service_packs_links sl (cost=0.00..58.02 rows=1 width=4) (actual time=0.179..0.179 rows=0 loops=454)

  • Filter: (client_id = 1700736)
  • Rows Removed by Filter: 2640
10. 0.908 0.908 ↓ 0.0 0 454

Index Scan using service_packs_client_id_idx on service_packs sp2 (cost=0.42..17.86 rows=4 width=671) (actual time=0.002..0.002 rows=0 loops=454)

  • Index Cond: (client_id = 1700736)
  • Filter: (NOT archived)
11. 23.753 55.388 ↓ 32.2 838 454

Materialize (cost=1.29..697.59 rows=26 width=963) (actual time=0.000..0.122 rows=838 loops=454)

12. 0.584 31.635 ↓ 32.2 838 1

Nested Loop Left Join (cost=1.29..697.46 rows=26 width=963) (actual time=0.042..31.635 rows=838 loops=1)

13. 0.473 23.571 ↓ 28.8 748 1

Nested Loop Left Join (cost=0.86..283.55 rows=26 width=835) (actual time=0.034..23.571 rows=748 loops=1)

14. 7.390 7.390 ↓ 28.8 748 1

Index Scan using appointment_client_links_client_id_idx on appointment_client_links (cost=0.43..63.39 rows=26 width=12) (actual time=0.025..7.390 rows=748 loops=1)

  • Index Cond: (client_id = 1700736)
15. 15.708 15.708 ↑ 1.0 1 748

Index Scan using appointments_pkey on appointments (cost=0.43..8.46 rows=1 width=831) (actual time=0.021..0.021 rows=1 loops=748)

  • Index Cond: (appointment_client_links.appointment_id = id)
  • Filter: ((NOT is_sale) AND ((status)::text = ANY ('{scheduled,sms_confirmation_sent,cancelled_by_sms,confirmed,in_progress,finished,cancelled,missed}'::text[])))
  • Rows Removed by Filter: 0
16. 7.480 7.480 ↑ 6.0 1 748

Index Scan using appointment_client_service_cost_acl_id on appointment_client_service_cost acsc (cost=0.43..15.86 rows=6 width=136) (actual time=0.010..0.010 rows=1 loops=748)

  • Index Cond: (appointment_client_link_id = appointment_client_links.id)