explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5Hn

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.001 2,716.070 ↑ 1.0 10 1

Limit (cost=1,992,500.49..1,992,500.51 rows=10 width=86) (actual time=2,716.068..2,716.070 rows=10 loops=1)

2. 0.182 2,716.069 ↑ 949.3 10 1

Sort (cost=1,992,500.49..1,992,524.22 rows=9,493 width=86) (actual time=2,716.067..2,716.069 rows=10 loops=1)

  • Sort Key: (sum(vcligne.vcligne_totalttccomptable)) DESC NULLS LAST, (COALESCE(vcarticle.vcarticle_tag, 'article non renseigné'::character varying)) DESC
  • Sort Method: top-N heapsort Memory: 26kB
3. 7.204 2,715.887 ↑ 8.0 1,182 1

GroupAggregate (cost=1,992,105.49..1,992,295.35 rows=9,493 width=86) (actual time=2,705.631..2,715.887 rows=1,182 loops=1)

  • Group Key: vcarticle.vcarticle_tag
4. 52.570 2,708.683 ↓ 2.6 24,334 1

Sort (cost=1,992,105.49..1,992,129.22 rows=9,493 width=44) (actual time=2,705.621..2,708.683 rows=24,334 loops=1)

  • Sort Key: vcarticle.vcarticle_tag
  • Sort Method: quicksort Memory: 3810kB
5. 7.253 2,656.113 ↓ 2.6 24,334 1

Nested Loop (cost=452,541.85..1,991,478.35 rows=9,493 width=44) (actual time=471.701..2,656.113 rows=24,334 loops=1)

6. 21.560 2,622.153 ↑ 1.1 26,707 1

Nested Loop (cost=452,541.70..1,986,351.96 rows=28,479 width=52) (actual time=471.691..2,622.153 rows=26,707 loops=1)

7. 468.632 2,520.472 ↑ 1.1 26,707 1

Hash Join (cost=452,541.27..1,940,499.90 rows=28,604 width=52) (actual time=471.667..2,520.472 rows=26,707 loops=1)

  • Hash Cond: (vcligne.vcligne_vcarticle_id = vcarticle.vcarticle_id)
8. 1,593.493 1,847.747 ↓ 1.0 1,933,072 1

Bitmap Heap Scan on vcligne (cost=55,045.98..1,510,833.48 rows=1,924,291 width=20) (actual time=267.116..1,847.747 rows=1,933,072 loops=1)

  • Recheck Cond: ((vcligne_dossier_id = 15) AND (vcligne_date >= '2019-01-01 00:00:00'::timestamp without time zone) AND (vcligne_date <= '2019-10-08 23:59:59.999999'::timestamp without time zone))
  • Rows Removed by Index Recheck: 205507
  • Filter: ((vcligne_typelotcalc)::text = ANY ('{"Article simple","Article lot détail","Article assemblé détail"}'::text[]))
  • Rows Removed by Filter: 192
  • Heap Blocks: exact=69549 lossy=133078
9. 254.254 254.254 ↓ 1.0 1,953,698 1

Bitmap Index Scan on vcligne_date_sk (cost=0.00..54,564.91 rows=1,925,788 width=0) (actual time=254.254..254.254 rows=1,953,698 loops=1)

  • Index Cond: ((vcligne_dossier_id = 15) AND (vcligne_date >= '2019-01-01 00:00:00'::timestamp without time zone) AND (vcligne_date <= '2019-10-08 23:59:59.999999'::timestamp without time zone))
10. 49.860 204.093 ↓ 1.1 254,023 1

Hash (cost=392,367.47..392,367.47 rows=240,865 width=44) (actual time=204.093..204.093 rows=254,023 loops=1)

  • Buckets: 131072 Batches: 4 Memory Usage: 6099kB
11. 154.233 154.233 ↓ 1.1 254,023 1

Index Scan using vcarticle_vcclassif2_sk on vcarticle (cost=0.56..392,367.47 rows=240,865 width=44) (actual time=0.019..154.233 rows=254,023 loops=1)

  • Index Cond: ((vcarticle_dossier_id = 15) AND ((vcarticle_vcclassif2)::text = 'COUVERT COULEUR'::text))
12. 80.121 80.121 ↑ 1.0 1 26,707

Index Scan using vcentete_pk on vcentete (cost=0.43..1.59 rows=1 width=12) (actual time=0.003..0.003 rows=1 loops=26,707)

  • Index Cond: (vcentete_id = vcligne.vcligne_vcentete_id)
  • Filter: (vcentete_dossier_id = 15)
13. 26.707 26.707 ↑ 1.0 1 26,707

Index Scan using adhetablissement_pk on adhetablissement (cost=0.15..0.17 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=26,707)

  • Index Cond: (adhetablissement_id = vcentete.vcentete_adhetablissement_id)
  • Filter: ((adhetablissement_dossier_id = 15) AND ((adhetablissement_enseignelib)::text = 'Ambiance & Styles'::text))
  • Rows Removed by Filter: 0
Planning time : 1.275 ms