explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Mf9H

Settings
# exclusive inclusive rows x rows loops node
1. 1.827 211,136.641 ↑ 1.0 100 1

Limit (cost=34.65..3,566.76 rows=100 width=1,453) (actual time=2,179.424..211,136.641 rows=100 loops=1)

2. 3.938 211,134.814 ↑ 156.1 100 1

Nested Loop Left Join (cost=34.65..551,467.26 rows=15,612 width=1,453) (actual time=2,179.407..211,134.814 rows=100 loops=1)

3. 4.509 211,097.876 ↑ 156.1 100 1

Nested Loop Left Join (cost=17.89..289,263.72 rows=15,612 width=1,433) (actual time=2,179.037..211,097.876 rows=100 loops=1)

4. 8,772.720 211,041.767 ↑ 156.1 100 1

Nested Loop (cost=0.99..24,874.50 rows=15,612 width=1,425) (actual time=2,178.360..211,041.767 rows=100 loops=1)

  • Join Filter: ((endorsement_invoice.endorsement_id = endorsement.id) AND (endorsement_invoice.due_to_endorsement_id = endorsement.due_to_endorsement_id))
  • Rows Removed by Join Filter: 994,477
5. 15,727.969 193,095.302 ↓ 105.0 105 1

Nested Loop (cost=0.99..24,062.69 rows=1 width=936) (actual time=2,074.278..193,095.302 rows=105 loops=1)

  • Join Filter: ((endorsement_invoice.endorsement_id = endorsement_agency.endorsement_id) AND (endorsement_invoice.due_to_endorsement_id = endorsement_agency.due_to_endorsement_id))
  • Rows Removed by Join Filter: 1,778,265
6. 15,828.012 161,867.653 ↓ 105.0 105 1

Nested Loop (cost=0.99..23,416.56 rows=1 width=878) (actual time=1,965.166..161,867.653 rows=105 loops=1)

  • Join Filter: ((endorsement_invoice.endorsement_id = endorsement_insured.endorsement_id) AND (endorsement_invoice.due_to_endorsement_id = endorsement_insured.due_to_endorsement_id))
  • Rows Removed by Join Filter: 1,778,265
7. 8,286.220 130,559.491 ↓ 105.0 105 1

Nested Loop (cost=0.99..22,670.44 rows=1 width=782) (actual time=1,863.725..130,559.491 rows=105 loops=1)

  • Join Filter: (endorsement_invoice.id = endorsement_invoice_line_item.invoice_id)
  • Rows Removed by Join Filter: 931,761
8. 3.878 6.861 ↓ 105.0 105 1

Merge Join (cost=0.57..3,131.41 rows=1 width=622) (actual time=0.062..6.861 rows=105 loops=1)

  • Merge Cond: ((endorsement_invoice.endorsement_id = endorsement_carrier.endorsement_id) AND (endorsement_invoice.due_to_endorsement_id = endorsement_carrier.due_to_endorsement_id))
9. 1.362 1.362 ↑ 161.5 105 1

Index Scan using endorsement_invoice_endorsement_id_due_to_endorsement_id_idx on endorsement_invoice (cost=0.29..1,454.44 rows=16,956 width=55) (actual time=0.019..1.362 rows=105 loops=1)

10. 1.621 1.621 ↑ 160.4 106 1

Index Scan using endorsement_carrier_endorsement_id_due_to_endorsement_id_idx on endorsement_carrier (cost=0.29..1,507.15 rows=17,005 width=567) (actual time=0.015..1.621 rows=106 loops=1)

11. 70,049.595 122,266.410 ↑ 1.9 8,875 105

GroupAggregate (cost=0.42..19,166.88 rows=16,540 width=192) (actual time=0.176..1,164.442 rows=8,875 loops=105)

  • Group Key: endorsement_invoice_line_item.invoice_id
12. 52,216.815 52,216.815 ↑ 1.9 51,641 105

Index Scan using endorsement_invoice_line_item_invoice_id_idx on endorsement_invoice_line_item (cost=0.42..8,066.82 rows=98,997 width=39) (actual time=0.019..497.303 rows=51,641 loops=105)

13. 15,480.150 15,480.150 ↑ 1.0 16,937 105

Seq Scan on endorsement_insured (cost=0.00..491.05 rows=17,005 width=96) (actual time=0.012..147.430 rows=16,937 loops=105)

14. 15,499.680 15,499.680 ↑ 1.0 16,937 105

Seq Scan on endorsement_agency (cost=0.00..391.05 rows=17,005 width=58) (actual time=0.011..147.616 rows=16,937 loops=105)

15. 9,173.745 9,173.745 ↑ 1.7 9,472 105

Seq Scan on endorsement (cost=0.00..571.05 rows=16,051 width=617) (actual time=0.014..87.369 rows=9,472 loops=105)

  • Filter: (NOT admitted)
  • Rows Removed by Filter: 491
16. 8.000 51.600 ↑ 1.0 1 100

Aggregate (cost=16.90..16.92 rows=1 width=8) (actual time=0.509..0.516 rows=1 loops=100)

17. 21.980 43.600 ↓ 5.0 5 100

Nested Loop (cost=0.83..16.89 rows=1 width=13) (actual time=0.078..0.436 rows=5 loops=100)

18. 8.200 8.200 ↓ 6.0 6 100

Index Scan using endorsement_coverage_endorsement_id_due_to_endorsement_id_idx on endorsement_coverage (cost=0.42..8.44 rows=1 width=53) (actual time=0.026..0.082 rows=6 loops=100)

  • Index Cond: ((endorsement_id = endorsement.id) AND (due_to_endorsement_id = endorsement.due_to_endorsement_id))
19. 13.420 13.420 ↑ 1.0 1 610

Index Scan using endorsement_coverage_limit_coverage_id_endorsement_id_due_t_idx on endorsement_coverage_limit (cost=0.42..8.44 rows=1 width=56) (actual time=0.014..0.022 rows=1 loops=610)

  • Index Cond: ((coverage_id = endorsement_coverage.id) AND (endorsement_id = endorsement.id) AND (due_to_endorsement_id = endorsement.due_to_endorsement_id))
20. 3.500 33.000 ↑ 1.0 1 100

Aggregate (cost=16.76..16.77 rows=1 width=8) (actual time=0.322..0.330 rows=1 loops=100)

21. 14.260 29.500 ↑ 1.0 1 100

Nested Loop (cost=0.70..16.75 rows=1 width=8) (actual time=0.151..0.295 rows=1 loops=100)

22. 6.700 6.700 ↓ 6.0 6 100

Index Scan using endorsement_coverage_endorsement_id_due_to_endorsement_id_idx on endorsement_coverage endorsement_coverage_1 (cost=0.42..8.44 rows=1 width=48) (actual time=0.013..0.067 rows=6 loops=100)

  • Index Cond: ((endorsement_id = endorsement.id) AND (due_to_endorsement_id = endorsement.due_to_endorsement_id))
23. 8.540 8.540 ↓ 0.0 0 610

Index Scan using endorsement_coverage_deductib_coverage_id_endorsement_id_du_idx on endorsement_coverage_deductible (cost=0.29..8.31 rows=1 width=56) (actual time=0.013..0.014 rows=0 loops=610)

  • Index Cond: ((coverage_id = endorsement_coverage_1.id) AND (endorsement_id = endorsement.id) AND (due_to_endorsement_id = endorsement.due_to_endorsement_id))
Planning time : 5.487 ms
Execution time : 211,138.193 ms