explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yawm

Settings
# exclusive inclusive rows x rows loops node
1. 4,331.462 7,476.268 ↓ 0.0 0 1

Update on vente (cost=135,090.33..154,149.92 rows=1,158 width=213) (actual time=7,476.268..7,476.268 rows=0 loops=1)

  • Buffers: shared hit=5,068,085 read=90 dirtied=6,072 written=5,936
2. 201.008 3,144.806 ↓ 186.8 216,288 1

Nested Loop (cost=135,090.33..154,149.92 rows=1,158 width=213) (actual time=1,136.152..3,144.806 rows=216,288 loops=1)

  • Buffers: shared hit=1,163,122
3. 206.466 1,862.358 ↓ 186.8 216,288 1

Hash Join (cost=135,089.76..144,471.34 rows=1,158 width=40) (actual time=1,136.097..1,862.358 rows=216,288 loops=1)

  • Hash Cond: (((a.code)::text = (dvj.code_article)::text) AND ((m.code)::text = (dvj.code_magasin)::text))
  • Buffers: shared hit=81,682
4. 88.653 550.852 ↓ 1.4 216,930 1

Hash Join (cost=1,378.59..9,951.05 rows=154,117 width=40) (actual time=19.954..550.852 rows=216,930 loops=1)

  • Hash Cond: (v.magasin_id = m.id)
  • Buffers: shared hit=28,966
5. 148.413 460.863 ↓ 1.4 216,930 1

Hash Join (cost=1,295.31..9,462.06 rows=154,117 width=37) (actual time=18.544..460.863 rows=216,930 loops=1)

  • Hash Cond: (v.article_id = a.id)
  • Buffers: shared hit=28,913
6. 294.282 294.282 ↓ 1.4 216,930 1

Index Scan using vente_date_idx on vente v (cost=0.57..7,762.67 rows=154,117 width=34) (actual time=0.137..294.282 rows=216,930 loops=1)

  • Index Cond: (date = '2020-07-23'::date)
  • Buffers: shared hit=28,069
7. 5.329 18.168 ↑ 1.0 20,019 1

Hash (cost=1,044.33..1,044.33 rows=20,033 width=19) (actual time=18.168..18.168 rows=20,019 loops=1)

  • Buckets: 32,768 Batches: 1 Memory Usage: 1,351kB
  • Buffers: shared hit=844
8. 12.839 12.839 ↑ 1.0 20,019 1

Seq Scan on article a (cost=0.00..1,044.33 rows=20,033 width=19) (actual time=0.019..12.839 rows=20,019 loops=1)

  • Buffers: shared hit=844
9. 0.410 1.336 ↑ 1.0 1,479 1

Hash (cost=64.79..64.79 rows=1,479 width=19) (actual time=1.336..1.336 rows=1,479 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 97kB
  • Buffers: shared hit=50
10. 0.926 0.926 ↑ 1.0 1,479 1

Seq Scan on magasin m (cost=0.00..64.79 rows=1,479 width=19) (actual time=0.026..0.926 rows=1,479 loops=1)

  • Buffers: shared hit=50
11. 91.421 1,105.040 ↑ 1.0 216,885 1

Hash (cost=130,371.96..130,371.96 rows=222,614 width=28) (actual time=1,105.039..1,105.040 rows=216,885 loops=1)

  • Buckets: 262,144 Batches: 1 Memory Usage: 15,301kB
  • Buffers: shared hit=52,716
12. 1,013.619 1,013.619 ↑ 1.0 216,885 1

Seq Scan on derniere_vente_journee dvj (cost=0.00..130,371.96 rows=222,614 width=28) (actual time=689.561..1,013.619 rows=216,885 loops=1)

  • Filter: (journee = '2020-07-23'::date)
  • Rows Removed by Filter: 5,995,140
  • Buffers: shared hit=52,716
13. 1,081.440 1,081.440 ↑ 1.0 1 216,288

Index Scan using vente_pkey on vente (cost=0.57..8.36 rows=1 width=181) (actual time=0.005..0.005 rows=1 loops=216,288)

  • Index Cond: (id = v.id)
  • Buffers: shared hit=1,081,440
Planning time : 10.675 ms
Execution time : 7,478.239 ms