explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cYbH

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 25.083 ↓ 5.0 5 1

Unique (cost=591.41..591.41 rows=1 width=8) (actual time=25.081..25.083 rows=5 loops=1)

2. 0.039 25.080 ↓ 5.0 5 1

Sort (cost=591.41..591.41 rows=1 width=8) (actual time=25.080..25.080 rows=5 loops=1)

  • Sort Key: lfg.location_id
  • Sort Method: quicksort Memory: 25kB
3. 0.000 25.041 ↓ 5.0 5 1

Nested Loop (cost=317.73..591.40 rows=1 width=8) (actual time=2.027..25.041 rows=5 loops=1)

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

Nested Loop (cost=317.17..588.80 rows=1 width=24) (actual time=0.862..17.944 rows=1,435 loops=1)

5. 0.875 13.667 ↓ 1,435.0 1,435 1

Nested Loop (cost=316.88..586.49 rows=1 width=32) (actual time=0.811..13.667 rows=1,435 loops=1)

6. 0.794 3.972 ↓ 735.0 1,470 1

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

  • Hash Cond: (ul.location_id = loc.id)
7. 2.503 2.503 ↓ 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.063..2.503 rows=1,754 loops=1)

  • Index Cond: (user_id = 3397025)
8. 0.070 0.675 ↑ 1.2 351 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
9. 0.605 0.605 ↑ 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.032..0.605 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.005..0.005 rows=0 loops=1,435)

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