explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VdRh

Settings
# exclusive inclusive rows x rows loops node
1. 0.016 6,156.649 ↑ 1.0 1 1

Nested Loop Left Join (cost=2.13..198,403.24 rows=1 width=1,296) (actual time=677.316..6,156.649 rows=1 loops=1)

2. 0.006 6,156.417 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.71..198,402.70 rows=1 width=707) (actual time=677.085..6,156.417 rows=1 loops=1)

3. 288.011 6,156.223 ↑ 1.0 1 1

Merge Left Join (cost=1.28..198,402.20 rows=1 width=330) (actual time=676.892..6,156.223 rows=1 loops=1)

  • Merge Cond: (u.id = accusd.userid)
  • Filter: (((accars.id)::text = '42'::text) OR ((accusd.id)::text = '42'::text))
  • Rows Removed by Filter: 756789
4. 576.356 3,037.594 ↓ 1.0 756,790 1

Merge Left Join (cost=0.85..118,713.58 rows=752,242 width=259) (actual time=0.015..3,037.594 rows=756,790 loops=1)

  • Merge Cond: (u.id = accars.userid)
5. 1,438.496 1,438.496 ↓ 1.0 756,790 1

Index Scan using users_pkey on users u (cost=0.42..41,702.31 rows=752,242 width=188) (actual time=0.007..1,438.496 rows=756,790 loops=1)

6. 1,022.742 1,022.742 ↓ 1.0 592,609 1

Index Scan using infra_accounts_userid_currency on accounts accars (cost=0.43..67,791.28 rows=587,151 width=87) (actual time=0.005..1,022.742 rows=592,609 loops=1)

  • Index Cond: (currency = 0)
7. 2,830.618 2,830.618 ↓ 1.0 590,151 1

Index Scan using infra_accounts_userid_currency on accounts accusd (cost=0.43..67,697.30 rows=577,755 width=87) (actual time=0.004..2,830.618 rows=590,151 loops=1)

  • Index Cond: (currency = 1)
8. 0.188 0.188 ↑ 1.0 1 1

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

  • Index Cond: (u.id = userid)
9. 0.216 0.216 ↑ 1.0 1 1

Index Scan using addresses_pkey on addresses a (cost=0.42..0.53 rows=1 width=621) (actual time=0.215..0.216 rows=1 loops=1)

  • Index Cond: (p.mainaddressid = id)
Planning time : 2.520 ms
Execution time : 6,156.870 ms