explain.depesz.com

PostgreSQL's explain analyze made readable

Result: I1M2

Settings
# exclusive inclusive rows x rows loops node
1. 12.147 1,688.786 ↓ 0.0 0 1

Update on vente (cost=1,379.16..2,060,638.69 rows=1,393 width=213) (actual time=1,688.786..1,688.786 rows=0 loops=1)

  • Buffers: shared hit=899,473 dirtied=7 written=7
2. 0.367 1,676.639 ↑ 4.9 283 1

Nested Loop (cost=1,379.16..2,060,638.69 rows=1,393 width=213) (actual time=567.528..1,676.639 rows=283 loops=1)

  • Buffers: shared hit=893,118
3. 142.718 1,674.574 ↑ 4.9 283 1

Nested Loop (cost=1,378.59..2,049,225.57 rows=1,393 width=40) (actual time=567.499..1,674.574 rows=283 loops=1)

  • Buffers: shared hit=891,703
4. 76.640 903.911 ↑ 1.1 209,315 1

Hash Join (cost=1,378.02..148,442.98 rows=220,957 width=46) (actual time=566.246..903.911 rows=209,315 loops=1)

  • Hash Cond: ((dvj.code_magasin)::text = (m.code)::text)
  • Buffers: shared hit=53,610
5. 101.191 826.486 ↑ 1.1 209,315 1

Hash Join (cost=1,294.74..147,778.03 rows=220,957 width=37) (actual time=565.448..826.486 rows=209,315 loops=1)

  • Hash Cond: ((dvj.code_article)::text = (a.code)::text)
  • Buffers: shared hit=53,560
6. 714.259 714.259 ↑ 1.1 209,315 1

Seq Scan on derniere_vente_journee dvj (cost=0.00..145,903.15 rows=220,957 width=28) (actual time=554.330..714.259 rows=209,315 loops=1)

  • Filter: ((journee >= '2020-07-28'::date) AND (journee <= '2020-07-28'::date))
  • Rows Removed by Filter: 6,002,710
  • Buffers: shared hit=52,716
7. 4.099 11.036 ↑ 1.0 20,019 1

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

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

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

  • Buffers: shared hit=844
9. 0.296 0.785 ↑ 1.0 1,479 1

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

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

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

  • Buffers: shared hit=50
11. 627.945 627.945 ↓ 0.0 0 209,315

Index Scan using vente_uk on vente v (cost=0.57..8.59 rows=1 width=34) (actual time=0.003..0.003 rows=0 loops=209,315)

  • Index Cond: ((magasin_id = m.id) AND (date = dvj.journee) AND (article_id = a.id))
  • Buffers: shared hit=838,093
12. 1.698 1.698 ↑ 1.0 1 283

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

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