explain.depesz.com

PostgreSQL's explain analyze made readable

Result: w5Ag

Settings
# exclusive inclusive rows x rows loops node
1. 6.280 348.362 ↓ 12.0 12 1

GroupAggregate (cost=337.91..337.94 rows=1 width=120) (actual time=341.216..348.362 rows=12 loops=1)

  • Group Key: year, month, orgunit_name, orgunit_id, product_id, product_name
2. 9.695 342.082 ↓ 18,252.0 18,252 1

Sort (cost=337.91..337.91 rows=1 width=120) (actual time=340.601..342.082 rows=18,252 loops=1)

  • Sort Key: year, month, orgunit_name, product_name
  • Sort Method: quicksort Memory: 3152kB
3. 293.482 332.387 ↓ 18,252.0 18,252 1

Bitmap Heap Scan on orgunit_customer_product_view ocpv (cost=9.89..337.90 rows=1 width=120) (actual time=47.137..332.387 rows=18,252 loops=1)

  • Recheck Cond: (((orgunit_id = 10) AND (year = 2019) AND (month <= 10)) OR ((orgunit_id = 10) AND (year = 2018) AND (month >= 11)))
  • Rows Removed by Index Recheck: 833104
  • Filter: (product_id = 4)
  • Rows Removed by Filter: 292032
  • Heap Blocks: exact=43368 lossy=26824
4. 0.002 38.905 ↓ 0.0 0 1

BitmapOr (cost=9.89..9.89 rows=83 width=0) (actual time=38.905..38.905 rows=0 loops=1)

5. 33.716 33.716 ↓ 6,403.6 262,548 1

Bitmap Index Scan on temp_byavinash_1_orgunit_customer_product_view_idx (cost=0.00..4.95 rows=41 width=0) (actual time=33.716..33.716 rows=262,548 loops=1)

  • Index Cond: ((orgunit_id = 10) AND (year = 2019) AND (month <= 10))
6. 5.187 5.187 ↓ 1,164.3 47,736 1

Bitmap Index Scan on temp_byavinash_1_orgunit_customer_product_view_idx (cost=0.00..4.95 rows=41 width=0) (actual time=5.187..5.187 rows=47,736 loops=1)

  • Index Cond: ((orgunit_id = 10) AND (year = 2018) AND (month >= 11))
Planning time : 0.302 ms