explain.depesz.com

PostgreSQL's explain analyze made readable

Result: a5HQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 255.346 ↑ 1.0 12 1

Limit (cost=44,679.15..44,679.18 rows=12 width=74) (actual time=255.340..255.346 rows=12 loops=1)

2. 0.022 255.341 ↑ 16,958.7 12 1

Sort (cost=44,679.15..45,187.91 rows=203,504 width=74) (actual time=255.339..255.341 rows=12 loops=1)

  • Sort Key: (count(*)) DESC
  • Sort Method: top-N heapsort Memory: 26kB
3. 28.044 255.319 ↑ 5,814.4 35 1

GroupAggregate (cost=34,926.26..40,013.86 rows=203,504 width=74) (actual time=207.085..255.319 rows=35 loops=1)

  • Group Key: cu.userid, u.firstname, u.lastname, 'leads'::text
4. 156.043 227.275 ↑ 1.2 174,172 1

Sort (cost=34,926.26..35,435.02 rows=203,504 width=53) (actual time=207.047..227.275 rows=174,172 loops=1)

  • Sort Key: cu.userid, u.firstname, u.lastname
  • Sort Method: external merge Disk: 6272kB
5. 34.750 71.232 ↑ 1.2 174,172 1

Hash Join (cost=3,707.10..13,006.60 rows=203,504 width=53) (actual time=14.385..71.232 rows=174,172 loops=1)

  • Hash Cond: (cu.userid = u.id)
6. 22.248 22.248 ↑ 1.2 174,172 1

Index Only Scan using idx_creditusage_createdat_userid on creditusage cu (cost=0.56..6,501.88 rows=203,504 width=8) (actual time=0.011..22.248 rows=174,172 loops=1)

  • Index Cond: (createdat >= (now() - '30 days'::interval))
  • Heap Fetches: 521
7. 3.902 14.234 ↑ 1.0 30,735 1

Hash (cost=3,322.35..3,322.35 rows=30,735 width=21) (actual time=14.234..14.234 rows=30,735 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1465kB
8. 10.332 10.332 ↑ 1.0 30,735 1

Seq Scan on "user" u (cost=0.00..3,322.35 rows=30,735 width=21) (actual time=0.004..10.332 rows=30,735 loops=1)