explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3UAC : Optimization for: plan #YWHJ

Settings

Optimization path:

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

Limit (cost=40,990.25..40,991.45 rows=40 width=114) (actual time=110.297..110.318 rows=40 loops=1)

  • Output: a.id, a.ficomp_id, a.name, a.firm_name, a.addr, a.is_active, (false)
2. 0.014 110.313 ↑ 2,474.2 40 1

Unique (cost=40,990.25..42,969.61 rows=98,968 width=114) (actual time=110.296..110.313 rows=40 loops=1)

  • Output: a.id, a.ficomp_id, a.name, a.firm_name, a.addr, a.is_active, (false)
3. 32.728 110.299 ↑ 2,474.2 40 1

Sort (cost=40,990.25..41,237.67 rows=98,968 width=114) (actual time=110.295..110.299 rows=40 loops=1)

  • Output: a.id, a.ficomp_id, a.name, a.firm_name, a.addr, a.is_active, (false)
  • Sort Key: a.id, a.ficomp_id, a.name, a.firm_name, a.addr, a.is_active, (false)
  • Sort Method: external merge Disk: 14704kB
4. 4.959 77.571 ↓ 1.0 100,001 1

Append (cost=0.00..26,688.54 rows=98,968 width=114) (actual time=38.878..77.571 rows=100,001 loops=1)

5. 72.610 72.610 ↓ 1.0 100,001 1

Seq Scan on public.addr a (cost=0.00..25,204.03 rows=98,967 width=137) (actual time=38.877..72.610 rows=100,001 loops=1)

  • Output: a.id, a.ficomp_id, a.name, a.firm_name, a.addr, a.is_active, false
  • Filter: (a.usr_id IS NULL)
  • Rows Removed by Filter: 400003
6. 0.001 0.002 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=0.00..0.00 rows=1 width=178) (actual time=0.002..0.002 rows=0 loops=1)

  • Output: "*SELECT* 2".id, "*SELECT* 2".ficomp_id, "*SELECT* 2".name, "*SELECT* 2".firm_name, "*SELECT* 2".addr, "*SELECT* 2".is_active, true
7. 0.001 0.001 ↓ 0.0 0 1

Result (cost=0.00..0.00 rows=0 width=178) (actual time=0.001..0.001 rows=0 loops=1)

  • Output: id, ficomp_id, (SubPlan 1), (SubPlan 2), addr, is_active, true
  • One-Time Filter: false
8.          

SubPlan (for Result)

9. 0.000 0.000 ↓ 0.0 0

Index Scan using usr_pkey on public.usr u (cost=0.29..8.31 rows=1 width=9) (never executed)

  • Output: u.full_name
  • Index Cond: (u.id = usr_id)
10. 0.000 0.000 ↓ 0.0 0

Index Scan using ficomp_pkey on public.ficomp f (cost=0.14..8.16 rows=1 width=32) (never executed)

  • Output: f.title
  • Index Cond: (f.id = ficomp_id)
Planning time : 0.315 ms
Execution time : 112.546 ms