explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gVx3

Settings
# exclusive inclusive rows x rows loops node
1. 4.647 3,856.731 ↑ 1.0 1 1

Aggregate (cost=1,394,321,830.96..1,394,321,830.97 rows=1 width=8) (actual time=3,856.731..3,856.731 rows=1 loops=1)

2. 2,141.333 3,852.084 ↓ 4.6 21,562 1

Nested Loop (cost=12.84..1,394,321,819.35 rows=4,643 width=8) (actual time=273.772..3,852.084 rows=21,562 loops=1)

  • Join Filter: (api_report.rule_id = api_rule.id)
  • Rows Removed by Join Filter: 21,490,347
3. 10.704 514.504 ↓ 6.0 30,673 1

Nested Loop (cost=12.84..1,394,246,347.41 rows=5,075 width=12) (actual time=271.748..514.504 rows=30,673 loops=1)

4. 318.307 318.307 ↓ 1.5 2,541 1

Index Scan using upload_ais on api_upload (cost=0.56..375,710.49 rows=1,713 width=12) (actual time=271.549..318.307 rows=2,541 loops=1)

  • Index Cond: ((account)::text = '540155'::text)
  • Filter: ((NOT is_satellite) AND (checked_on >= '2019-02-27 00:00:00+00'::timestamp with time zone) AND (checked_on <= '2019-08-26 23:59:59+00'::timestamp with time zone))
  • Rows Removed by Filter: 105,559
5. 62.737 185.493 ↑ 12.8 12 2,541

Index Only Scan using api_report_upload_rule_id_idx on api_report (cost=12.28..813,699.94 rows=154 width=8) (actual time=0.015..0.073 rows=12 loops=2,541)

  • Index Cond: (upload_id = api_upload.id)
  • Filter: ((NOT (hashed SubPlan 1)) AND (NOT (SubPlan 2)))
  • Rows Removed by Filter: 0
  • Heap Fetches: 0
6.          

SubPlan (for Index Only Scan)

7. 0.043 0.064 ↑ 1.0 19 1

Bitmap Heap Scan on api_ack u0 (cost=4.42..11.66 rows=19 width=4) (actual time=0.035..0.064 rows=19 loops=1)

  • Recheck Cond: ((account)::text = '540155'::text)
  • Heap Blocks: exact=4
8. 0.021 0.021 ↓ 1.1 21 1

Bitmap Index Scan on api_ack_account_0fd242e7_like (cost=0.00..4.42 rows=19 width=0) (actual time=0.021..0.021 rows=21 loops=1)

  • Index Cond: ((account)::text = '540155'::text)
9. 61.346 122.692 ↓ 0.0 0 30,673

Sort (cost=1,323.00..1,323.03 rows=9 width=85) (actual time=0.004..0.004 rows=0 loops=30,673)

  • Sort Key: u1.rule_id, api_upload_1.system_uuid, api_upload_1.checked_on
  • Sort Method: quicksort Memory: 25kB
10. 30.673 61.346 ↓ 0.0 0 30,673

Nested Loop (cost=11.15..1,322.86 rows=9 width=85) (actual time=0.002..0.002 rows=0 loops=30,673)

11. 0.000 30.673 ↓ 0.0 0 30,673

Nested Loop (cost=10.58..836.77 rows=205 width=89) (actual time=0.001..0.001 rows=0 loops=30,673)

12. 0.000 30.673 ↓ 0.0 0 30,673

Nested Loop (cost=0.43..16.48 rows=1 width=77) (actual time=0.001..0.001 rows=0 loops=30,673)

13. 30.673 30.673 ↓ 0.0 0 30,673

Index Only Scan using api_hostack_rule_id_account_system_uuid_91ea3cb1_uniq on api_hostack u2 (cost=0.15..8.17 rows=1 width=20) (actual time=0.001..0.001 rows=0 loops=30,673)

  • Index Cond: ((rule_id = api_report.rule_id) AND (account = '540155'::text))
  • Heap Fetches: 0
14. 0.000 0.000 ↓ 0.0 0

Index Scan using api_rule_pkey on api_rule u1 (cost=0.28..8.29 rows=1 width=61) (never executed)

  • Index Cond: (id = api_report.rule_id)
15. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on api_upload api_upload_1 (cost=10.15..818.25 rows=205 width=28) (never executed)

  • Recheck Cond: (system_uuid = u2.system_uuid)
16. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on api_upload_system_uuid_source_id_checked_on_feb91ea9_uniq (cost=0.00..10.10 rows=205 width=0) (never executed)

  • Index Cond: (system_uuid = u2.system_uuid)
17. 0.000 0.000 ↓ 0.0 0

Index Only Scan using api_report_upload_rule_id_idx on api_report u0_1 (cost=0.57..4.17 rows=2 width=12) (never executed)

  • Index Cond: ((upload_id = api_upload_1.id) AND (rule_id = api_report.rule_id))
  • Heap Fetches: 0
18. 1,194.683 1,196.247 ↑ 1.4 701 30,673

Materialize (cost=0.00..184.77 rows=990 width=4) (actual time=0.000..0.039 rows=701 loops=30,673)

19. 1.564 1.564 ↑ 1.0 985 1

Seq Scan on api_rule (cost=0.00..179.82 rows=990 width=4) (actual time=0.021..1.564 rows=985 loops=1)

  • Filter: active
  • Rows Removed by Filter: 91
Planning time : 2.141 ms
Execution time : 3,856.853 ms