explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nH2b

Settings
# exclusive inclusive rows x rows loops node
1. 10.330 835.253 ↓ 0.0 0 1

Update on vente (cost=135,065.48..153,338.40 rows=1,106 width=213) (actual time=835.253..835.253 rows=0 loops=1)

  • Buffers: shared hit=65,373 dirtied=8 written=8
2. 0.200 824.923 ↑ 3.9 283 1

Nested Loop (cost=135,065.48..153,338.40 rows=1,106 width=213) (actual time=821.768..824.923 rows=283 loops=1)

  • Buffers: shared hit=55,458
3. 0.759 823.591 ↑ 3.9 283 1

Hash Join (cost=135,064.91..144,099.74 rows=1,106 width=40) (actual time=821.715..823.591 rows=283 loops=1)

  • Hash Cond: (((a.code)::text = (dvj.code_article)::text) AND ((m.code)::text = (dvj.code_magasin)::text))
  • Buffers: shared hit=54,043
4. 0.153 12.717 ↑ 343.3 432 1

Hash Join (cost=1,378.59..9,634.91 rows=148,287 width=40) (actual time=11.238..12.717 rows=432 loops=1)

  • Hash Cond: (v.magasin_id = m.id)
  • Buffers: shared hit=1,327
5. 0.365 11.850 ↑ 343.3 432 1

Hash Join (cost=1,295.31..9,161.27 rows=148,287 width=37) (actual time=10.514..11.850 rows=432 loops=1)

  • Hash Cond: (v.article_id = a.id)
  • Buffers: shared hit=1,277
6. 1.058 1.058 ↑ 343.3 432 1

Index Scan using vente_date_idx on vente v (cost=0.57..7,477.19 rows=148,287 width=34) (actual time=0.038..1.058 rows=432 loops=1)

  • Index Cond: (date = '2020-07-28'::date)
  • Buffers: shared hit=433
7. 3.943 10.427 ↑ 1.0 20,019 1

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

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

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

  • Buffers: shared hit=844
9. 0.267 0.714 ↑ 1.0 1,479 1

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

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

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

  • Buffers: shared hit=50
11. 78.336 810.115 ↑ 1.1 209,315 1

Hash (cost=130,371.96..130,371.96 rows=220,957 width=28) (actual time=810.115..810.115 rows=209,315 loops=1)

  • Buckets: 262,144 Batches: 1 Memory Usage: 14,838kB
  • Buffers: shared hit=52,716
12. 731.779 731.779 ↑ 1.1 209,315 1

Seq Scan on derniere_vente_journee dvj (cost=0.00..130,371.96 rows=220,957 width=28) (actual time=556.295..731.779 rows=209,315 loops=1)

  • Filter: (journee = '2020-07-28'::date)
  • Rows Removed by Filter: 6,002,710
  • Buffers: shared hit=52,716
13. 1.132 1.132 ↑ 1.0 1 283

Index Scan using vente_pkey on vente (cost=0.57..8.35 rows=1 width=181) (actual time=0.004..0.004 rows=1 loops=283)

  • Index Cond: (id = v.id)
  • Buffers: shared hit=1,415
Planning time : 2.740 ms
Execution time : 835.522 ms