explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5jkY

Settings
# exclusive inclusive rows x rows loops node
1. 4,113.976 7,003.871 ↑ 1.0 1 1

Aggregate (cost=5,943,330.21..5,943,330.22 rows=1 width=8) (actual time=7,003.870..7,003.871 rows=1 loops=1)

2. 0.000 2,889.895 ↓ 1.2 704,097 1

Gather (cost=88,310.92..5,941,867.45 rows=585,103 width=20) (actual time=526.101..2,889.895 rows=704,097 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 160.398 3,144.945 ↑ 1.0 234,699 3

Hash Join (cost=87,310.92..5,882,357.15 rows=243,793 width=20) (actual time=521.000..3,144.945 rows=234,699 loops=3)

  • Hash Cond: (api_report.rule_id = api_rule.id)
4. 2,178.746 2,983.014 ↓ 1.5 403,152 3

Nested Loop (cost=87,120.66..5,881,451.36 rows=271,485 width=20) (actual time=519.379..2,983.014 rows=403,152 loops=3)

5. 291.988 804.211 ↑ 1.3 35,898 3

Parallel Bitmap Heap Scan on api_upload (cost=87,102.23..307,665.33 rows=46,741 width=20) (actual time=518.944..804.211 rows=35,898 loops=3)

  • Recheck Cond: ((checked_on >= '2019-07-25 00:00:00+00'::timestamp with time zone) AND (checked_on <= '2019-08-01 23:59:59+00'::timestamp with time zone) AND ((account)::text = '729650'::text))
  • Rows Removed by Index Recheck: 384404
  • Heap Blocks: exact=10604
6. 1.853 512.223 ↓ 0.0 0 1

BitmapAnd (cost=87,102.23..87,102.23 rows=112,178 width=0) (actual time=512.223..512.223 rows=0 loops=1)

7. 196.589 196.589 ↓ 1.0 1,302,985 1

Bitmap Index Scan on api_upload_checked_on_01d47541 (cost=0.00..30,969.77 rows=1,266,121 width=0) (actual time=196.589..196.589 rows=1,302,985 loops=1)

  • Index Cond: ((checked_on >= '2019-07-25 00:00:00+00'::timestamp with time zone) AND (checked_on <= '2019-08-01 23:59:59+00'::timestamp with time zone))
8. 313.781 313.781 ↓ 1.0 2,666,576 1

Bitmap Index Scan on api_upload_account_e808b66a_like (cost=0.00..56,076.12 rows=2,601,008 width=0) (actual time=313.781..313.781 rows=2,666,576 loops=1)

  • Index Cond: ((account)::text = '729650'::text)
9. 0.000 0.057 ↑ 87.3 11 107,695

Index Only Scan using api_report_upload_id_rule_id_1a55a613_uniq on api_report (cost=18.42..109.65 rows=960 width=8) (actual time=0.021..0.057 rows=11 loops=107,695)

  • Index Cond: (upload_id = api_upload.id)
  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 1
  • Heap Fetches: 367335
10.          

SubPlan (forIndex Only Scan)

11. 0.207 0.207 ↑ 1.0 355 3

Seq Scan on api_ack u0 (cost=0.00..16.96 rows=355 width=4) (actual time=0.017..0.207 rows=355 loops=3)

  • Filter: ((account)::text = '729650'::text)
  • Rows Removed by Filter: 442
12. 0.259 1.533 ↑ 1.0 942 3

Hash (cost=178.49..178.49 rows=942 width=4) (actual time=1.533..1.533 rows=942 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 42kB
13. 1.274 1.274 ↑ 1.0 942 3

Seq Scan on api_rule (cost=0.00..178.49 rows=942 width=4) (actual time=0.016..1.274 rows=942 loops=3)

  • Filter: active
  • Rows Removed by Filter: 107
Planning time : 0.902 ms
Execution time : 7,004.795 ms