explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FvYf

Settings
# exclusive inclusive rows x rows loops node
1. 0.755 26,831.651 ↑ 13.3 15 1

GroupAggregate (cost=2,884,936.21..2,885,019.93 rows=200 width=288) (actual time=26,830.780..26,831.651 rows=15 loops=1)

  • Group Key: stats.soato
  • Buffers: shared hit=1,225,977 read=475,540, temp read=74,380 written=74,396
  • Functions: 35
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 8.572 ms, Inlining 19.283 ms, Optimization 253.714 ms, Emission 161.448 ms, Total 443.018 ms
2. 1.262 26,830.896 ↓ 1.0 3,140 1

Sort (cost=2,884,936.21..2,884,943.98 rows=3,109 width=168) (actual time=26,830.757..26,830.896 rows=3,140 loops=1)

  • Sort Key: stats.soato
  • Sort Method: quicksort Memory: 538kB
  • Buffers: shared hit=1,225,977 read=475,540, temp read=74,380 written=74,396
3. 0.561 26,829.634 ↓ 1.0 3,140 1

Subquery Scan on stats (cost=2,771,014.68..2,884,755.85 rows=3,109 width=168) (actual time=22,771.163..26,829.634 rows=3,140 loops=1)

  • Buffers: shared hit=1,225,977 read=475,540, temp read=74,380 written=74,396
4. 3,334.821 26,829.073 ↓ 1.0 3,140 1

GroupAggregate (cost=2,771,014.68..2,884,724.76 rows=3,109 width=177) (actual time=22,771.161..26,829.073 rows=3,140 loops=1)

  • Group Key: companies.soato_code
  • Buffers: shared hit=1,225,977 read=475,540, temp read=74,380 written=74,396
5. 7,921.338 23,494.252 ↓ 1.0 4,736,741 1

Sort (cost=2,771,014.68..2,782,379.47 rows=4,545,916 width=46) (actual time=22,771.123..23,494.252 rows=4,736,741 loops=1)

  • Sort Key: companies.soato_code
  • Sort Method: external merge Disk: 272,128kB
  • Buffers: shared hit=1,225,977 read=475,540, temp read=74,380 written=74,396
6. 1,498.123 15,572.914 ↓ 1.0 4,736,741 1

Hash Right Join (cost=619,056.38..2,148,459.12 rows=4,545,916 width=46) (actual time=4,047.336..15,572.914 rows=4,736,741 loops=1)

  • Hash Cond: (p.company_tin = companies.tin)
  • Buffers: shared hit=1,225,977 read=475,540, temp read=40,364 written=40,364
7. 3,217.956 13,295.112 ↑ 1.0 4,547,485 1

Hash Right Join (cost=495,387.39..2,012,846.03 rows=4,550,087 width=37) (actual time=3,266.826..13,295.112 rows=4,547,485 loops=1)

  • Hash Cond: (t.position_id = p.id)
  • Buffers: shared hit=1,114,094 read=475,540, temp read=40,364 written=40,364
8. 6,814.160 6,814.160 ↑ 1.0 6,826,255 1

Seq Scan on transactions t (cost=0.00..1,391,649.14 rows=6,912,187 width=22) (actual time=0.022..6,814.160 rows=6,826,255 loops=1)

  • Filter: (active AND action AND (date_stop >= CURRENT_DATE))
  • Rows Removed by Filter: 2,880,912
  • Buffers: shared hit=770,495 read=475,540
9. 886.906 3,262.996 ↑ 1.0 4,523,564 1

Hash (cost=411,850.30..411,850.30 rows=4,550,087 width=23) (actual time=3,262.996..3,262.996 rows=4,523,564 loops=1)

  • Buckets: 1,048,576 Batches: 8 Memory Usage: 38,612kB
  • Buffers: shared hit=343,599, temp written=20,795
10. 2,376.090 2,376.090 ↑ 1.0 4,523,564 1

Seq Scan on positions p (cost=0.00..411,850.30 rows=4,550,087 width=23) (actual time=0.025..2,376.090 rows=4,523,564 loops=1)

  • Filter: (date_stop >= CURRENT_DATE)
  • Buffers: shared hit=343,599
11. 107.906 779.679 ↑ 1.0 417,772 1

Hash (cost=118,314.40..118,314.40 rows=428,367 width=19) (actual time=779.679..779.679 rows=417,772 loops=1)

  • Buckets: 524,288 Batches: 1 Memory Usage: 25,164kB
  • Buffers: shared hit=111,883
12. 671.773 671.773 ↑ 1.0 417,772 1

Seq Scan on companies (cost=0.00..118,314.40 rows=428,367 width=19) (actual time=435.213..671.773 rows=417,772 loops=1)

  • Filter: ((soato_code)::text ~~ concat(17, '%'))
  • Rows Removed by Filter: 2
  • Buffers: shared hit=111,883
Execution time : 26,887.328 ms