explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DfKT

Settings
# exclusive inclusive rows x rows loops node
1. 37.026 4,637.839 ↓ 9.6 23,454 1

Unique (cost=9,917.00..9,947.51 rows=2,441 width=88) (actual time=4,551.272..4,637.839 rows=23,454 loops=1)

2. 873.656 4,600.813 ↓ 15.5 37,897 1

Sort (cost=9,917.00..9,923.10 rows=2,441 width=88) (actual time=4,551.267..4,600.813 rows=37,897 loops=1)

  • Sort Key: app.name, app.id, app.account, a.name
  • Sort Method: external merge Disk: 2712kB
3. 219.282 3,727.157 ↓ 15.5 37,897 1

Hash Right Join (cost=8,086.89..9,779.65 rows=2,441 width=88) (actual time=3,477.104..3,727.157 rows=37,897 loops=1)

  • Hash Cond: (h.application = app.id)
  • Filter: (((app.name)::text ~~* '%a%'::text) OR ((h.host)::text ~~* '%a%'::text))
  • Rows Removed by Filter: 4301
4. 30.854 30.854 ↑ 2.1 20,392 1

Seq Scan on application_hosts h (cost=0.00..1,497.03 rows=42,003 width=29) (actual time=0.038..30.854 rows=20,392 loops=1)

5. 30.944 3,477.021 ↓ 17.1 26,489 1

Hash (cost=8,067.48..8,067.48 rows=1,553 width=56) (actual time=3,477.021..3,477.021 rows=26,489 loops=1)

  • Buckets: 32768 (originally 2048) Batches: 1 (originally 1) Memory Usage: 2595kB
6. 3,438.272 3,446.077 ↓ 17.1 26,489 1

Nested Loop (cost=0.82..8,067.48 rows=1,553 width=56) (actual time=16.785..3,446.077 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.891.
7. 6.916 7.805 ↓ 16.6 482 1

Nested Loop (cost=0.41..119.86 rows=29 width=22) (actual time=0.194..7.805 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 = 'A
  • -> Index Scan using users_sso_idx on users u (cost=0.41..8.46 rows=1 width=135) (actual time=0.165..1.333 rows=1 loops=
  • Index Cond: (sso = 212767406)
  • Index Cond: (account = a.id)
8. 0.889 0.889 ↓ 1.0 482 1

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

Planning time : 2.666 ms
Execution time : 4,643.379 ms