explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nJDn

Settings
# exclusive inclusive rows x rows loops node
1. 1,213.141 6,431.792 ↓ 1.2 309,887 1

Finalize GroupAggregate (cost=421,880.20..453,102.13 rows=267,863 width=822) (actual time=2,620.582..6,431.792 rows=309,887 loops=1)

  • Group Key: ambassador_ambassador.id
2. 0.000 5,218.651 ↓ 1.2 309,887 1

Gather Merge (cost=421,880.20..451,494.95 rows=267,864 width=822) (actual time=2,620.558..5,218.651 rows=309,887 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
3. 1,360.970 14,568.605 ↑ 1.1 61,977 5

Partial GroupAggregate (cost=420,880.19..421,613.33 rows=66,966 width=822) (actual time=2,514.843..2,913.721 rows=61,977 loops=5)

  • Group Key: ambassador_ambassador.id
4. 507.790 13,207.635 ↑ 1.1 61,977 5

Merge Left Join (cost=420,880.19..420,977.15 rows=66,966 width=762) (actual time=2,514.812..2,641.527 rows=61,977 loops=5)

  • Merge Cond: (ambassador_ambassador.id = posts.ambassador_id)
5. 1,117.000 9,661.150 ↑ 1.1 61,977 5

Sort (cost=323,426.25..323,459.73 rows=66,966 width=750) (actual time=1,907.063..1,932.230 rows=61,977 loops=5)

  • Sort Key: ambassador_ambassador.id
  • Sort Method: quicksort Memory: 75412kB
6. 8,127.418 8,544.150 ↑ 1.1 61,977 5

Parallel Bitmap Heap Scan on ambassador_ambassador (cost=54,490.73..322,352.71 rows=66,966 width=750) (actual time=472.496..1,708.830 rows=61,977 loops=5)

  • Recheck Cond: ((customer_account_id = 152) AND ((status)::text = 'ACTIVE'::text))
  • Heap Blocks: exact=37344
7. 18.658 416.732 ↓ 0.0 0 1

BitmapAnd (cost=54,490.73..54,490.73 rows=267,863 width=0) (actual time=416.732..416.732 rows=0 loops=1)

8. 148.761 148.761 ↓ 1.2 521,250 1

Bitmap Index Scan on ambassador_ambassador_customer_account_id (cost=0.00..16,635.65 rows=431,712 width=0) (actual time=148.760..148.761 rows=521,250 loops=1)

  • Index Cond: (customer_account_id = 152)
9. 249.313 249.313 ↓ 1.1 1,064,618 1

Bitmap Index Scan on ambassador_ambassador_status (cost=0.00..37,828.24 rows=929,434 width=0) (actual time=249.313..249.313 rows=1,064,618 loops=1)

  • Index Cond: ((status)::text = 'ACTIVE'::text)
10. 0.070 3,038.695 ↑ 26,468.0 1 5

Sort (cost=97,453.92..97,467.15 rows=26,468 width=16) (actual time=607.739..607.739 rows=1 loops=5)

  • Sort Key: posts.ambassador_id
  • Sort Method: quicksort Memory: 25kB
11. 8.200 3,038.625 ↑ 26,468.0 1 5

Bitmap Heap Scan on earned_media_post posts (cost=15,505.20..97,065.05 rows=26,468 width=16) (actual time=607.685..607.725 rows=1 loops=5)

  • Recheck Cond: ((customer_account_id = 152) AND (publish_date >= '2018-11-01 00:00:00+00'::timestamp with time zone))
  • Filter: ((status)::text = ANY ('{DETECTED,APPROVED,HIGHLIGHTED}'::text[]))
  • Rows Removed by Filter: 30
  • Heap Blocks: exact=31
12. 140.115 3,030.425 ↓ 0.0 0 5

BitmapAnd (cost=15,505.20..15,505.20 rows=44,998 width=0) (actual time=606.085..606.085 rows=0 loops=5)

13. 550.880 550.880 ↓ 1.0 472,586 5

Bitmap Index Scan on earned_media_post_customer_account_id (cost=0.00..4,013.30 rows=456,806 width=0) (actual time=110.175..110.176 rows=472,586 loops=5)

  • Index Cond: (customer_account_id = 152)
14. 2,339.430 2,339.430 ↓ 1.1 1,324,357 5

Bitmap Index Scan on earned_media_post_publish_date_9f1023a8 (cost=0.00..11,489.21 rows=1,182,082 width=0) (actual time=467.886..467.886 rows=1,324,357 loops=5)

  • Index Cond: (publish_date >= '2018-11-01 00:00:00+00'::timestamp with time zone)