explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bLq3

Settings
# exclusive inclusive rows x rows loops node
1. 7.039 3,675.108 ↓ 15.8 23,454 1

Unique (cost=9,069.64..9,088.24 rows=1,488 width=88) (actual time=3,660.612..3,675.108 rows=23,454 loops=1)

  • rows=55 loops=482)
2. 366.294 3,668.069 ↓ 25.5 37,897 1

Sort (cost=9,069.64..9,073.36 rows=1,488 width=88) (actual time=3,660.611..3,668.069 rows=37,897 loops=1)

  • Sort Key: app.name, app.id, app.account, a.name
  • Sort Method: external merge Disk: 2712kB
3. 163.398 3,301.775 ↓ 25.5 37,897 1

Nested Loop Left Join (cost=1.11..8,991.23 rows=1,488 width=88) (actual time=53.866..3,301.775 rows=37,897 loops=1)

  • Filter: (((app.name)::text ~~* '%a%'::text) OR ((h.host)::text ~~* '%a%'::text))
  • Rows Removed by Filter: 4301
4. 2,999.387 3,005.932 ↓ 17.1 26,489 1

Nested Loop (cost=0.82..8,067.48 rows=1,553 width=56) (actual time=53.801..3,005.932 rows=26,489 loops=1)

  • -> Index Scan using applications_id_account_key on applications app (cost=0.41..272.82 rows=124 width=38) (actual time=4.282..6.193
5. 4.950 6.545 ↓ 16.6 482 1

Nested Loop (cost=0.41..119.86 rows=29 width=22) (actual time=0.233..6.545 rows=482 loops=1)

  • Join Filter: ((a.id = ANY (u.admin)) OR (a.id = ANY (u.standard)) OR (a.id = ANY (u.restricted)) OR (((u.team)::text = 'APM'::t
  • Index Cond: (account = a.id)
6. 0.952 0.952 ↑ 1.0 1 1

Index Scan using users_sso_idx on users u (cost=0.41..8.46 rows=1 width=135) (actual time=0.199..0.952 rows=1 loops=1)

  • Index Cond: (sso = 212767406)
7. 0.643 0.643 ↓ 1.0 482 1

Seq Scan on accounts a (cost=0.00..83.80 rows=480 width=22) (actual time=0.007..0.643 rows=482 loops=1)

8. 132.445 132.445 ↑ 4.0 1 26,489

Index Scan using ah_appl_idx on application_hosts h (cost=0.29..0.53 rows=4 width=29) (actual time=0.004..0.005 rows=1 loops=26,489)

  • Index Cond: (application = app.id)
Planning time : 3.102 ms
Execution time : 3,676.859 ms