explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JIr4

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 7,023.102 ↓ 0.0 0 1

Insert on prices (cost=4,079.94..231,257.41 rows=1 width=44) (actual time=7,023.102..7,023.102 rows=0 loops=1)

2. 0.000 7,023.100 ↓ 0.0 0 1

Subquery Scan on *SELECT* (cost=4,079.94..231,257.41 rows=1 width=44) (actual time=7,023.099..7,023.100 rows=0 loops=1)

3. 125.354 7,023.100 ↓ 0.0 0 1

Hash Join (cost=4,079.94..231,257.40 rows=1 width=36) (actual time=7,023.099..7,023.100 rows=0 loops=1)

  • Hash Cond: ((new_prices.advert_id = prices_1.advert_id) AND ((SubPlan 2) = prices_1.created))
  • Join Filter: ((new_prices.new_price <> prices_1.price) OR (prices_1.price IS NULL))
  • Rows Removed by Join Filter: 13
4.          

CTE new_prices

5. 0.067 0.067 ↑ 1.0 13 1

Values Scan on *VALUES* (cost=0.00..0.16 rows=13 width=36) (actual time=0.007..0.067 rows=13 loops=1)

6. 0.100 0.100 ↑ 1.0 13 1

CTE Scan on new_prices (cost=0.00..0.26 rows=13 width=36) (actual time=0.010..0.100 rows=13 loops=1)

7. 627.344 829.896 ↑ 1.0 96,331 1

Hash (cost=1,932.11..1,932.11 rows=98,311 width=28) (actual time=829.895..829.896 rows=96,331 loops=1)

  • Buckets: 65536 Batches: 2 Memory Usage: 3337kB
8. 202.552 202.552 ↑ 1.0 96,331 1

Seq Scan on prices prices_1 (cost=0.00..1,932.11 rows=98,311 width=28) (actual time=0.019..202.552 rows=96,331 loops=1)

9.          

SubPlan (for Hash Join)

10. 0.234 6,067.750 ↑ 1.0 1 26

Aggregate (cost=2,177.89..2,177.90 rows=1 width=8) (actual time=233.375..233.375 rows=1 loops=26)

11. 6,067.516 6,067.516 ↑ 1.0 1 26

Seq Scan on prices prices_2 (cost=0.00..2,177.89 rows=1 width=8) (actual time=70.765..233.366 rows=1 loops=26)

  • Filter: (advert_id = new_prices.advert_id)
  • Rows Removed by Filter: 96330
Planning time : 60.023 ms
Execution time : 7,030.120 ms