explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2AWV

Settings
# exclusive inclusive rows x rows loops node
1. 0.776 55,203.072 ↑ 1.0 1,000 1

Limit (cost=174,156.80..261,234.33 rows=1,000 width=146) (actual time=32,716.903..55,203.072 rows=1,000 loops=1)

2. 3.826 55,202.296 ↑ 10.6 3,000 1

Nested Loop (cost=1.73..2,768,806.10 rows=31,797 width=146) (actual time=117.554..55,202.296 rows=3,000 loops=1)

3. 6.242 48,023.470 ↑ 10.3 3,125 1

Nested Loop (cost=1.30..2,751,783.26 rows=32,283 width=150) (actual time=109.680..48,023.470 rows=3,125 loops=1)

4. 69.537 40,602.454 ↑ 17.9 3,343 1

Nested Loop (cost=0.87..2,710,782.20 rows=59,705 width=154) (actual time=20.641..40,602.454 rows=3,343 loops=1)

5. 947.314 947.314 ↑ 21.3 136,033 1

Index Scan Backward using users_device_pkey on users_device (cost=0.43..419,852.68 rows=2,900,153 width=150) (actual time=0.013..947.314 rows=136,033 loops=1)

  • Filter: (status = 0)
  • Rows Removed by Filter: 14994
6. 39,585.603 39,585.603 ↓ 0.0 0 136,033

Index Only Scan using users_spoonuser_favorites_from_spoonuser_id_ac0a7b1d_uniq on users_spoonuser_favorites (cost=0.44..0.78 rows=1 width=4) (actual time=0.291..0.291 rows=0 loops=136,033)

  • Index Cond: ((from_spoonuser_id = users_device.user_id) AND (to_spoonuser_id = 773433))
  • Heap Fetches: 4056
7. 7,414.774 7,414.774 ↑ 1.0 1 3,343

Index Scan using users_spoonuser_pkey on users_spoonuser (cost=0.43..0.68 rows=1 width=8) (actual time=2.069..2.218 rows=1 loops=3,343)

  • Index Cond: (id = users_device.user_id)
  • Filter: (status = 1)
  • Rows Removed by Filter: 0
8. 7,175.000 7,175.000 ↑ 1.0 1 3,125

Index Scan using users_pushsetting_pkey on users_pushsetting (cost=0.43..0.52 rows=1 width=4) (actual time=2.229..2.296 rows=1 loops=3,125)

  • Index Cond: (id = users_spoonuser.push_settings_id)
  • Filter: live
  • Rows Removed by Filter: 0