explain.depesz.com

PostgreSQL's explain analyze made readable

Result: keDO

Settings
# exclusive inclusive rows x rows loops node
1. 39.262 561.124 ↑ 1.0 118,676 1

WindowAgg (cost=50,509.59..53,776.02 rows=118,779 width=45) (actual time=498.192..561.124 rows=118,676 loops=1)

2. 149.496 521.862 ↑ 1.0 118,676 1

Sort (cost=50,509.59..50,806.54 rows=118,779 width=53) (actual time=498.184..521.862 rows=118,676 loops=1)

  • Sort Key: users.waiting, users.waiting_score, users.created_at
  • Sort Method: external merge Disk: 7768kB
3. 53.275 372.366 ↑ 1.0 118,676 1

GroupAggregate (cost=34,359.13..36,437.76 rows=118,779 width=53) (actual time=287.646..372.366 rows=118,676 loops=1)

  • Group Key: users.id
4. 122.314 319.091 ↓ 1.4 165,850 1

Sort (cost=34,359.13..34,656.07 rows=118,779 width=53) (actual time=287.637..319.091 rows=165,850 loops=1)

  • Sort Key: users.id
  • Sort Method: external merge Disk: 9032kB
5. 64.863 196.777 ↓ 1.4 165,850 1

Hash Right Join (cost=10,034.12..20,287.29 rows=118,779 width=53) (actual time=83.927..196.777 rows=165,850 loops=1)

  • Hash Cond: (referrals_users.referrer_id = users.id)
6. 48.080 48.080 ↑ 1.0 118,676 1

Seq Scan on users referrals_users (cost=0.00..7,505.38 rows=118,779 width=24) (actual time=0.025..48.080 rows=118,676 loops=1)

  • Filter: (waiting_score IS NOT NULL)
  • Rows Removed by Filter: 24162
7. 29.770 83.834 ↑ 1.0 118,676 1

Hash (cost=7,505.38..7,505.38 rows=118,779 width=45) (actual time=83.834..83.834 rows=118,676 loops=1)

  • Buckets: 65536 Batches: 4 Memory Usage: 2669kB
8. 54.064 54.064 ↑ 1.0 118,676 1

Seq Scan on users (cost=0.00..7,505.38 rows=118,779 width=45) (actual time=0.029..54.064 rows=118,676 loops=1)

  • Filter: (waiting_score IS NOT NULL)
  • Rows Removed by Filter: 24162