explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1COE : Optimization for: plan #QshY

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.100 3.982 ↓ 1.8 78 1

Group (cost=396.80..397.01 rows=43 width=20) (actual time=3.830..3.982 rows=78 loops=1)

  • Group Key: places.id
  • Buffers: shared hit=1590
2. 0.144 3.882 ↓ 2.6 111 1

Sort (cost=396.80..396.90 rows=43 width=20) (actual time=3.827..3.882 rows=111 loops=1)

  • Sort Key: places.id
  • Sort Method: quicksort Memory: 33kB
  • Buffers: shared hit=1590
3. 0.209 3.738 ↓ 2.6 111 1

Nested Loop (cost=3.63..395.63 rows=43 width=20) (actual time=0.097..3.738 rows=111 loops=1)

  • Buffers: shared hit=1590
4. 0.288 2.954 ↓ 1.9 115 1

Nested Loop (cost=3.35..374.33 rows=62 width=24) (actual time=0.085..2.954 rows=115 loops=1)

  • Buffers: shared hit=1245
5. 0.251 2.192 ↓ 1.8 79 1

Nested Loop (cost=3.06..306.27 rows=45 width=20) (actual time=0.073..2.192 rows=79 loops=1)

  • Buffers: shared hit=991
6. 0.143 1.557 ↓ 1.7 96 1

Nested Loop (cost=2.78..211.00 rows=57 width=24) (actual time=0.063..1.557 rows=96 loops=1)

  • Join Filter: (places.partner_id = partners.id)
  • Buffers: shared hit=706
7. 0.181 1.002 ↓ 1.5 103 1

Nested Loop (cost=2.50..187.23 rows=69 width=32) (actual time=0.053..1.002 rows=103 loops=1)

  • Buffers: shared hit=396
8. 0.379 0.405 ↓ 1.4 104 1

Bitmap Heap Scan on places (cost=2.21..84.16 rows=77 width=28) (actual time=0.043..0.405 rows=104 loops=1)

  • Recheck Cond: ((quad_key_dec >= '27721187328'::bigint) AND (quad_key_dec <= '27721203711'::bigint))
  • Filter: (is_active AND (deleted_at IS NULL))
  • Rows Removed by Filter: 4
  • Heap Blocks: exact=76
  • Buffers: shared hit=79
9. 0.026 0.026 ↓ 1.3 108 1

Bitmap Index Scan on places_quad_key_dec_index (cost=0.00..2.20 rows=81 width=0) (actual time=0.026..0.026 rows=108 loops=1)

  • Index Cond: ((quad_key_dec >= '27721187328'::bigint) AND (quad_key_dec <= '27721203711'::bigint))
  • Buffers: shared hit=3
10. 0.416 0.416 ↑ 1.0 1 104

Index Scan using partner_contracts_partner_id_index on partner_contracts (cost=0.28..1.33 rows=1 width=4) (actual time=0.003..0.004 rows=1 loops=104)

  • Index Cond: (partner_id = places.partner_id)
  • Filter: is_active
  • Rows Removed by Filter: 0
  • Buffers: shared hit=317
11. 0.412 0.412 ↑ 1.0 1 103

Index Scan using partners_pkey on partners (cost=0.28..0.33 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=103)

  • Index Cond: (id = partner_contracts.partner_id)
  • Filter: is_active
  • Rows Removed by Filter: 0
  • Buffers: shared hit=310
12. 0.384 0.384 ↑ 1.0 1 96

Index Scan using partner_boxes_pkey on partner_boxes (cost=0.28..1.67 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=96)

  • Index Cond: (id = places.partner_box_id)
  • Filter: (is_active AND (deleted_at IS NULL))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=285
13. 0.474 0.474 ↑ 1.0 1 79

Index Scan using place_offer_place_id_index on place_offer (cost=0.29..1.50 rows=1 width=8) (actual time=0.004..0.006 rows=1 loops=79)

  • Index Cond: (place_id = places.id)
  • Buffers: shared hit=254
14. 0.575 0.575 ↑ 1.0 1 115

Index Scan using offers_pkey on offers (cost=0.29..0.34 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=115)

  • Index Cond: (id = place_offer.offer_id)
  • Filter: (is_active AND (deleted_at IS NULL) AND (start_at <= '2019-07-09 00:00:00'::timestamp without time zone) AND (end_at >= '2019-07-09 00:00:00'::timestamp without time zone))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=345
Planning time : 1.575 ms
Execution time : 4.104 ms