explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jcr8

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

CTE Scan on previous_current_next (cost=11,996.33..11,996.53 rows=1 width=96) (actual time=82.409..82.422 rows=1 loops=1)

  • Filter: (article_id = 'LEGIARTI000023080663'::text)
  • Rows Removed by Filter: 13
2.          

CTE structure_by_legislation

3. 1.034 1.687 ↓ 1.0 8,069 1

Bitmap Heap Scan on articles_legislations_structure structure (cost=216.99..11,543.59 rows=7,815 width=79) (actual time=0.673..1.687 rows=8,069 loops=1)

  • Recheck Cond: (legislation_id = 'LEGITEXT000023086525'::text)
  • Heap Blocks: exact=163
4. 0.653 0.653 ↓ 1.0 8,069 1

Bitmap Index Scan on legislation_id_index (cost=0.00..215.04 rows=7,815 width=0) (actual time=0.653..0.653 rows=8,069 loops=1)

  • Index Cond: (legislation_id = 'LEGITEXT000023086525'::text)
5.          

CTE previous_current_next

6. 0.020 82.412 ↓ 1.6 14 1

WindowAgg (cost=452.56..452.74 rows=9 width=100) (actual time=82.400..82.412 rows=14 loops=1)

7. 0.015 82.392 ↓ 1.6 14 1

Sort (cost=452.56..452.58 rows=9 width=36) (actual time=82.391..82.392 rows=14 loops=1)

  • Sort Key: structure_1.global_order
  • Sort Method: quicksort Memory: 26kB
8. 5.723 82.377 ↓ 1.6 14 1

Nested Loop (cost=0.28..452.41 rows=9 width=36) (actual time=1.685..82.377 rows=14 loops=1)

9. 4.033 4.033 ↓ 206.9 8,069 1

CTE Scan on structure_by_legislation structure_1 (cost=0.00..175.84 rows=39 width=36) (actual time=0.677..4.033 rows=8,069 loops=1)

  • Filter: (legislation_id = 'LEGITEXT000023086525'::text)
10. 72.621 72.621 ↓ 0.0 0 8,069

Index Scan using articles_pkey on articles joined (cost=0.28..7.08 rows=1 width=52) (actual time=0.009..0.009 rows=0 loops=8,069)

  • Index Cond: (article_id = structure_1.article_id)
  • Filter: (((initial_version <> 'LEGIARTI000023086394'::text) AND (state = 'VIGUEUR'::text)) OR ((state = 'ABROGE_DIFF'::text) AND (ending_date > now())) OR (structure_1.article_id = 'LEGIARTI000023080663'::text))
  • Rows Removed by Filter: 0