explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KwaM

Settings
# exclusive inclusive rows x rows loops node
1. 0.029 460,481.750 ↑ 20.0 10 1

Sort (cost=198,931,037.42..198,931,037.92 rows=200 width=36) (actual time=460,481.744..460,481.750 rows=10 loops=1)

  • Sort Key: i.time_range
  • Sort Method: quicksort Memory: 25kB
2.          

CTE vals

3. 0.003 0.003 ↑ 1.0 1 1

Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.002..0.003 rows=1 loops=1)

4.          

CTE intervals

5. 0.111 0.174 ↑ 33.3 10 1

WindowAgg (cost=31.47..38.13 rows=333 width=16) (actual time=0.057..0.174 rows=10 loops=1)

6. 0.029 0.063 ↑ 33.3 10 1

Sort (cost=31.47..32.30 rows=333 width=16) (actual time=0.047..0.063 rows=10 loops=1)

  • Sort Key: _.start_time
  • Sort Method: quicksort Memory: 25kB
7. 0.015 0.034 ↑ 33.3 10 1

Subquery Scan on _ (cost=0.00..17.52 rows=333 width=16) (actual time=0.012..0.034 rows=10 loops=1)

  • Filter: (_.start_time < _.frame_end)
8. 0.019 0.019 ↑ 100.0 10 1

CTE Scan on vals (cost=0.00..5.02 rows=1,000 width=32) (actual time=0.009..0.019 rows=10 loops=1)

9. 75.660 460,481.721 ↑ 20.0 10 1

HashAggregate (cost=198,930,989.64..198,930,991.64 rows=200 width=36) (actual time=460,481.713..460,481.721 rows=10 loops=1)

10. 217,654.560 460,406.061 ↑ 123.1 81,021 1

Nested Loop Left Join (cost=0.00..198,881,140.83 rows=9,969,761 width=36) (actual time=25,612.620..460,406.061 rows=81,021 loops=1)

  • Join Filter: (td."timestamp" <@ i.time_range)
  • Rows Removed by Join Filter: 299306019
11. 0.221 0.221 ↑ 33.3 10 1

CTE Scan on intervals i (cost=0.00..6.66 rows=333 width=32) (actual time=0.060..0.221 rows=10 loops=1)

12. 220,647.715 242,751.280 ↑ 1.0 29,938,704 10

Materialize (cost=0.00..875,147.34 rows=29,939,223 width=12) (actual time=0.006..24,275.128 rows=29,938,704 loops=10)

13. 22,103.565 22,103.565 ↑ 1.0 29,938,704 1

Seq Scan on market_trades td (cost=0.00..579,263.23 rows=29,939,223 width=12) (actual time=0.008..22,103.565 rows=29,938,704 loops=1)