explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GR2V

Settings
# exclusive inclusive rows x rows loops node
1. 6.210 353.940 ↓ 12.0 12 1

GroupAggregate (cost=81.45..81.48 rows=1 width=120) (actual time=346.893..353.940 rows=12 loops=1)

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

Sort (cost=81.45..81.45 rows=1 width=120) (actual time=346.260..347.730 rows=18,252 loops=1)

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

Bitmap Heap Scan on orgunit_customer_product_view ocpv (cost=53.34..81.44 rows=1 width=120) (actual time=45.707..338.068 rows=18,252 loops=1)

  • Recheck Cond: (((orgunit_id = 10) AND (year = 2019) AND (month = ANY ('{1,2,3,4,5,6,7,8,9,10}'::integer[]))) OR ((orgunit_id = 10) AND (year = 2018) AND (month = ANY ('{11,12}'::integer[]))))
  • Rows Removed by Index Recheck: 833104
  • Filter: (product_id = 4)
  • Rows Removed by Filter: 292032
  • Heap Blocks: exact=43368 lossy=26824
4. 0.000 36.063 ↓ 0.0 0 1

BitmapOr (cost=53.34..53.34 rows=7 width=0) (actual time=36.063..36.063 rows=0 loops=1)

5. 30.947 30.947 ↓ 43,758.0 262,548 1

Bitmap Index Scan on temp_byavinash_1_orgunit_customer_product_view_idx (cost=0.00..44.45 rows=6 width=0) (actual time=30.947..30.947 rows=262,548 loops=1)

  • Index Cond: ((orgunit_id = 10) AND (year = 2019) AND (month = ANY ('{1,2,3,4,5,6,7,8,9,10}'::integer[])))
6. 5.116 5.116 ↓ 47,736.0 47,736 1

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

  • Index Cond: ((orgunit_id = 10) AND (year = 2018) AND (month = ANY ('{11,12}'::integer[])))
Planning time : 0.281 ms