explain.depesz.com

PostgreSQL's explain analyze made readable

Result: V9Ud

Settings
# exclusive inclusive rows x rows loops node
1. 0.066 5,462.445 ↓ 345.0 345 1

Unique (cost=1,107.20..1,107.21 rows=1 width=8) (actual time=5,462.352..5,462.445 rows=345 loops=1)

2. 1.331 5,462.379 ↓ 350.0 350 1

Sort (cost=1,107.20..1,107.21 rows=1 width=8) (actual time=5,462.351..5,462.379 rows=350 loops=1)

  • Sort Key: lf.location_id
  • Sort Method: quicksort Memory: 41kB
3. 3.543 5,461.048 ↓ 350.0 350 1

Nested Loop (cost=1,003.82..1,107.19 rows=1 width=8) (actual time=35.075..5,461.048 rows=350 loops=1)

4. 2.584 10.336 ↓ 351.0 351 1

Nested Loop (cost=0.71..102.02 rows=1 width=16) (actual time=0.091..10.336 rows=351 loops=1)

5. 2.120 2.120 ↓ 9.5 352 1

Index Scan using user_loc_user_id on user_location ul (cost=0.42..16.63 rows=37 width=8) (actual time=0.055..2.120 rows=352 loops=1)

  • Index Cond: (user_id = 3397025)
6. 5.632 5.632 ↑ 1.0 1 352

Index Scan using idx_location_id_del on location loc (cost=0.29..2.31 rows=1 width=8) (actual time=0.016..0.016 rows=1 loops=352)

  • Index Cond: (id = ul.location_id)
  • Filter: (corporation_id = 70683)
7. 10.881 5,447.169 ↑ 1.0 1 351

Bitmap Heap Scan on location_flag lf (cost=1,003.11..1,005.16 rows=1 width=8) (actual time=15.515..15.519 rows=1 loops=351)

  • Recheck Cond: ((location_id = loc.id) AND (deleted = 'N'::bpchar) AND ((flag_id = 14) OR (flag_id = 300)))
  • Filter: (((flag_id = 14) AND (value = 'Yes'::text)) OR ((flag_id = 300) AND (value = 'No'::text)))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=702
8. 199.368 5,436.288 ↓ 0.0 0 351

BitmapAnd (cost=1,003.11..1,003.11 rows=2 width=0) (actual time=15.488..15.488 rows=0 loops=351)

9. 16.848 16.848 ↑ 9.1 290 351

Bitmap Index Scan on idx_loc_flag_del (cost=0.00..31.31 rows=2,634 width=0) (actual time=0.048..0.048 rows=290 loops=351)

  • Index Cond: (location_id = loc.id)
10. 0.000 5,220.072 ↓ 0.0 0 351

BitmapOr (cost=971.54..971.54 rows=94,680 width=0) (actual time=14.872..14.872 rows=0 loops=351)

11. 1,641.978 1,641.978 ↑ 1.8 26,689 351

Bitmap Index Scan on location_flag_id (cost=0.00..485.62 rows=47,340 width=0) (actual time=4.678..4.678 rows=26,689 loops=351)

  • Index Cond: (flag_id = 14)
12. 3,578.094 3,578.094 ↓ 2.6 122,297 351

Bitmap Index Scan on location_flag_id (cost=0.00..485.62 rows=47,340 width=0) (actual time=10.194..10.194 rows=122,297 loops=351)

  • Index Cond: (flag_id = 300)