explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bp9Q : wer

Settings
# exclusive inclusive rows x rows loops node
1. 2.793 23.105 ↓ 17.0 817 1

Sort (cost=523.02..523.14 rows=48 width=1,050) (actual time=22.884..23.105 rows=817 loops=1)

  • Sort Key: cs.appointment_date
  • Sort Method: quicksort Memory: 878kB
2. 1.419 20.312 ↓ 17.0 817 1

Nested Loop Left Join (cost=65.49..521.68 rows=48 width=1,050) (actual time=1.753..20.312 rows=817 loops=1)

  • Filter: ((cs.object_id IS NULL) OR ((mo.id IS NOT NULL) AND (mo.mo_contract_id = cntr.id)))
  • Rows Removed by Filter: 2
3. 1.515 15.617 ↓ 2.6 819 1

Hash Join (cost=65.20..377.58 rows=317 width=906) (actual time=1.731..15.617 rows=819 loops=1)

  • Hash Cond: (cs.service_id = s.id)
4. 5.849 13.992 ↓ 3.5 2,903 1

Hash Join (cost=60.26..366.40 rows=818 width=734) (actual time=1.268..13.992 rows=2,903 loops=1)

  • Hash Cond: (cs.contract_id = cntr.id)
5. 6.900 6.900 ↓ 1.1 5,656 1

Seq Scan on billing_customer_service cs (cost=0.00..278.70 rows=5,136 width=140) (actual time=0.012..6.900 rows=5,656 loops=1)

  • Filter: ((status_cs = 'A'::bpchar) AND (_status = 'A'::bpchar) AND ((now() < delete_date) OR (delete_date IS NULL)) AND (appointment_date <= now()))
  • Rows Removed by Filter: 1072
6. 0.075 1.243 ↓ 1.5 152 1

Hash (cost=58.96..58.96 rows=104 width=594) (actual time=1.243..1.243 rows=152 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 86kB
7. 1.168 1.168 ↓ 1.5 152 1

Seq Scan on uzgps_contract cntr (cost=0.00..58.96 rows=104 width=594) (actual time=0.022..1.168 rows=152 loops=1)

  • Filter: (((c_status)::text = 'A'::text) AND ((status_id = 2) OR ((status_id = 3) AND (date_trunc('month'::text, locked_date) = date_trunc('month'::text, now())))))
  • Rows Removed by Filter: 502
8. 0.020 0.110 ↓ 1.1 41 1

Hash (cost=4.47..4.47 rows=38 width=172) (actual time=0.109..0.110 rows=41 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
9. 0.090 0.090 ↓ 1.1 41 1

Seq Scan on billing_service s (cost=0.00..4.47 rows=38 width=172) (actual time=0.017..0.090 rows=41 loops=1)

  • Filter: ((_status = 'A'::bpchar) AND (service_type_id = 5))
  • Rows Removed by Filter: 57
10. 3.276 3.276 ↑ 1.0 1 819

Index Scan using uzgps_mobject_pkey on uzgps_mobject mo (cost=0.29..0.44 rows=1 width=136) (actual time=0.004..0.004 rows=1 loops=819)

  • Index Cond: (id = cs.object_id)
  • Filter: ((mo_status)::text = 'A'::text)
  • Rows Removed by Filter: 0
Planning time : 1.912 ms
Execution time : 25.168 ms