explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sCr1

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 440.156 ↑ 2.0 1 1

Nested Loop Left Join (cost=3.57..37,528.29 rows=2 width=2,726) (actual time=218.122..440.156 rows=1 loops=1)

2.          

CTE cte_accounts

3. 0.021 0.021 ↑ 1.0 1 1

Index Scan using accountsid on accounts (cost=0.43..2.65 rows=1 width=92) (actual time=0.021..0.021 rows=1 loops=1)

  • Index Cond: ((id)::text = '43'::text)
4. 0.008 440.139 ↑ 2.0 1 1

Nested Loop Left Join (cost=0.50..37,524.56 rows=2 width=2,139) (actual time=218.107..440.139 rows=1 loops=1)

5. 97.509 440.114 ↑ 2.0 1 1

Hash Left Join (cost=0.07..37,523.56 rows=2 width=1,765) (actual time=218.082..440.114 rows=1 loops=1)

  • Hash Cond: (u.id = accusd.userid)
  • Filter: ((u.id = accusd.userid) OR (u.id = accars.userid))
  • Rows Removed by Filter: 757676
6. 245.214 342.601 ↓ 1.0 757,677 1

Hash Left Join (cost=0.04..34,682.84 rows=757,512 width=993) (actual time=0.046..342.601 rows=757,677 loops=1)

  • Hash Cond: (u.id = accars.userid)
7. 97.360 97.360 ↓ 1.0 757,677 1

Seq Scan on users u (cost=0.00..31,842.12 rows=757,512 width=189) (actual time=0.010..97.360 rows=757,677 loops=1)

8. 0.000 0.027 ↓ 0.0 0 1

Hash (cost=0.02..0.02 rows=1 width=804) (actual time=0.027..0.027 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
9. 0.027 0.027 ↓ 0.0 0 1

CTE Scan on cte_accounts accars (cost=0.00..0.02 rows=1 width=804) (actual time=0.026..0.027 rows=0 loops=1)

  • Filter: (currency = 0)
  • Rows Removed by Filter: 1
10. 0.002 0.004 ↑ 1.0 1 1

Hash (cost=0.02..0.02 rows=1 width=804) (actual time=0.004..0.004 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.002 0.002 ↑ 1.0 1 1

CTE Scan on cte_accounts accusd (cost=0.00..0.02 rows=1 width=804) (actual time=0.001..0.002 rows=1 loops=1)

  • Filter: (currency = 1)
12. 0.017 0.017 ↑ 1.0 1 1

Index Scan using persons_pkey on persons p (cost=0.42..0.49 rows=1 width=390) (actual time=0.017..0.017 rows=1 loops=1)

  • Index Cond: (u.id = userid)
13. 0.008 0.008 ↑ 1.0 1 1

Index Scan using addresses_pkey on addresses a (cost=0.42..0.53 rows=1 width=619) (actual time=0.007..0.008 rows=1 loops=1)

  • Index Cond: (p.mainaddressid = id)
Planning time : 0.733 ms
Execution time : 440.443 ms