explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ufAj

Settings
# exclusive inclusive rows x rows loops node
1. 33.452 3,022.400 ↓ 0.0 0 1

Update on vente (cost=1,379.16..3,963,171.64 rows=2,770 width=213) (actual time=3,022.400..3,022.400 rows=0 loops=1)

  • Buffers: shared hit=1,759,600 read=132 dirtied=138 written=11
2. 1.031 2,988.948 ↑ 6.9 402 1

Nested Loop (cost=1,379.16..3,963,171.64 rows=2,770 width=213) (actual time=599.826..2,988.948 rows=402 loops=1)

  • Buffers: shared hit=1,750,539 read=115 dirtied=2
3. 114.288 2,981.887 ↑ 6.9 402 1

Nested Loop (cost=1,378.59..3,940,479.14 rows=2,770 width=40) (actual time=598.999..2,981.887 rows=402 loops=1)

  • Buffers: shared hit=1,748,293 read=113 dirtied=2
4. 158.672 1,173.991 ↑ 1.0 423,402 1

Hash Join (cost=1,378.02..149,598.26 rows=440,672 width=46) (actual time=581.102..1,173.991 rows=423,402 loops=1)

  • Hash Cond: ((dvj.code_magasin)::text = (m.code)::text)
  • Buffers: shared hit=53,610
5. 216.181 1,014.493 ↑ 1.0 423,402 1

Hash Join (cost=1,294.74..148,354.91 rows=440,672 width=37) (actual time=580.263..1,014.493 rows=423,402 loops=1)

  • Hash Cond: ((dvj.code_article)::text = (a.code)::text)
  • Buffers: shared hit=53,560
6. 786.641 786.641 ↑ 1.0 423,402 1

Seq Scan on derniere_vente_journee dvj (cost=0.00..145,903.15 rows=440,672 width=28) (actual time=568.508..786.641 rows=423,402 loops=1)

  • Filter: ((journee >= '2020-07-27'::date) AND (journee <= '2020-07-28'::date))
  • Rows Removed by Filter: 5,788,623
  • Buffers: shared hit=52,716
7. 4.818 11.671 ↑ 1.0 20,019 1

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

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

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

  • Buffers: shared hit=844
9. 0.310 0.826 ↑ 1.0 1,479 1

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

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

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

  • Buffers: shared hit=50
11. 1,693.608 1,693.608 ↓ 0.0 0 423,402

Index Scan using vente_uk on vente v (cost=0.57..8.59 rows=1 width=34) (actual time=0.004..0.004 rows=0 loops=423,402)

  • Index Cond: ((magasin_id = m.id) AND (date = dvj.journee) AND (article_id = a.id))
  • Buffers: shared hit=1,694,683 read=113 dirtied=2
12. 6.030 6.030 ↑ 1.0 1 402

Index Scan using vente_pkey on vente (cost=0.57..8.19 rows=1 width=181) (actual time=0.015..0.015 rows=1 loops=402)

  • Index Cond: (id = v.id)
  • Buffers: shared hit=2,127 read=2
Planning time : 3.354 ms
Execution time : 3,022.533 ms