explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YjHP : Optimization for: plan #bBa6

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 6.520 24.878 ↓ 0.0 0 1

Update on import_vn.observations_json (cost=36.80..536.09 rows=998 width=1,001) (actual time=24.878..24.878 rows=0 loops=1)

2. 7.519 7.519 ↓ 1.0 1,000 1

Nested Loop (cost=36.80..536.09 rows=998 width=1,001) (actual time=2.026..7.519 rows=1,000 loops=1)

3. 2.485 2.485 ↓ 5.6 1,000 1

HashAggregate (cost=36.24..38.03 rows=179 width=42) (actual time=2.011..2.485 rows=1,000 loops=1)

4. 1.649 1.649 ↑ 1.0 1,000 1

Subquery Scan on ANY_subquery (cost=0.56..31.24 rows=1,000 width=42) (actual time=0.031..1.649 rows=1,000 loops=1)

5. 1.391 1.391 ↑ 1.0 1,000 1

Limit (cost=0.56..21.24 rows=1,000 width=9) (actual time=0.023..1.391 rows=1,000 loops=1)

6. 1.314 1.314 ↑ 17,242.0 1,000 1

Index Only Scan using observations_json_pk on import_vn.observations_json observations_json_1 (cost=0.56..356,460.52 rows=17,242,024 width=9) (actual time=0.021..1.314 rows=1,000 loops=1)

7. 4.000 4.000 ↑ 1.0 1 1,000

Index Scan using observations_json_pk on import_vn.observations_json (cost=0.56..2.78 rows=1 width=968) (actual time=0.004..0.004 rows=1 loops=1,000)

Planning time : 0.365 ms
Execution time : 2,434.380 ms
Trigger times:
Trigger Name:Total time:Calls:Average time:
observations_trigger 304.561 ms 1000 0.305 ms
obsfull_upsert_from_vn_trigger 2,104.171 ms 1000 2.104 ms