explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Q7PQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.095 25.679 ↓ 6.0 6 1

Unique (cost=591.41..591.41 rows=1 width=8) (actual time=25.501..25.679 rows=6 loops=1)

2. 0.594 25.584 ↓ 1,435.0 1,435 1

Sort (cost=591.41..591.41 rows=1 width=8) (actual time=25.500..25.584 rows=1,435 loops=1)

  • Sort Key: lfg.location_id
  • Sort Method: quicksort Memory: 93kB
3. 0.011 24.990 ↓ 1,435.0 1,435 1

Nested Loop Left Join (cost=317.73..591.40 rows=1 width=8) (actual time=0.895..24.990 rows=1,435 loops=1)

4. 0.000 17.804 ↓ 1,435.0 1,435 1

Nested Loop (cost=317.17..588.80 rows=1 width=8) (actual time=0.868..17.804 rows=1,435 loops=1)

5. 0.826 13.608 ↓ 1,435.0 1,435 1

Nested Loop (cost=316.88..586.49 rows=1 width=16) (actual time=0.817..13.608 rows=1,435 loops=1)

6. 0.782 3.962 ↓ 735.0 1,470 1

Hash Join (cost=316.32..581.30 rows=2 width=24) (actual time=0.767..3.962 rows=1,470 loops=1)

  • Hash Cond: (ul.location_id = loc.id)
7. 2.489 2.489 ↓ 2.8 1,754 1

Index Scan using user_loc_user_id_all_index on user_location ul (cost=0.43..257.43 rows=632 width=8) (actual time=0.061..2.489 rows=1,754 loops=1)

  • Index Cond: (user_id = 3397025)
8. 0.071 0.691 ↑ 1.2 351 1

Hash (cost=310.72..310.72 rows=413 width=16) (actual time=0.691..0.691 rows=351 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
9. 0.620 0.620 ↑ 1.2 351 1

Index Scan using i_loc_corp_id on location loc (cost=0.29..310.72 rows=413 width=16) (actual time=0.035..0.620 rows=351 loops=1)

  • Index Cond: (corporation_id = 70683)
10. 8.820 8.820 ↑ 1.0 1 1,470

Index Scan using idx_loc_flag_del on location_flag lf (cost=0.56..2.58 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=1,470)

  • Index Cond: ((location_id = loc.id) AND (flag_id = 14))
  • Filter: (value = 'Yes'::text)
  • Rows Removed by Filter: 0
11. 4.305 4.305 ↑ 1.0 1 1,435

Index Only Scan using corporation_pkey on corporation corp (cost=0.29..2.31 rows=1 width=8) (actual time=0.002..0.003 rows=1 loops=1,435)

  • Index Cond: (id = 70683)
  • Heap Fetches: 1435
12. 7.175 7.175 ↓ 0.0 0 1,435

Index Scan using idx_loc_flag_del on location_flag lfg (cost=0.56..2.58 rows=1 width=8) (actual time=0.004..0.005 rows=0 loops=1,435)

  • Index Cond: ((location_id = lf.location_id) AND (flag_id = 300))
  • Filter: (value = 'No'::text)
  • Rows Removed by Filter: 1