explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bND9

Settings
# exclusive inclusive rows x rows loops node
1. 0.035 282,972.312 ↓ 1.9 200 1

Limit (cost=1,584,762.84..1,584,763.10 rows=103 width=2,136) (actual time=282,972.221..282,972.312 rows=200 loops=1)

2. 39.224 282,972.277 ↓ 1.9 200 1

Sort (cost=1,584,762.84..1,584,763.10 rows=103 width=2,136) (actual time=282,972.218..282,972.277 rows=200 loops=1)

  • Sort Key: offredepri0_2_.datecreationsysteme DESC
  • Sort Method: top-N heapsort Memory: 228kB
3. 61.088 282,933.053 ↓ 49.9 5,139 1

Nested Loop (cost=1.53..1,584,759.40 rows=103 width=2,136) (actual time=0.231..282,933.053 rows=5,139 loops=1)

  • Join Filter: ((offredepri0_1_.id)::text = (offredepri0_.id)::text)
4. 34.317 2,131.565 ↓ 29.8 51,230 1

Nested Loop (cost=1.25..10,167.19 rows=1,717 width=1,793) (actual time=0.051..2,131.565 rows=51,230 loops=1)

5. 52.303 533.528 ↓ 30.0 52,124 1

Merge Join (cost=0.83..8,474.91 rows=1,736 width=1,229) (actual time=0.035..533.528 rows=52,124 loops=1)

  • Merge Cond: ((adresseent1_.id)::text = (offredepri0_1_.id_adresseemetteur)::text)
6. 55.230 55.230 ↑ 1.7 569 1

Index Scan using dm1_adresse_pkey on dm1_adresse adresseent1_ (cost=0.41..3,239.45 rows=975 width=32) (actual time=0.009..55.230 rows=569 loops=1)

  • Filter: ((id_etablissement)::text = ANY ('{4028817648856aac0148897c4a9a4c86,4028817648856aac0148897c4a9b4c89,1,4028817648856aac0148897c4a9c4c8f,4028817648856aac0148897c4a9c4c8d,4028817648856aac0148897c4a9c4c8b}'::text[]))
  • Rows Removed by Filter: 22137
7. 425.995 425.995 ↓ 1.0 52,125 1

Index Scan using x_dm2_documentcommercialvente_04 on dm2_documentcommercialvente offredepri0_1_ (cost=0.41..5,810.23 rows=52,077 width=1,229) (actual time=0.021..425.995 rows=52,125 loops=1)

8. 1,563.720 1,563.720 ↑ 1.0 1 52,124

Index Scan using dm1_documentcommercial_pkey on dm1_documentcommercial offredepri0_2_ (cost=0.42..0.96 rows=1 width=564) (actual time=0.029..0.030 rows=1 loops=52,124)

  • Index Cond: ((id)::text = (offredepri0_1_.id)::text)
  • Filter: ((datefinvalidite IS NULL) AND (NOT categoriesav))
  • Rows Removed by Filter: 0
9. 328.878 280,740.400 ↓ 0.0 0 51,230

Index Scan using dm2_offredeprixvente_pkey on dm2_offredeprixvente offredepri0_ (cost=0.29..917.05 rows=1 width=408) (actual time=5.480..5.480 rows=0 loops=51,230)

  • Index Cond: ((id)::text = (offredepri0_2_.id)::text)
  • Filter: (statutrevue AND ((id)::text !~~ 'DefaultRecord_%'::text) AND ((etat)::text <> '0'::text) AND ((natureoffre)::text = '0'::text) AND ((SubPlan 1) <= 0))
  • Rows Removed by Filter: 0
10.          

SubPlan (forIndex Scan)

11. 73.936 280,411.522 ↑ 1.0 1 9,242

Aggregate (cost=916.72..916.73 rows=1 width=33) (actual time=30.341..30.341 rows=1 loops=9,242)

12. 190.415 280,337.586 ↑ 1.5 15 9,242

Nested Loop (cost=1.67..916.66 rows=22 width=33) (actual time=17.549..30.333 rows=15 loops=9,242)

  • Join Filter: ((ligneoffre2_.id)::text = (ligneoffre2_2_.id)::text)
13. 130.399 179,183.896 ↑ 3.2 15 9,242

Nested Loop (cost=1.11..876.90 rows=48 width=66) (actual time=15.512..19.388 rows=15 loops=9,242)

14. 161,882.872 161,882.872 ↑ 3.2 15 9,242

Index Scan using x_dm2_ligneoffredeprixvente_00 on dm2_ligneoffredeprixvente ligneoffre2_ (cost=0.56..680.94 rows=48 width=33) (actual time=14.741..17.516 rows=15 loops=9,242)

  • Index Cond: ((id_offredeprixvente)::text = (offredepri0_.id)::text)
  • Filter: ((etatligneoffre)::text = '4'::text)
  • Rows Removed by Filter: 360
15. 17,170.625 17,170.625 ↑ 1.0 1 137,365

Index Only Scan using dm2_lignedocumentcommercialvente_pkey on dm2_lignedocumentcommercialvente ligneoffre2_1_ (cost=0.56..4.07 rows=1 width=33) (actual time=0.123..0.125 rows=1 loops=137,365)

  • Index Cond: (id = (ligneoffre2_.id)::text)
  • Heap Fetches: 654
16. 100,963.275 100,963.275 ↑ 1.0 1 137,365

Index Scan using dm1_lignedocumentcommercial_pkey on dm1_lignedocumentcommercial ligneoffre2_2_ (cost=0.56..0.82 rows=1 width=32) (actual time=0.730..0.735 rows=1 loops=137,365)

  • Index Cond: ((id)::text = (ligneoffre2_1_.id)::text)
  • Filter: (datefinvalidite IS NULL)