explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JsK4

Settings
# exclusive inclusive rows x rows loops node
1. 1,442.049 87,434.312 ↓ 2.1 10,019,768 1

Merge Left Join (cost=5,705,511.37..9,220,222.38 rows=4,697,571 width=457) (actual time=56,745.415..87,434.312 rows=10,019,768 loops=1)

  • Merge Cond: (ecrituresallinfo0digitfacture.id_ecritures = gap_order_invoice.ecritures_id)
2. 2,003.243 69,968.703 ↓ 2.1 10,019,768 1

Merge Left Join (cost=5,705,510.81..5,891,714.07 rows=4,697,571 width=393) (actual time=56,745.350..69,968.703 rows=10,019,768 loops=1)

  • Merge Cond: (ecrituresallinfo0digitfacture.id_ecritures = entriessumpooltva.ecritures_autoid)
3. 1,806.576 62,833.511 ↓ 2.1 10,019,768 1

Merge Left Join (cost=5,253,857.64..5,397,917.39 rows=4,697,571 width=361) (actual time=52,305.684..62,833.511 rows=10,019,768 loops=1)

  • Merge Cond: (ecrituresallinfo0digitfacture.id_ecritures = mouvementswithpool_1.ecritures_id)
4. 2,729.996 56,776.473 ↓ 2.1 10,019,768 1

Merge Left Join (cost=5,052,817.33..5,115,218.77 rows=4,697,571 width=261) (actual time=51,765.297..56,776.473 rows=10,019,768 loops=1)

  • Merge Cond: (ecrituresallinfo0digitfacture.id_ecritures = mouvementswithpool.ecritures_id)
5. 3,619.971 11,793.961 ↑ 1.0 4,697,489 1

Sort (cost=1,159,967.04..1,171,710.96 rows=4,697,571 width=187) (actual time=10,892.618..11,793.961 rows=4,697,489 loops=1)

  • Sort Key: ecrituresallinfo0digitfacture.id_ecritures
  • Sort Method: external merge Disk: 733,176kB
6. 431.554 8,173.990 ↑ 1.0 4,697,489 1

Subquery Scan on ecrituresallinfo0digitfacture (cost=0.00..205,877.35 rows=4,697,571 width=187) (actual time=0.036..8,173.990 rows=4,697,489 loops=1)

7. 7,742.436 7,742.436 ↑ 1.0 4,697,489 1

Seq Scan on ecrituresallinfo0 (cost=0.00..158,901.64 rows=4,697,571 width=187) (actual time=0.036..7,742.436 rows=4,697,489 loops=1)

8. 11,161.266 42,252.516 ↓ 3.9 10,006,584 1

Sort (cost=3,892,850.29..3,899,335.89 rows=2,594,239 width=78) (actual time=40,872.671..42,252.516 rows=10,006,584 loops=1)

  • Sort Key: mouvementswithpool.ecritures_id
  • Sort Method: external sort Disk: 683,280kB
9. 1,834.887 31,091.250 ↓ 3.9 10,006,584 1

Hash Left Join (cost=3,528,919.03..3,616,474.60 rows=2,594,239 width=78) (actual time=23,923.367..31,091.250 rows=10,006,584 loops=1)

  • Hash Cond: ((first(mouvementswithpool.id_account)) = plan_comptable.auto_id)
10. 17,714.032 29,255.980 ↓ 3.9 10,006,584 1

HashAggregate (cost=3,528,849.10..3,554,791.49 rows=2,594,239 width=96) (actual time=23,922.971..29,255.980 rows=10,006,584 loops=1)

  • Group Key: mouvementswithpool.ecritures_id, mouvementswithpool.pool_name
11. 11,541.948 11,541.948 ↑ 1.0 25,909,859 1

Index Scan Backward using test_index5 on mouvementswithpool (cost=0.56..2,880,289.28 rows=25,942,393 width=316) (actual time=0.024..11,541.948 rows=25,909,859 loops=1)

  • Filter: (pool_name IS DISTINCT FROM 'Accounts payable'::text)
  • Rows Removed by Filter: 1,371,121
12. 0.192 0.383 ↑ 1.0 1,819 1

Hash (cost=47.19..47.19 rows=1,819 width=26) (actual time=0.383..0.383 rows=1,819 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 125kB
13. 0.191 0.191 ↑ 1.0 1,819 1

Seq Scan on plan_comptable (cost=0.00..47.19 rows=1,819 width=26) (actual time=0.007..0.191 rows=1,819 loops=1)

14. 282.705 4,250.462 ↓ 1.9 2,098,550 1

Materialize (cost=201,040.32..257,472.62 rows=1,078,566 width=104) (actual time=540.385..4,250.462 rows=2,098,550 loops=1)

15. 3,288.536 3,967.757 ↓ 1.2 1,311,931 1

GroupAggregate (cost=201,040.32..243,990.55 rows=1,078,566 width=144) (actual time=540.382..3,967.757 rows=1,311,931 loops=1)

  • Group Key: mouvementswithpool_1.ecritures_id, mouvementswithpool_1.pool_name
16. 334.631 679.221 ↓ 1.0 1,371,121 1

Sort (cost=201,040.32..204,386.79 rows=1,338,587 width=33) (actual time=540.356..679.221 rows=1,371,121 loops=1)

  • Sort Key: mouvementswithpool_1.ecritures_id
  • Sort Method: quicksort Memory: 156,271kB
17. 344.590 344.590 ↓ 1.0 1,371,121 1

Index Scan using test_index on mouvementswithpool mouvementswithpool_1 (cost=0.56..64,823.83 rows=1,338,587 width=33) (actual time=0.025..344.590 rows=1,371,121 loops=1)

  • Index Cond: (pool_name = 'Accounts payable'::text)
18. 1,311.254 5,131.949 ↓ 3.2 6,399,642 1

Sort (cost=451,653.16..456,719.76 rows=2,026,639 width=36) (actual time=4,439.662..5,131.949 rows=6,399,642 loops=1)

  • Sort Key: entriessumpooltva.ecritures_autoid
  • Sort Method: quicksort Memory: 217,323kB
19. 176.429 3,820.695 ↓ 1.3 2,539,058 1

Subquery Scan on entriessumpooltva (cost=193,756.69..239,356.07 rows=2,026,639 width=36) (actual time=2,486.155..3,820.695 rows=2,539,058 loops=1)

20. 3,010.844 3,644.266 ↓ 1.3 2,539,058 1

HashAggregate (cost=193,756.69..219,089.67 rows=2,026,639 width=44) (actual time=2,486.153..3,644.266 rows=2,539,058 loops=1)

  • Group Key: mouvementswithpool_2.ecritures_id, mouvementswithpool_2.pool_name
21. 633.422 633.422 ↓ 1.0 3,507,276 1

Index Scan using test_index on mouvementswithpool mouvementswithpool_2 (cost=0.56..167,771.55 rows=3,464,685 width=18) (actual time=0.019..633.422 rows=3,507,276 loops=1)

  • Index Cond: (pool_name = 'VAT'::text)
22. 40.314 16,023.560 ↑ 10.4 263,432 1

Materialize (cost=0.56..3,282,663.16 rows=2,728,098 width=68) (actual time=0.064..16,023.560 rows=263,432 loops=1)

23. 180.965 15,983.246 ↑ 11.1 246,593 1

Subquery Scan on gap_order_invoice (cost=0.56..3,275,842.92 rows=2,728,098 width=68) (actual time=0.060..15,983.246 rows=246,593 loops=1)

24. 9,829.510 15,802.281 ↑ 11.1 246,593 1

GroupAggregate (cost=0.56..3,180,359.49 rows=2,728,098 width=44) (actual time=0.052..15,802.281 rows=246,593 loops=1)

  • Group Key: mouvementswithpool_3.ecritures_id, mouvementswithpool_3.pool_name
  • Filter: ((CASE WHEN (mouvementswithpool_3.pool_name = 'VAT'::text) THEN COALESCE(sum(mouvementswithpool_3.montant_signe), '0'::numeric) ELSE NULL::numeric END = '0'::numeric) AND (CASE WHEN (mouvementswithpool_3.pool_name = 'Accounts payable'::text) THEN COALESCE(sum(mouvementswithpool_3.montant_signe), '0'::numeric) ELSE NULL::numeric END IS DISTINCT FROM '0'::numeric) AND (CASE WHEN (mouvementswithpool_3.pool_name = 'Suppliers - Accrued invoices'::text) THEN COALESCE(sum(mouvementswithpool_3.montant_signe), '0'::numeric) ELSE NULL::numeric END IS DISTINCT FROM '0'::numeric))
  • Rows Removed by Filter: 11,071,922
25. 5,972.771 5,972.771 ↑ 1.0 27,280,980 1

Index Scan using text_index2 on mouvementswithpool mouvementswithpool_3 (cost=0.56..2,716,582.83 rows=27,280,980 width=18) (actual time=0.015..5,972.771 rows=27,280,980 loops=1)