explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LUu6

Settings
# exclusive inclusive rows x rows loops node
1. 8.180 354.149 ↓ 12.0 12 1

GroupAggregate (cost=1,414.73..1,414.77 rows=1 width=120) (actual time=345.141..354.149 rows=12 loops=1)

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

Sort (cost=1,414.73..1,414.74 rows=1 width=120) (actual time=343.957..345.969 rows=18,252 loops=1)

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

Bitmap Heap Scan on orgunit_customer_product_view ocpv (cost=925.46..1,414.72 rows=1 width=120) (actual time=107.583..333.549 rows=18,252 loops=1)

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

BitmapAnd (cost=925.46..925.46 rows=124 width=0) (actual time=105.318..105.318 rows=0 loops=1)

5. 70.683 70.683 ↓ 25.0 620,568 1

Bitmap Index Scan on temp_ocp_view_orgunit_id_idx (cost=0.00..462.61 rows=24,823 width=0) (actual time=70.683..70.683 rows=620,568 loops=1)

  • Index Cond: (orgunit_id = 10)
6. 23.458 23.458 ↓ 11.8 292,032 1

Bitmap Index Scan on temp_ocp_view_product_id_idx (cost=0.00..462.61 rows=24,823 width=0) (actual time=23.458..23.458 rows=292,032 loops=1)

  • Index Cond: (product_id = 4)
Planning time : 0.198 ms