explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bwLU

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 526.236 ↑ 1.0 1 1

Limit (cost=0.84..133.16 rows=1 width=188) (actual time=526.236..526.236 rows=1 loops=1)

  • Output: system_user.legacy_dealer_contact_id, system_user.active, "user".verified_at, "user".password, system_user.system_id, system_user.role_id, "user".first_name, "user".last_name, "user".username, "user".is_dps, "user".last_password_change, "user".force_password_reset, "user".failed_login_count, "user".reference, "user".type, user_organisation.dealer_id
  • Buffers: shared hit=615239
2. 0.004 526.235 ↑ 803.0 1 1

Nested Loop (cost=0.84..106,252.39 rows=803 width=188) (actual time=526.235..526.235 rows=1 loops=1)

  • Output: system_user.legacy_dealer_contact_id, system_user.active, "user".verified_at, "user".password, system_user.system_id, system_user.role_id, "user".first_name, "user".last_name, "user".username, "user".is_dps, "user".last_password_change, "user".force_password_reset, "user".failed_login_count, "user".reference, "user".type, user_organisation.dealer_id
  • Join Filter: ("user".id = user_organisation.user_id)
  • Buffers: shared hit=615239
3. 32.637 526.213 ↑ 786.0 1 1

Nested Loop (cost=0.42..105,738.10 rows=786 width=196) (actual time=526.213..526.213 rows=1 loops=1)

  • Output: "user".verified_at, "user".password, "user".first_name, "user".last_name, "user".username, "user".is_dps, "user".last_password_change, "user".force_password_reset, "user".failed_login_count, "user".reference, "user".type, "user".id, system_user.legacy_dealer_contact_id, system_user.active, system_user.system_id, system_user.role_id, system_user.user_id
  • Buffers: shared hit=615235
4. 35.029 35.029 ↑ 1.0 152,849 1

Seq Scan on organisation.system_user (cost=0.00..4,470.04 rows=157,304 width=17) (actual time=0.014..35.029 rows=152,849 loops=1)

  • Output: system_user.legacy_dealer_contact_id, system_user.active, system_user.system_id, system_user.role_id, system_user.user_id
  • Buffers: shared hit=2845
5. 458.547 458.547 ↓ 0.0 0 152,849

Index Scan using user_pkey on organisation."user" (cost=0.42..0.63 rows=1 width=179) (actual time=0.003..0.003 rows=0 loops=152,849)

  • Output: "user".verified_at, "user".password, "user".first_name, "user".last_name, "user".username, "user".is_dps, "user".last_password_change, "user".force_password_reset, "user".failed_login_count, "user".reference, "user".type, "user".id
  • Index Cond: ("user".id = system_user.user_id)
  • Filter: (lower(("user".username)::text) = 'apikey-foie54a5rgjm7272jg'::text)
  • Rows Removed by Filter: 1
  • Buffers: shared hit=612390
6. 0.018 0.018 ↑ 3.0 1 1

Index Scan using user_organisation_user_id_index on organisation.user_organisation (cost=0.42..0.62 rows=3 width=8) (actual time=0.018..0.018 rows=1 loops=1)

  • Output: user_organisation.dealer_id, user_organisation.user_id
  • Index Cond: (user_organisation.user_id = system_user.user_id)
  • Filter: user_organisation.is_primary_dealer
  • Buffers: shared hit=4