explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Hhuc : Optimization for: plan #bLcT

Settings

Optimization path:

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

Limit (cost=56,596.99..56,597.00 rows=1 width=25) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=56,596.99..56,597.00 rows=1 width=25) (actual rows= loops=)

  • Sort Key: (COALESCE(v.date_mise_a_jour, v.date_publication)) DESC, c.id DESC
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=40,808.24..56,596.98 rows=1 width=25) (actual rows= loops=)

  • Join Filter: (c.id = v.contenu_id)
4. 0.000 0.000 ↓ 0.0

Gather (cost=1,000.00..15,372.46 rows=1 width=17) (actual rows= loops=)

  • Workers Planned: 2
5. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on contenu c (cost=0.00..14,372.36 rows=1 width=17) (actual rows= loops=)

  • Filter: ((public_uid IS NOT NULL) AND (deleted_at IS NULL) AND (statut_publication = 'publie'::contenu_statut_publication) AND (contenu_type_id = 4))
6. 0.000 0.000 ↓ 0.0

Subquery Scan on v (cost=39,808.24..40,980.34 rows=19,535 width=20) (actual rows= loops=)

  • Filter: (date(v.date_publication) <= '2020-02-12'::date)
7. 0.000 0.000 ↓ 0.0

Unique (cost=39,808.24..40,101.26 rows=58,605 width=806) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Sort (cost=39,808.24..39,954.75 rows=58,605 width=806) (actual rows= loops=)

  • Sort Key: v2.contenu_id, v2.numero DESC
9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.42..14,331.59 rows=58,605 width=806) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Seq Scan on contenu_etat e (cost=0.00..1.05 rows=1 width=4) (actual rows= loops=)

  • Filter: ((slug)::text = 'publie'::text)
11. 0.000 0.000 ↓ 0.0

Index Scan using contenu_version_etat_courant_id_idx on contenu_version v2 (cost=0.42..13,158.44 rows=117,210 width=28) (actual rows= loops=)

  • Index Cond: (etat_courant_ida = e.id)