explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dJNJ

Settings
# exclusive inclusive rows x rows loops node
1. 548.724 98,533.062 ↓ 155.9 14,652 1

Result (cost=540,005.70..540,564.76 rows=94 width=136) (actual time=97,982.765..98,533.062 rows=14,652 loops=1)

2. 31.605 97,984.338 ↓ 155.9 14,652 1

Sort (cost=540,005.70..540,005.93 rows=94 width=124) (actual time=97,982.744..97,984.338 rows=14,652 loops=1)

  • Sort Key: ili.id DESC
  • Sort Method: quicksort Memory: 2456kB
3. 6.305 97,952.733 ↓ 155.9 14,652 1

Nested Loop (cost=11,770.62..540,002.61 rows=94 width=124) (actual time=392.221..97,952.733 rows=14,652 loops=1)

4. 0.012 0.012 ↑ 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.011..0.012 rows=1 loops=1)

  • Index Cond: (id = 14207)
5. 34.648 97,946.416 ↓ 155.9 14,652 1

Hash Left Join (cost=11,770.34..539,999.17 rows=94 width=120) (actual time=392.207..97,946.416 rows=14,652 loops=1)

  • Hash Cond: (ili.id = ilis.line_item_id)
6. 28.011 97,522.090 ↓ 155.9 14,652 1

Nested Loop (cost=2.65..528,228.41 rows=94 width=119) (actual time=1.660..97,522.090 rows=14,652 loops=1)

7. 87,791.962 97,347.559 ↓ 155.9 14,652 1

Hash Left Join (cost=2.36..528,199.09 rows=94 width=123) (actual time=1.620..97,347.559 rows=14,652 loops=1)

  • Hash Cond: (ili.time_zone_id = tz.id)
  • Filter: (((change_tz(ili.service_start_date, 'UTC'::character varying, tz.time_zone))::date = '2011-01-01'::date) AND ((change_tz(ili.service_end_date, 'UTC'::character varying, tz.time_zone))::date = '2011-01-31'::date))
  • Rows Removed by Filter: 4182753
8. 9,555.581 9,555.581 ↓ 1.1 4,197,405 1

Index Scan using fki_invoice_line_item_service_data_1 on invoice_line_item ili (cost=0.43..502,233.89 rows=3,757,776 width=111) (actual time=0.037..9,555.581 rows=4,197,405 loops=1)

  • Index Cond: (service_data_id = 14207)
  • Filter: (NOT deleted)
9. 0.008 0.016 ↑ 1.0 41 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
10. 0.008 0.008 ↑ 1.0 41 1

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

11. 146.520 146.520 ↑ 1.0 1 14,652

Index Scan using base_invoice_pkey on base_invoice bi (cost=0.29..0.31 rows=1 width=4) (actual time=0.010..0.010 rows=1 loops=14,652)

  • Index Cond: (id = ili.invoice_id)
  • Filter: (NOT deleted)
12. 197.198 389.678 ↓ 1.0 179,519 1

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

  • Buckets: 262144 Batches: 1 Memory Usage: 8361kB
13. 192.480 192.480 ↓ 1.0 179,519 1

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

  • Filter: (NOT deleted)
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)