explain.depesz.com

PostgreSQL's explain analyze made readable

Result: w3n6 : Optimization for: plan #qVy

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.001 5.289 ↑ 1.0 10 1

Limit (cost=12,361.51..12,361.71 rows=10 width=96) (actual time=5.278..5.289 rows=10 loops=1)

2.          

CTE structure_by_legislation

3. 0.930 1.523 ↓ 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.612..1.523 rows=8,069 loops=1)

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

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

CTE previous_current_next

6. 0.011 5.281 ↑ 781.5 10 1

WindowAgg (cost=661.62..817.92 rows=7,815 width=100) (actual time=5.275..5.281 rows=10 loops=1)

7. 1.737 5.270 ↑ 710.5 11 1

Sort (cost=661.62..681.16 rows=7,815 width=36) (actual time=5.269..5.270 rows=11 loops=1)

  • Sort Key: structure_1.global_order
  • Sort Method: quicksort Memory: 823kB
8. 3.533 3.533 ↓ 1.0 8,069 1

CTE Scan on structure_by_legislation structure_1 (cost=0.00..156.30 rows=7,815 width=36) (actual time=0.615..3.533 rows=8,069 loops=1)

9. 5.288 5.288 ↑ 781.5 10 1

CTE Scan on previous_current_next (cost=0.00..156.30 rows=7,815 width=96) (actual time=5.277..5.288 rows=10 loops=1)