explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QEi8

Settings
# exclusive inclusive rows x rows loops node
1. 101.599 6,910.366 ↓ 40.7 3,946 1

Result (cost=568,693.75..569,270.65 rows=97 width=136) (actual time=6,808.065..6,910.366 rows=3,946 loops=1)

2. 4.825 6,808.767 ↓ 40.7 3,946 1

Sort (cost=568,693.75..568,693.99 rows=97 width=124) (actual time=6,808.012..6,808.767 rows=3,946 loops=1)

  • Sort Key: ili.id DESC
  • Sort Method: quicksort Memory: 405kB
3. 1.184 6,803.942 ↓ 40.7 3,946 1

Nested Loop (cost=11,770.62..568,690.55 rows=97 width=124) (actual time=1,911.098..6,803.942 rows=3,946 loops=1)

4. 0.006 0.006 ↑ 1.0 1 1

Index Scan using pk_contract_service_data on contract_service_data csd (cost=0.29..2.50 rows=1 width=8) (actual time=0.005..0.006 rows=1 loops=1)

  • Index Cond: (id = 14207)
5. 1.438 6,802.752 ↓ 40.7 3,946 1

Hash Left Join (cost=11,770.34..568,687.07 rows=97 width=120) (actual time=1,911.089..6,802.752 rows=3,946 loops=1)

  • Hash Cond: (ili.time_zone_id = tz.id)
6. 19.617 6,801.289 ↓ 40.7 3,946 1

Hash Left Join (cost=11,768.42..568,684.89 rows=97 width=108) (actual time=1,911.035..6,801.289 rows=3,946 loops=1)

  • Hash Cond: (ili.id = ilis.line_item_id)
7. 1.963 6,422.036 ↓ 40.7 3,946 1

Nested Loop (cost=0.73..556,914.02 rows=97 width=107) (actual time=1,536.421..6,422.036 rows=3,946 loops=1)

8. 6,380.613 6,380.613 ↓ 40.7 3,946 1

Index Scan using fki_invoice_line_item_service_data_1 on invoice_line_item ili (cost=0.43..556,683.75 rows=97 width=111) (actual time=1,536.406..6,380.613 rows=3,946 loops=1)

  • Index Cond: (service_data_id = 14207)
  • Filter: ((NOT deleted) AND ((service_start_date)::date = '2011-01-01'::date) AND ((service_end_date)::date = '2011-01-31'::date))
  • Rows Removed by Filter: 4205959
9. 39.460 39.460 ↑ 1.0 1 3,946

Index Scan using invoice_id_indx on base_invoice bi (cost=0.29..2.37 rows=1 width=4) (actual time=0.010..0.010 rows=1 loops=3,946)

  • Index Cond: (id = ili.invoice_id)
  • Filter: (NOT deleted)
10. 183.016 359.636 ↓ 1.0 179,527 1

Hash (cost=9,540.64..9,540.64 rows=178,164 width=5) (actual time=359.636..359.636 rows=179,527 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 8361kB
11. 176.620 176.620 ↓ 1.0 179,527 1

Seq Scan on invoice_line_item_state ilis (cost=0.00..9,540.64 rows=178,164 width=5) (actual time=0.008..176.620 rows=179,527 loops=1)

  • Filter: (NOT deleted)
12. 0.012 0.025 ↑ 1.0 41 1

Hash (cost=1.41..1.41 rows=41 width=20) (actual time=0.025..0.025 rows=41 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
13. 0.013 0.013 ↑ 1.0 41 1

Seq Scan on time_zone tz (cost=0.00..1.41 rows=41 width=20) (actual time=0.006..0.013 rows=41 loops=1)

14.          

SubPlan (forResult)

15. 0.000 0.000 ↓ 0.0 0

Seq Scan on region (cost=0.00..1.90 rows=1 width=8) (never executed)

  • Filter: (id = ili.attribute_value)
16. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_delivery_country on delivery_country (cost=0.15..2.37 rows=1 width=12) (never executed)

  • Index Cond: (id = ili.attribute_value)
17. 0.000 0.000 ↓ 0.0 0

Seq Scan on department (cost=0.00..1.16 rows=1 width=9) (never executed)

  • Filter: (id = ili.attribute_value)