explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ASEG

Settings
# exclusive inclusive rows x rows loops node
1. 23.826 63.430 ↓ 3.6 68,675 1

Hash Join (cost=1,931.57..25,980.26 rows=19,058 width=120) (actual time=7.221..63.430 rows=68,675 loops=1)

  • Hash Cond: (company_product_mappings.erp_product_id = erp_products.id)
2. 15.803 38.240 ↓ 2.0 68,675 1

Hash Join (cost=1,842.76..25,800.51 rows=34,584 width=8) (actual time=5.795..38.240 rows=68,675 loops=1)

  • Hash Cond: (sales_order_line_items.company_product_mapping_id = company_product_mappings.id)
3. 17.047 21.824 ↓ 1.1 68,675 1

Bitmap Heap Scan on sales_order_line_items (cost=1,772.88..25,565.55 rows=62,781 width=8) (actual time=5.152..21.824 rows=68,675 loops=1)

  • Recheck Cond: ((company_id = 5) AND (order_created_at >= '2018-11-05'::date) AND (order_created_at <= '2019-11-04'::date))
  • Heap Blocks: exact=2978
4. 4.777 4.777 ↓ 1.1 68,675 1

Bitmap Index Scan on company_order_created_at_idx (cost=0.00..1,757.18 rows=62,781 width=0) (actual time=4.777..4.777 rows=68,675 loops=1)

  • Index Cond: ((company_id = 5) AND (order_created_at >= '2018-11-05'::date) AND (order_created_at <= '2019-11-04'::date))
5. 0.255 0.613 ↑ 1.2 1,148 1

Hash (cost=53.23..53.23 rows=1,332 width=16) (actual time=0.613..0.613 rows=1,148 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 70kB
6. 0.358 0.358 ↑ 1.2 1,148 1

Seq Scan on company_product_mappings (cost=0.00..53.23 rows=1,332 width=16) (actual time=0.098..0.358 rows=1,148 loops=1)

  • Filter: (company_id = 5)
  • Rows Removed by Filter: 1138
7. 0.735 1.364 ↑ 1.1 1,148 1

Hash (cost=73.25..73.25 rows=1,245 width=120) (actual time=1.364..1.364 rows=1,148 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 184kB
8. 0.629 0.629 ↑ 1.1 1,148 1

Seq Scan on erp_products (cost=0.00..73.25 rows=1,245 width=120) (actual time=0.174..0.629 rows=1,148 loops=1)

  • Filter: (company_id = 5)
  • Rows Removed by Filter: 1138