explain.depesz.com

PostgreSQL's explain analyze made readable

Result: euWq : Big rows

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1.137 1,073.682 ↑ 1.0 1 1

Subquery Scan on article (cost=63,466.50..63,523.70 rows=1 width=85) (actual time=1,070.293..1,073.682 rows=1 loops=1)

  • Filter: (article.article_id = 'LEGIARTI000006594341'::text)
  • Rows Removed by Filter: 9316
2. 7.067 1,072.545 ↓ 5.3 9,317 1

WindowAgg (cost=63,466.50..63,501.70 rows=1,760 width=89) (actual time=1,064.420..1,072.545 rows=9,317 loops=1)

3. 6.344 1,065.478 ↓ 5.3 9,317 1

Sort (cost=63,466.50..63,470.90 rows=1,760 width=25) (actual time=1,064.400..1,065.478 rows=9,317 loops=1)

  • Sort Key: structure.global_order
  • Sort Method: quicksort Memory: 1112kB
4. 6.418 1,059.134 ↓ 5.3 9,317 1

Nested Loop (cost=0.43..63,371.62 rows=1,760 width=25) (actual time=0.141..1,059.134 rows=9,317 loops=1)

5. 203.944 203.944 ↓ 5.9 29,268 1

Seq Scan on articles_legislations_structure structure (cost=0.00..24,269.81 rows=4,923 width=25) (actual time=0.109..203.944 rows=29,268 loops=1)

  • Filter: (legislation_id = 'LEGITEXT000006071367'::text)
  • Rows Removed by Filter: 800401
6. 848.772 848.772 ↓ 0.0 0 29,268

Index Scan using articles_pkey on articles joined (cost=0.43..7.93 rows=1 width=52) (actual time=0.029..0.029 rows=0 loops=29,268)

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