explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0uw

Settings
# exclusive inclusive rows x rows loops node
1. 0.691 7,541,588.558 ↑ 1.0 5,000 1

Limit (cost=21,339,755.27..21,339,792.77 rows=5,000 width=12) (actual time=7,541,585.699..7,541,588.558 rows=5,000 loops=1)

2. 0.865 7,541,587.867 ↑ 3,826.8 5,000 1

Unique (cost=21,339,755.27..21,483,261.07 rows=19,134,107 width=12) (actual time=7,541,585.698..7,541,587.867 rows=5,000 loops=1)

3. 57,183.834 7,541,587.002 ↑ 2,571.8 7,440 1

Sort (cost=21,339,755.27..21,387,590.53 rows=19,134,107 width=12) (actual time=7,541,585.696..7,541,587.002 rows=7,440 loops=1)

  • Sort Key: m.arrival_date DESC, m.idnumber DESC
  • Sort Method: external merge Disk: 2,437,656kB
4. 47,887.626 7,484,403.168 ↓ 5.0 95,813,899 1

Nested Loop (cost=1.28..18,880,704.21 rows=19,134,107 width=12) (actual time=0.836..7,484,403.168 rows=95,813,899 loops=1)

5. 3,412,329.895 3,412,331.784 ↓ 5.0 95,813,899 1

Nested Loop (cost=0.71..4,502,520.63 rows=19,134,107 width=12) (actual time=0.294..3,412,331.784 rows=95,813,899 loops=1)

  • -> Index Scan using messagecontacts_2020_folder_address_arrival_date_key on messagecontacts_2020_folder m (cost=0.71..1987.61 rows=8,822 width=40) (actual time=
6. 1.889 1.889 ↑ 1.0 2,169 1

Seq Scan on acls_addresses_temp_aft_t at (cost=0.00..38.69 rows=2,169 width=32) (actual time=0.011..1.889 rows=2,169 loops=1)

  • Index Cond: ((lower(address) = at.address) AND (arrival_date >= '2020-01-08 00:00:00+00'::timestamp with time zone) AND (arrival_date < ('2020-01-08 00:00:
  • Filter: ((messagefield = ANY ('{to,cc,bcc,from,bfrom}'::text[])) AND (folderid = ANY ('{1,2,3,4,6,7,8,9,10,11,13,14,16,17}'::integer[])))
  • Rows Removed by Filter: 29,233
7. 4,024,183.758 4,024,183.758 ↑ 1.0 1 95,813,899

Index Scan using messages_2020_pkey on messages_2020 msg (cost=0.57..0.75 rows=1 width=4) (actual time=0.042..0.042 rows=1 loops=95,813,899)

  • Index Cond: (idnumber = m.idnumber)
  • Filter: (is_spam IS FALSE)
Planning time : 2.647 ms
Execution time : 7,541,665.320 ms