explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Hjmg

Settings
# exclusive inclusive rows x rows loops node
1. 10.363 97.077 ↑ 1.0 8,447 1

Group (cost=72,920.30..73,089.24 rows=8,447 width=99) (actual time=84.480..97.077 rows=8,447 loops=1)

  • Group Key: investment_accounts.created_at, users.id, investment_accounts.currency, tags.value, tags.status, maker_checker_records.kwargs
2. 7.755 86.714 ↑ 1.0 8,447 1

Sort (cost=72,920.30..72,941.42 rows=8,447 width=99) (actual time=84.468..86.714 rows=8,447 loops=1)

  • Sort Key: investment_accounts.created_at DESC NULLS LAST, users.id, investment_accounts.currency, tags.value, tags.status, maker_checker_records.kwargs
  • Sort Method: quicksort Memory: 1046kB
3. 4.923 78.959 ↑ 1.0 8,447 1

Hash Join (cost=298.22..72,369.38 rows=8,447 width=99) (actual time=5.080..78.959 rows=8,447 loops=1)

  • Hash Cond: (investment_accounts.investment_account_type_id = investment_account_types.id)
4. 7.772 74.029 ↑ 1.0 8,447 1

Nested Loop Left Join (cost=296.18..72,251.19 rows=8,447 width=107) (actual time=5.066..74.029 rows=8,447 loops=1)

  • Join Filter: (tags.taggable_id = investment_accounts_users.id)
5. 5.978 66.257 ↑ 1.0 8,447 1

Hash Left Join (cost=295.62..72,114.87 rows=8,447 width=49) (actual time=5.045..66.257 rows=8,447 loops=1)

  • Hash Cond: (users.id = investment_accounts_users.user_id)
6. 9.945 55.276 ↑ 1.0 8,447 1

Nested Loop (cost=0.56..71,788.08 rows=8,447 width=41) (actual time=0.018..55.276 rows=8,447 loops=1)

7. 3.096 3.096 ↑ 1.0 8,447 1

Seq Scan on investment_accounts (cost=0.00..189.47 rows=8,447 width=28) (actual time=0.004..3.096 rows=8,447 loops=1)

8. 42.235 42.235 ↑ 1.0 1 8,447

Index Scan using users_pkey on users (cost=0.56..8.47 rows=1 width=21) (actual time=0.005..0.005 rows=1 loops=8,447)

  • Index Cond: (id = investment_accounts.user_id)
9. 2.533 5.003 ↑ 1.0 8,447 1

Hash (cost=189.47..189.47 rows=8,447 width=16) (actual time=5.003..5.003 rows=8,447 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 524kB
10. 2.470 2.470 ↑ 1.0 8,447 1

Seq Scan on investment_accounts investment_accounts_users (cost=0.00..189.47 rows=8,447 width=16) (actual time=0.002..2.470 rows=8,447 loops=1)

11. 0.000 0.000 ↓ 0.0 0 8,447

Materialize (cost=0.56..9.62 rows=1 width=70) (actual time=0.000..0.000 rows=0 loops=8,447)

12. 0.000 0.016 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.56..9.61 rows=1 width=70) (actual time=0.016..0.016 rows=0 loops=1)

  • Join Filter: (maker_checker_records.maker_checkable_id = tags.id)
13. 0.016 0.016 ↓ 0.0 0 1

Index Scan using index_tags_on_taggable_type_and_taggable_id_and_name_and_status on tags (cost=0.56..8.58 rows=1 width=42) (actual time=0.016..0.016 rows=0 loops=1)

  • Index Cond: (((taggable_type)::text = 'InvestmentAccount'::text) AND ((name)::text = 'vams_flag'::text))
  • Filter: (status <> 2)
14. 0.000 0.000 ↓ 0.0 0

Seq Scan on maker_checker_records (cost=0.00..1.02 rows=1 width=40) (never executed)

  • Filter: ((status = 1) AND ((action)::text = 'customers.check_flag'::text) AND ((maker_checkable_type)::text = 'VamsFlag'::text))
15. 0.002 0.007 ↑ 1.0 2 1

Hash (cost=2.02..2.02 rows=2 width=8) (actual time=0.007..0.007 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
16. 0.005 0.005 ↑ 1.0 2 1

Seq Scan on investment_account_types (cost=0.00..2.02 rows=2 width=8) (actual time=0.002..0.005 rows=2 loops=1)