explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1h99

Settings
# exclusive inclusive rows x rows loops node
1. 484,992.478 603,691.048 ↑ 22.6 16,854,094 1

Sort (cost=167,950,986.43..168,904,299.23 rows=381,325,118 width=132) (actual time=517,017.334..603,691.048 rows=16,854,094 loops=1)

  • Sort Key: cpsa1.crm_account_id, ((cpsa1.account_name)::text), ((cpsa1.account_owner)::text), ((cpsa1.account_type)::text), cpsa1.is_customer, ((date_part('epoch'::text, cpsa1.created_date))::integer), ((hstore_to_json(cpsa1.custom_crm_fields))::tex (...)
  • Sort Method: external merge Disk: 2862656kB
  • Buffers: shared hit=20125996 read=47811 dirtied=75, temp read=1333427 written=1333427
  • I/O Timings: read=19619.322
2. 21,332.602 118,698.570 ↑ 22.6 16,854,094 1

Nested Loop (cost=0.00..9,331,268.39 rows=381,325,118 width=132) (actual time=1.680..118,698.570 rows=16,854,094 loops=1)

  • Buffers: shared hit=20125977 read=47811 dirtied=75
  • I/O Timings: read=19619.322
3. 845.097 1,783.243 ↑ 1.0 2,033,675 1

Append (cost=0.00..100,718.94 rows=2,033,676 width=33) (actual time=0.014..1,783.243 rows=2,033,675 loops=1)

  • Buffers: shared hit=75298 dirtied=75
4. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on company_sale_account cpsa2 (cost=0.00..0.00 rows=1 width=516) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: ((company_name)::text = 'company_b'::text)
5. 938.145 938.145 ↑ 1.0 2,033,675 1

Seq Scan on company_sale_account_concur cpsa2_1 (cost=0.00..100,718.94 rows=2,033,675 width=33) (actual time=0.013..938.145 rows=2,033,675 loops=1)

  • Filter: ((company_name)::text = 'company_b'::text)
  • Buffers: shared hit=75298 dirtied=75
6. 10,168.375 95,582.725 ↑ 2.9 8 2,033,675

Append (cost=0.00..1.97 rows=23 width=355) (actual time=0.034..0.047 rows=8 loops=2,033,675)

  • Buffers: shared hit=20050679 read=47811
  • I/O Timings: read=19619.322
7. 0.000 0.000 ↓ 0.0 0 2,033,675

Seq Scan on company_sale_account cpsa1 (cost=0.00..0.00 rows=1 width=4,525) (actual time=0.000..0.000 rows=0 loops=2,033,675)

  • Filter: (((company_name)::text = 'company_a'::text) AND ((cpsa2.sale_account_id)::text = (sale_account_id)::text))
8. 85,414.350 85,414.350 ↑ 2.8 8 2,033,675

Index Scan using ix_csa_adp_sale_account on company_sale_account_adp cpsa1_1 (cost=0.56..1.97 rows=22 width=165) (actual time=0.033..0.042 rows=8 loops=2,033,675)

  • Index Cond: ((sale_account_id)::text = (cpsa2.sale_account_id)::text)
  • Filter: ((company_name)::text = 'company_a'::text)
  • Buffers: shared hit=20050679 read=47811
  • I/O Timings: read=19619.322
Planning time : 30.853 ms
Execution time : 618,218.321 ms