explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IftS

Settings
# exclusive inclusive rows x rows loops node
1. 7.899 67.965 ↑ 25.0 491 1

Seq Scan on api_data_fieldfordataset (cost=10,260.76..11,562.84 rows=12,278 width=247) (actual time=60.297..67.965 rows=491 loops=1)

  • Filter: (((source_type = 0) AND (hashed SubPlan 1)) OR ((source_type = 1) AND (hashed SubPlan 2)) OR ((source_type = 2) AND (hashed SubPlan 3)) OR ((source_type = 3) AND (hashed SubPlan 4)))
  • Rows Removed by Filter: 26828
2.          

SubPlan (forSeq Scan)

3. 0.186 58.387 ↑ 5.2 136 1

Unique (cost=1,000.14..10,043.24 rows=702 width=4) (actual time=9.009..58.387 rows=136 loops=1)

4. 0.000 58.201 ↓ 4.8 3,387 1

Gather Merge (cost=1,000.14..10,042.89 rows=702 width=4) (actual time=9.008..58.201 rows=3,387 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
5. 7.491 64.088 ↓ 4.1 1,694 2

Nested Loop Left Join (cost=0.14..8,968.12 rows=413 width=4) (actual time=1.620..32.044 rows=1,694 loops=2)

  • Filter: ((u0.display = 1) OR (u1.account_id = 284))
  • Rows Removed by Filter: 34802
6. 10.532 10.532 ↑ 2.2 278 2

Parallel Index Scan using api_data_field_pkey on api_data_field u0 (cost=0.06..2,275.00 rows=609 width=6) (actual time=0.023..5.266 rows=278 loops=2)

  • Filter: ((display <> 2) AND (platform_id = 2) AND (db_table = ANY ('{1,2,4,5,40,9,10,11,13,16,17,18,21,23,31}'::integer[])))
  • Rows Removed by Filter: 9801
7. 46.065 46.065 ↓ 2.5 131 555

Index Scan using api_data_accounttofield_3aabf39f on api_data_accounttofield u1 (cost=0.08..10.78 rows=52 width=8) (actual time=0.005..0.083 rows=131 loops=555)

  • Index Cond: (u0.id = field_id)
8. 0.536 0.536 ↓ 2.0 14 1

Seq Scan on api_data_formulafield u0_1 (cost=0.00..70.87 rows=7 width=4) (actual time=0.151..0.536 rows=14 loops=1)

  • Filter: (is_time_interval AND (platform_id = 2) AND (((display = 1) AND (portfolio_id IS NULL)) OR ((display = 0) AND (portfolio_id = 2))))
  • Rows Removed by Filter: 1960
9. 0.004 0.134 ↑ 4.5 2 1

HashAggregate (cost=8.62..8.65 rows=9 width=4) (actual time=0.134..0.134 rows=2 loops=1)

  • Group Key: u0_2.id
10. 0.079 0.130 ↑ 20.5 2 1

Hash Right Join (cost=2.15..8.60 rows=41 width=4) (actual time=0.128..0.130 rows=2 loops=1)

  • Hash Cond: (u1_1.platform_breakdown_id = u0_2.id)
  • Filter: ((u1_1.account_id = 284) OR u0_2.is_for_all_accounts)
  • Rows Removed by Filter: 384
11. 0.037 0.037 ↓ 1.0 400 1

Seq Scan on api_data_accounttoplatformbreakdown u1_1 (cost=0.00..6.20 rows=399 width=8) (actual time=0.007..0.037 rows=400 loops=1)

12. 0.003 0.014 ↑ 1.0 9 1

Hash (cost=2.12..2.12 rows=9 width=5) (actual time=0.014..0.014 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
13. 0.011 0.011 ↑ 1.0 9 1

Seq Scan on platforms_platformbreakdown u0_2 (cost=0.00..2.12 rows=9 width=5) (actual time=0.006..0.011 rows=9 loops=1)

  • Filter: (platform_id = 2)
  • Rows Removed by Filter: 25
14. 0.086 1.009 ↓ 8.5 339 1

Hash Join (cost=1.18..137.62 rows=40 width=4) (actual time=0.053..1.009 rows=339 loops=1)

  • Hash Cond: (u0_3.platform_level_id = u2.id)
15. 0.898 0.898 ↓ 1.0 459 1

Seq Scan on buckets_tagset u0_3 (cost=0.00..136.17 rows=456 width=8) (actual time=0.012..0.898 rows=459 loops=1)

  • Filter: (portfolio_id = 2)
  • Rows Removed by Filter: 4695
16. 0.003 0.025 ↑ 1.0 4 1

Hash (cost=1.16..1.16 rows=4 width=4) (actual time=0.025..0.025 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 0.022 0.022 ↑ 1.0 4 1

Seq Scan on platforms_platformlevel u2 (cost=0.00..1.16 rows=4 width=4) (actual time=0.007..0.022 rows=4 loops=1)

  • Filter: (platform_id = 2)
  • Rows Removed by Filter: 42