explain.depesz.com

PostgreSQL's explain analyze made readable

Result: QOBt

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 1,348.027 ↓ 0.0 0 1

Limit (cost=17.75..592.56 rows=20 width=993) (actual time=1,348.027..1,348.027 rows=0 loops=1)

2.          

Initplan (for Limit)

3. 0.004 0.004 ↑ 1.0 1 1

Index Scan using rubrique_pkey on rubrique r_1 (cost=0.15..8.17 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=1)

  • Index Cond: (id = 280)
4. 0.017 0.017 ↑ 1.0 1 1

Index Scan using rubrique_pkey on rubrique r_2 (cost=0.15..8.17 rows=1 width=4) (actual time=0.016..0.017 rows=1 loops=1)

  • Index Cond: (id = 280)
5. 0.001 1,348.026 ↓ 0.0 0 1

Nested Loop (cost=1.42..1,165,999.27 rows=40,570 width=993) (actual time=1,348.026..1,348.026 rows=0 loops=1)

  • Join Filter: (c.contenu_type_id = t.id)
6. 0.000 1,348.025 ↓ 0.0 0 1

Nested Loop (cost=1.42..794,371.97 rows=40,570 width=946) (actual time=1,348.025..1,348.025 rows=0 loops=1)

  • Join Filter: (v.etat_courant_id = e.id)
7. 0.001 1,348.025 ↓ 0.0 0 1

Nested Loop (cost=1.42..792,301.83 rows=40,570 width=923) (actual time=1,348.025..1,348.025 rows=0 loops=1)

  • Join Filter: (c.current_version_id = v.id)
8. 74.097 1,348.024 ↓ 0.0 0 1

Nested Loop Semi Join (cost=1.00..630,697.57 rows=118,914 width=178) (actual time=1,348.024..1,348.024 rows=0 loops=1)

9. 228.616 228.616 ↑ 1.0 348,437 1

Index Scan Backward using contenu_pkey on contenu c (cost=0.42..335,013.08 rows=348,911 width=174) (actual time=0.024..228.616 rows=348,437 loops=1)

  • Filter: (deleted_at IS NULL)
10. 181.059 1,045.311 ↓ 0.0 0 348,437

Nested Loop (cost=0.57..0.84 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=348,437)

11. 348.437 348.437 ↑ 2.0 1 348,437

Index Only Scan using contenu_version_rubrique_contenu_version_id_rubrique_id_unique on contenu_version_rubrique vr (cost=0.43..0.50 rows=2 width=8) (actual time=0.001..0.001 rows=1 loops=348,437)

  • Index Cond: (contenu_version_id = c.current_version_id)
  • Heap Fetches: 1,247
12. 515.815 515.815 ↓ 0.0 0 515,815

Index Scan using rubrique_pkey on rubrique r (cost=0.15..0.17 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=515,815)

  • Index Cond: (id = vr.rubrique_id)
  • Filter: ((lft >= $1) AND (rgt <= $2))
  • Rows Removed by Filter: 1
13. 0.000 0.000 ↓ 0.0 0

Index Scan using contenu_version_pkey on contenu_version v (cost=0.42..1.35 rows=1 width=753) (never executed)

  • Index Cond: (id = vr.contenu_version_id)
  • Filter: (source_id = 3)
14. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..1.06 rows=4 width=27) (never executed)

15. 0.000 0.000 ↓ 0.0 0

Seq Scan on contenu_etat e (cost=0.00..1.04 rows=4 width=27) (never executed)

16. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..1.07 rows=5 width=18) (never executed)

17. 0.000 0.000 ↓ 0.0 0

Seq Scan on contenu_type t (cost=0.00..1.05 rows=5 width=18) (never executed)

18.          

SubPlan (for Nested Loop)

19. 0.000 0.000 ↓ 0.0 0

Index Scan using contenu_version_rubrique_contenu_version_id_idx on contenu_version_rubrique cvr (cost=0.43..9.09 rows=2 width=32) (never executed)

  • Index Cond: (contenu_version_id = c.current_version_id)
Planning time : 1.392 ms
Execution time : 1,348.131 ms