explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PtUo : Optimization for: Big rows; plan #euWq

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.007 131.965 ↑ 1.0 1 1

Subquery Scan on article (cost=24,693.69..24,694.27 rows=1 width=85) (actual time=131.964..131.965 rows=1 loops=1)

  • Filter: (article.article_id = 'LEGIARTI000006934368'::text)
2. 0.011 131.958 ↑ 18.0 1 1

WindowAgg (cost=24,693.69..24,694.05 rows=18 width=89) (actual time=131.957..131.958 rows=1 loops=1)

3. 0.011 131.947 ↑ 18.0 1 1

Sort (cost=24,693.69..24,693.73 rows=18 width=25) (actual time=131.947..131.947 rows=1 loops=1)

  • Sort Key: structure.global_order
  • Sort Method: quicksort Memory: 25kB
4. 0.030 131.936 ↑ 18.0 1 1

Nested Loop (cost=0.43..24,693.31 rows=18 width=25) (actual time=31.774..131.936 rows=1 loops=1)

5. 131.260 131.260 ↑ 1.5 34 1

Seq Scan on articles_legislations_structure structure (cost=0.00..24,269.81 rows=50 width=25) (actual time=31.272..131.260 rows=34 loops=1)

  • Filter: (legislation_id = 'LEGITEXT000006062117'::text)
  • Rows Removed by Filter: 829635
6. 0.646 0.646 ↓ 0.0 0 34

Index Scan using articles_pkey on articles joined (cost=0.43..8.46 rows=1 width=52) (actual time=0.019..0.019 rows=0 loops=34)

  • Index Cond: (article_id = structure.article_id)
  • Filter: (((initial_version <> 'LEGIARTI000006934368'::text) AND (state = 'VIGUEUR'::text)) OR ((state = 'ABROGE_DIFF'::text) AND (ending_date > now())) OR (structure.article_id = 'LEGIARTI000006934368'::text))
  • Rows Removed by Filter: 1