explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xJ6j

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 1,267,732.257 ↓ 0.0 0 1

Insert on bs_payms (cost=151,379.41..44,179,294.33 rows=1 width=254) (actual time=1,267,732.257..1,267,732.257 rows=0 loops=1)

2. 266,921.946 1,267,732.250 ↓ 0.0 0 1

Merge Anti Join (cost=151,379.41..44,179,294.33 rows=1 width=254) (actual time=1,267,732.250..1,267,732.250 rows=0 loops=1)

  • Merge Cond: (bs_payms_cl.service_id = bs_payms_1.service_id)
3. 990,453.140 990,453.140 ↑ 1.0 150,232,959 1

Index Scan using bs_payms_cl_by_service_id on bs_payms_cl (cost=0.57..27,124,591.75 rows=150,290,428 width=52) (actual time=42,875.252..990,453.140 rows=150,232,959 loops=1)

  • Filter: (clinic_id = 1)
  • Rows Removed by Filter: 405,843
4. 10,357.164 10,357.164 ↑ 1.1 4,907,319 1

Index Only Scan using bs_payms_clinic_service on bs_payms bs_payms_1 (cost=0.43..856,237.49 rows=5,162,442 width=8) (actual time=0.159..10,357.164 rows=4,907,319 loops=1)

  • Index Cond: (clinic_id = 1)
  • Heap Fetches: 1,519
Planning time : 38.761 ms
Execution time : 1,267,732.696 ms