explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Yotx

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

CTE Scan on previous_current_next (cost=24,694.41..24,694.81 rows=1 width=100) (actual time=146.759..146.760 rows=1 loops=1)

  • Filter: (current_article_id = 'LEGIARTI000006934368'::text)
2.          

CTE structure_by_legislation

3. 0.039 146.728 ↑ 18.0 1 1

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

4. 145.635 145.635 ↑ 1.5 34 1

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

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

Index Scan using articles_pkey on articles joined (cost=0.43..8.46 rows=1 width=52) (actual time=0.031..0.031 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
6.          

CTE previous_current_next

7. 0.013 146.753 ↑ 18.0 1 1

WindowAgg (cost=0.74..1.10 rows=18 width=100) (actual time=146.753..146.753 rows=1 loops=1)

8. 0.009 146.740 ↑ 18.0 1 1

Sort (cost=0.74..0.78 rows=18 width=36) (actual time=146.740..146.740 rows=1 loops=1)

  • Sort Key: s.global_order
  • Sort Method: quicksort Memory: 25kB
9. 146.731 146.731 ↑ 18.0 1 1

CTE Scan on structure_by_legislation s (cost=0.00..0.36 rows=18 width=36) (actual time=41.676..146.731 rows=1 loops=1)