explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gbyD

Settings
# exclusive inclusive rows x rows loops node
1. 708.443 2,197.355 ↑ 2.0 23,430 1

Bitmap Heap Scan on slips (cost=1,773.42..4,033,012.83 rows=46,895 width=186) (actual time=47.745..2,197.355 rows=23,430 loops=1)

  • Recheck Cond: (customer_id = 33)
  • Filter: (created_at > (CURRENT_DATE - 30))
  • Rows Removed by Filter: 71,096
  • Heap Blocks: exact=37,795
2. 36.252 36.252 ↑ 1.0 94,526 1

Bitmap Index Scan on index_slips_on_customer_id (cost=0.00..1,761.70 rows=95,103 width=0) (actual time=36.251..36.252 rows=94,526 loops=1)

  • Index Cond: (customer_id = 33)
3.          

SubPlan (for Bitmap Heap Scan)

4. 46.860 70.290 ↓ 0.0 0 23,430

Limit (cost=0.28..8.30 rows=1 width=25) (actual time=0.003..0.003 rows=0 loops=23,430)

5. 23.430 23.430 ↓ 0.0 0 23,430

Index Scan using job_sites_pkey on job_sites (cost=0.28..8.30 rows=1 width=25) (actual time=0.001..0.001 rows=0 loops=23,430)

  • Index Cond: (id = slips.job_site_id)
6. 46.860 281.160 ↑ 1.0 1 23,430

Limit (cost=0.42..8.44 rows=1 width=19) (actual time=0.012..0.012 rows=1 loops=23,430)

7. 234.300 234.300 ↑ 1.0 1 23,430

Index Only Scan using index_slip_line_items_on_slip_id_and_description on slip_line_items (cost=0.42..8.44 rows=1 width=19) (actual time=0.010..0.010 rows=1 loops=23,430)

  • Index Cond: (slip_id = slips.id)
  • Heap Fetches: 21,755
8. 23.430 515.460 ↑ 1.0 1 23,430

Limit (cost=0.72..33.50 rows=1 width=11) (actual time=0.022..0.022 rows=1 loops=23,430)

9. 80.280 492.030 ↑ 1.0 1 23,430

Nested Loop (cost=0.72..33.50 rows=1 width=11) (actual time=0.021..0.021 rows=1 loops=23,430)

10. 281.160 281.160 ↑ 3.0 1 23,430

Index Scan using index_customer_external_entity_slips_on_slip_id on customer_external_entity_slips slip_entities (cost=0.43..8.55 rows=3 width=8) (actual time=0.012..0.012 rows=1 loops=23,430)

  • Index Cond: (slip_id = slips.id)
11. 130.590 130.590 ↑ 1.0 1 21,765

Index Scan using customer_external_entities_pkey on customer_external_entities (cost=0.29..8.31 rows=1 width=19) (actual time=0.006..0.006 rows=1 loops=21,765)

  • Index Cond: (id = slip_entities.customer_external_entity_id)
  • Filter: (((external_type)::text = 'CustomerExternalEntity::ExternalTruck'::text) AND (customer_id = slips.customer_id))
  • Rows Removed by Filter: 0
12. 0.000 585.750 ↑ 1.0 1 23,430

Limit (cost=0.72..33.74 rows=1 width=11) (actual time=0.025..0.025 rows=1 loops=23,430)

13. 53.840 585.750 ↑ 1.0 1 23,430

Nested Loop (cost=0.72..33.74 rows=1 width=11) (actual time=0.025..0.025 rows=1 loops=23,430)

14. 187.440 187.440 ↑ 1.5 2 23,430

Index Scan using index_customer_external_entity_slips_on_slip_id on customer_external_entity_slips slip_entities_1 (cost=0.43..8.55 rows=3 width=8) (actual time=0.008..0.008 rows=2 loops=23,430)

  • Index Cond: (slip_id = slips.id)
15. 344.470 344.470 ↓ 0.0 0 49,210

Index Scan using customer_external_entities_pkey on customer_external_entities customer_external_entities_1 (cost=0.29..8.31 rows=1 width=19) (actual time=0.007..0.007 rows=0 loops=49,210)

  • Index Cond: (id = slip_entities_1.customer_external_entity_id)
  • Filter: (((external_type)::text = 'CustomerExternalEntity::ExternalFleet'::text) AND (customer_id = slips.customer_id))
  • Rows Removed by Filter: 1
Planning time : 1.444 ms
Execution time : 2,203.568 ms