explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aePv : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #K1Vh; plan #6HnL; plan #tefw; plan #raCd; plan #zvq

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.856 2,020.133 ↓ 0.0 0 1

Update on episodios_alta_diagnosticos (cost=0.42..353,076.49 rows=28 width=26) (actual time=2,020.133..2,020.133 rows=0 loops=1)

2. 0.442 2,019.277 ↓ 1.0 29 1

Index Scan using episodios_alta_diagnosticos_pkey on episodios_alta_diagnosticos episodios_alta_diagnosticos (cost=0.42..353,076.49 rows=28 width=26) (actual time=75.494..2,019.277 rows=29 loops=1)

  • Index Cond: (id < 386655)
3.          

SubPlan (for Index Scan)

4. 0.203 2,018.835 ↑ 1.0 1 29

Limit (cost=12,609.55..12,609.55 rows=1 width=12) (actual time=69.612..69.615 rows=1 loops=29)

5. 678.658 2,018.632 ↑ 34,585.0 1 29

Sort (cost=12,609.55..12,696.01 rows=34,585 width=12) (actual time=69.607..69.608 rows=1 loops=29)

  • Sort Key: (random())
  • Sort Method: top-N heapsort Memory: 25kB
6. 1,025.411 1,339.974 ↓ 2.2 75,695 29

Bitmap Heap Scan on cies cies (cost=738.92..12,436.62 rows=34,585 width=12) (actual time=11.486..46.206 rows=75,695 loops=29)

  • Heap Blocks: exact=67657
7. 314.563 314.563 ↓ 2.2 75,695 29

Bitmap Index Scan on cies_version_diagnostico (cost=0..730.27 rows=34,585 width=0) (actual time=10.847..10.847 rows=75,695 loops=29)

  • Index Cond: ((CASE WHEN (episodios_alta_diagnosticos.orden > '-1'::integer) THEN 6 ELSE 0 END = id_cie_version) AND (diagnostico_procedimiento = 'D'::bpchar))
Planning time : 0.268 ms
Execution time : 2,025.603 ms
Trigger times:
Trigger Name:Total time:Calls:Average time:
RI_ConstraintTrigger_c_125443 5.419 ms 29 0.187 ms