explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vbJz

Settings
# exclusive inclusive rows x rows loops node
1. 1.233 894.264 ↑ 1.0 1 1

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

  • Output: article.article_id, article.previous_article_id, article.next_article_id
  • Filter: (article.article_id = 'LEGIARTI000006594341'::text)
  • Rows Removed by Filter: 9316
  • Buffers: shared hit=146118
2. 6.936 893.031 ↓ 5.3 9,317 1

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

  • Output: structure.article_id, lag(structure.article_id, 1) OVER (?), lead(structure.article_id, 1) OVER (?), structure.global_order
  • Buffers: shared hit=146118
3. 5.791 886.095 ↓ 5.3 9,317 1

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

  • Output: structure.global_order, structure.article_id
  • Sort Key: structure.global_order
  • Sort Method: quicksort Memory: 1112kB
  • Buffers: shared hit=146118
4. 16.928 880.304 ↓ 5.3 9,317 1

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

  • Output: structure.global_order, structure.article_id
  • Buffers: shared hit=146118
5. 131.676 131.676 ↓ 5.9 29,268 1

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

  • Output: structure.article_id, structure.legislation_id, structure.structure_id, structure.created_at, structure.updated_at, structure."order", structure.global_order
  • Filter: (structure.legislation_id = 'LEGITEXT000006071367'::text)
  • Rows Removed by Filter: 800401
  • Buffers: shared hit=27723
6. 731.700 731.700 ↓ 0.0 0 29,268

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

  • Output: joined.article_id, joined.number, joined.clean_number, joined.state, joined.starting_date, joined.ending_date, joined.previous_version_id, joined.next_version_id, joined.nota_content, joined.content, joined.parent_text_number, joined.parent_text_clean_number, joined.parent_text_publication_date, joined.parent_text_signature_date, joined.parent_text_nature, joined.parent_text_long_title, joined.parent_text_id, joined.parent_text_short_title, joined.parent_text_sections, joined.initial_version, joined.base, joined.external_url, joined.updated_at
  • Index Cond: (joined.article_id = structure.article_id)
  • Filter: (((joined.initial_version <> 'LEGIARTI000006594341'::text) AND (joined.state = 'VIGUEUR'::text)) OR ((joined.state = 'ABROGE_DIFF'::text) AND (joined.ending_date > now())) OR (structure.article_id = 'LEGIARTI000006594341'::text))
  • Rows Removed by Filter: 1
  • Buffers: shared hit=118395