explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eKEf

Settings
# exclusive inclusive rows x rows loops node
1. 12.645 2,765.090 ↓ 32,393.0 32,393 1

GroupAggregate (cost=6,145,917.61..6,145,917.63 rows=1 width=49) (actual time=2,740.923..2,765.090 rows=32,393 loops=1)

  • Group Key: profiles.id
  • Filter: (count(*) >= 1)
2. 501.621 2,752.445 ↓ 63,099.0 63,099 1

Sort (cost=6,145,917.61..6,145,917.61 rows=1 width=41) (actual time=2,740.915..2,752.445 rows=63,099 loops=1)

  • Sort Key: profiles.id
  • Sort Method: external merge Disk: 3,152kB
3. 0.000 2,250.824 ↓ 63,099.0 63,099 1

Gather (cost=8,034.51..6,145,917.60 rows=1 width=41) (actual time=95.297..2,250.824 rows=63,099 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 13.213 2,434.478 ↓ 21,033.0 21,033 3 / 3

Nested Loop (cost=7,034.51..6,144,917.50 rows=1 width=41) (actual time=73.263..2,434.478 rows=21,033 loops=3)

5. 12.414 1,533.040 ↓ 3.9 22,775 3 / 3

Nested Loop (cost=7,033.94..1,346,296.75 rows=5,895 width=77) (actual time=63.486..1,533.040 rows=22,775 loops=3)

6. 319.195 336.784 ↑ 2.1 65,769 3 / 3

Parallel Bitmap Heap Scan on profiles (cost=7,033.25..776,626.36 rows=137,081 width=77) (actual time=57.950..336.784 rows=65,769 loops=3)

  • Recheck Cond: ((arena_user_id IS NOT NULL) OR (user_id IS NOT NULL) OR (email IS NOT NULL))
  • Rows Removed by Index Recheck: 649,596
  • Heap Blocks: exact=9,946 lossy=29,890
7. 0.001 17.589 ↓ 0.0 0 1 / 3

BitmapOr (cost=7,033.25..7,033.25 rows=330,276 width=0) (actual time=52.766..52.766 rows=0 loops=1)

8. 2.001 2.001 ↑ 1.0 26,104 1 / 3

Bitmap Index Scan on arena_user_id_idx (cost=0.00..695.99 rows=27,124 width=0) (actual time=6.004..6.004 rows=26,104 loops=1)

  • Index Cond: (arena_user_id IS NOT NULL)
9. 7.309 7.309 ↓ 1.0 132,311 1 / 3

Bitmap Index Scan on user_id_idx (cost=0.00..2,849.73 rows=129,239 width=0) (actual time=21.926..21.926 rows=132,311 loops=1)

  • Index Cond: (user_id IS NOT NULL)
10. 8.278 8.278 ↑ 1.1 156,138 1 / 3

Bitmap Index Scan on profiles_email_idx (cost=0.00..3,240.78 rows=173,913 width=0) (actual time=24.834..24.834 rows=156,138 loops=1)

  • Index Cond: (email IS NOT NULL)
11. 1,183.842 1,183.842 ↓ 0.0 0 197,307 / 3

Index Only Scan using profile_site_pkey on profile_site (cost=0.69..4.16 rows=1 width=41) (actual time=0.018..0.018 rows=0 loops=197,307)

  • Index Cond: ((id = (profiles.id)::text) AND (site_id = '5e55213d0d8cdf000726e813'::text))
  • Heap Fetches: 982
12. 888.225 888.225 ↑ 1.0 1 68,325 / 3

Index Scan using events_anonymous_id_idx on events (cost=0.57..814.01 rows=1 width=29) (actual time=0.034..0.039 rows=1 loops=68,325)

  • Index Cond: ((anonymous_id)::text = (profiles.anonymous_id)::text)
  • Filter: (((site_id)::text = '5e55213d0d8cdf000726e813'::text) AND ((type)::text = 'page'::text) AND (((context -> 'page'::text) ->> 'url'::text) ~~ '%30-dias-gratis/%'::text))
  • Rows Removed by Filter: 9
Planning time : 0.722 ms
Execution time : 2,770.458 ms