explain.depesz.com

PostgreSQL's explain analyze made readable

Result: le0D

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 3,348.408 ↑ 1.0 1 1

Finalize Aggregate (cost=246,188.02..246,188.03 rows=1 width=8) (actual time=3,348.408..3,348.408 rows=1 loops=1)

2. 165.043 3,499.964 ↓ 1.2 5 1

Gather (cost=246,187.60..246,188.01 rows=4 width=8) (actual time=3,348.212..3,499.964 rows=5 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
3. 0.227 3,334.921 ↑ 1.0 1 5

Partial Aggregate (cost=245,187.60..245,187.61 rows=1 width=8) (actual time=3,334.921..3,334.921 rows=1 loops=5)

4. 7.441 3,334.694 ↑ 1.2 909 5

Nested Loop (cost=0.09..245,184.96 rows=1,056 width=0) (actual time=1,641.128..3,334.694 rows=909 loops=5)

5. 3.442 3,327.246 ↑ 1.2 909 5

Nested Loop (cost=0.09..245,137.60 rows=1,056 width=16) (actual time=1,641.089..3,327.246 rows=909 loops=5)

6. 523.951 3,323.801 ↑ 1.2 909 5

Nested Loop Left Join (cost=0.09..245,108.80 rows=1,066 width=32) (actual time=1,641.060..3,323.801 rows=909 loops=5)

  • Filter: (((CASE WHEN validated_cla_plan_compta_pro.is_training THEN 'VALIDATED'::text WHEN (predicted_cla_plan_compta_pro.ratio < '0.9'::double precision) THEN 'LOW'::text WHEN (predicted_cla_plan_compta_pro.ratio >= '0.9'::double precision) THEN 'HIGH'::text ELSE 'NONE'::text END = 'LOW'::text) AND (hashed SubPlan 1)) OR ((CASE WHEN validated_cla_compte_tva_pro.is_training THEN 'VALIDATED'::text WHEN (predicted_cla_compte_tva_pro.ratio < '0.9'::double precision) THEN 'LOW'::text WHEN (predicted_cla_compte_tva_pro.ratio >= '0.9'::double precision) THEN 'HIGH'::text ELSE 'NONE'::text END = 'LOW'::text) AND (hashed SubPlan 2)))
  • Rows Removed by Filter: 222288
7. 444.874 2,799.833 ↓ 1.0 223,196 5

Nested Loop Left Join (cost=0.00..192,666.80 rows=213,548 width=65) (actual time=0.230..2,799.833 rows=223,196 loops=5)

8. 501.287 2,354.957 ↓ 1.0 223,196 5

Nested Loop Left Join (cost=0.00..144,495.85 rows=213,548 width=57) (actual time=0.227..2,354.957 rows=223,196 loops=5)

9. 1,267.730 1,853.668 ↓ 1.0 223,196 5

Nested Loop Left Join (cost=0.00..96,324.90 rows=213,548 width=49) (actual time=0.223..1,853.668 rows=223,196 loops=5)

10. 485.012 585.933 ↓ 1.0 223,196 5

Nested Loop (cost=0.00..50,289.43 rows=213,548 width=48) (actual time=0.139..585.933 rows=223,196 loops=5)

11. 100.919 100.919 ↑ 1.2 223,617 5

Parallel Seq Scan on invoice_line t (cost=0.00..32,289.79 rows=279,379 width=64) (actual time=0.051..100.919 rows=223,617 loops=5)

12. 0.002 0.002 ↑ 1.0 1 1,118,086

Index Scan using document_id_idx on document j3_document_id (cost=0.00..0.06 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=1,118,086)

  • Index Cond: (id = t.document_id)
  • Rows Removed by Index Recheck: 0
  • Filter: ((NOT deleted) AND (error_status = 'VALIDATED'::text))
  • Rows Removed by Filter: 0
13. 0.005 0.005 ↑ 1.0 1 1,115,982

Index Scan using classification_source_id_idx on classification validated_cla_plan_compta_pro (cost=0.00..0.21 rows=1 width=17) (actual time=0.005..0.005 rows=1 loops=1,115,982)

  • Index Cond: (source_id = t.id)
  • Rows Removed by Index Recheck: 0
  • Filter: (is_training AND (classification_label = 'plan_compta_pro'::text))
  • Rows Removed by Filter: 3
14. 0.002 0.002 ↑ 2.0 1 1,115,982

Index Scan using classification_source_id_idx on classification predicted_cla_plan_compta_pro (cost=0.00..0.21 rows=2 width=24) (actual time=0.001..0.002 rows=1 loops=1,115,982)

  • Index Cond: (source_id = t.id)
  • Rows Removed by Index Recheck: 0
  • Filter: ((NOT is_training) AND (classification_label = 'plan_compta_pro'::text))
  • Rows Removed by Filter: 2
15. 0.002 0.002 ↑ 2.0 1 1,115,982

Index Scan using classification_source_id_idx on classification predicted_cla_compte_tva_pro (cost=0.00..0.21 rows=2 width=24) (actual time=0.001..0.002 rows=1 loops=1,115,982)

  • Index Cond: (source_id = t.id)
  • Rows Removed by Index Recheck: 0
  • Filter: ((NOT is_training) AND (classification_label = 'compte_tva_pro'::text))
  • Rows Removed by Filter: 2
16. 0.002 0.002 ↑ 1.0 1 1,115,982

Index Scan using classification_source_id_idx on classification validated_cla_compte_tva_pro (cost=0.00..0.21 rows=1 width=17) (actual time=0.001..0.002 rows=1 loops=1,115,982)

  • Index Cond: (source_id = t.id)
  • Rows Removed by Index Recheck: 0
  • Filter: (is_training AND (classification_label = 'compte_tva_pro'::text))
  • Rows Removed by Filter: 3
17.          

SubPlan (for Nested Loop Left Join)

18. 0.007 0.007 ↑ 1.0 3 5

Values Scan on "*VALUES*" (cost=0.00..0.04 rows=3 width=32) (actual time=0.006..0.007 rows=3 loops=5)

19. 0.008 0.008 ↑ 1.0 3 5

Values Scan on "*VALUES*_1" (cost=0.00..0.04 rows=3 width=32) (actual time=0.006..0.008 rows=3 loops=5)

20. 0.003 0.003 ↑ 1.0 1 4,544

Index Scan using entity_id_idx on entity j8_entity_id (cost=0.00..0.03 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=4,544)

  • Index Cond: (id = t.entity_id)
  • Filter: (type_activite = 'PRO'::text)
21. 0.007 0.007 ↑ 1.0 1 4,544

Index Scan using invoice_id_idx on invoice j9_invoice_id (cost=0.00..0.04 rows=1 width=16) (actual time=0.007..0.007 rows=1 loops=4,544)

  • Index Cond: (id = t.invoice_id)
  • Filter: (source_file = 'pdf'::text)
Planning time : 9.524 ms
Execution time : 3,502.569 ms