explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 77jV : Before

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.005 5.632 ↑ 1.0 1 1

Subquery Scan on article (cost=12,921.17..12,921.65 rows=1 width=85) (actual time=5.623..5.632 rows=1 loops=1)

  • Filter: (article.article_id = 'LEGIARTI000023080663'::text)
  • Rows Removed by Filter: 13
2. 0.020 5.627 ↑ 1.1 14 1

WindowAgg (cost=12,921.17..12,921.47 rows=15 width=89) (actual time=5.616..5.627 rows=14 loops=1)

3. 0.010 5.607 ↑ 1.1 14 1

Sort (cost=12,921.17..12,921.20 rows=15 width=25) (actual time=5.607..5.607 rows=14 loops=1)

  • Sort Key: structure.global_order
  • Sort Method: quicksort Memory: 26kB
4. 0.971 5.597 ↑ 1.1 14 1

Hash Join (cost=1,563.34..12,920.87 rows=15 width=25) (actual time=3.835..5.597 rows=14 loops=1)

  • Hash Cond: (structure.article_id = joined.article_id)
  • Join Filter: (((joined.initial_version <> 'LEGIARTI000023086394'::text) AND (joined.state = 'VIGUEUR'::text)) OR ((joined.state = 'ABROGE_DIFF'::text) AND (joined.ending_date > now())) OR (structure.article_id = 'LEGIARTI000023080663'::text))
  • Rows Removed by Join Filter: 19
5. 0.944 1.525 ↓ 1.0 8,069 1

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

  • Recheck Cond: (legislation_id = 'LEGITEXT000023086525'::text)
  • Heap Blocks: exact=163
6. 0.581 0.581 ↓ 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.581..0.581 rows=8,069 loops=1)

  • Index Cond: (legislation_id = 'LEGITEXT000023086525'::text)
7. 1.067 3.101 ↑ 1.0 3,749 1

Hash (cost=1,299.49..1,299.49 rows=3,749 width=52) (actual time=3.101..3.101 rows=3,749 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 347kB
8. 2.034 2.034 ↑ 1.0 3,749 1

Seq Scan on articles joined (cost=0.00..1,299.49 rows=3,749 width=52) (actual time=0.039..2.034 rows=3,749 loops=1)