explain.depesz.com

PostgreSQL's explain analyze made readable

Result: F5dM

Settings
# exclusive inclusive rows x rows loops node
1. 0.054 16,819.130 ↑ 1.0 1 1

Nested Loop (cost=5,779.67..5,790.64 rows=1 width=112) (actual time=16,819.110..16,819.130 rows=1 loops=1)

2.          

CTE c

3. 0.023 0.023 ↑ 1.0 1 1

Seq Scan on trades (cost=0.00..1.10 rows=1 width=12) (actual time=0.012..0.023 rows=1 loops=1)

  • Filter: (trade_id = 1)
  • Rows Removed by Filter: 6
4. 0.008 16,818.819 ↑ 1.0 1 1

Nested Loop (cost=5,774.26..5,774.31 rows=1 width=24) (actual time=16,818.817..16,818.819 rows=1 loops=1)

5. 0.008 16,818.809 ↑ 1.0 1 1

Limit (cost=5,774.26..5,774.27 rows=1 width=36) (actual time=16,818.809..16,818.809 rows=1 loops=1)

6. 22.863 16,818.801 ↑ 579.0 1 1

Sort (cost=5,774.26..5,775.71 rows=579 width=36) (actual time=16,818.801..16,818.801 rows=1 loops=1)

  • Sort Key: ((q_1."timestamp" <-> c_1.opened))
  • Sort Method: top-N heapsort Memory: 25kB
7. 23.200 16,795.938 ↓ 40.2 23,289 1

Nested Loop (cost=32.59..5,771.37 rows=579 width=36) (actual time=86.529..16,795.938 rows=23,289 loops=1)

8. 0.037 0.037 ↑ 1.0 1 1

CTE Scan on c c_1 (cost=0.00..0.02 rows=1 width=12) (actual time=0.018..0.037 rows=1 loops=1)

9. 16,698.638 16,772.701 ↓ 40.2 23,289 1

Bitmap Heap Scan on quotes_archive q_1 (cost=32.59..5,764.11 rows=579 width=24) (actual time=86.485..16,772.701 rows=23,289 loops=1)

  • Recheck Cond: (insid = c_1.insid)
  • Filter: (((type)::text = 'lst'::text) OR ((type)::text = 'cls'::text))
  • Rows Removed by Filter: 56,906
  • Heap Blocks: exact=39,373
10. 74.063 74.063 ↓ 50.1 80,195 1

Bitmap Index Scan on quotes_archive_insid (cost=0.00..32.45 rows=1,602 width=0) (actual time=74.063..74.063 rows=80,195 loops=1)

  • Index Cond: (insid = c_1.insid)
11. 0.002 0.002 ↑ 1.0 1 1

CTE Scan on c (cost=0.00..0.02 rows=1 width=4) (actual time=0.001..0.002 rows=1 loops=1)

12. 0.213 0.257 ↑ 1.0 1 1

Bitmap Heap Scan on quotes q (cost=4.31..15.22 rows=1 width=23) (actual time=0.238..0.257 rows=1 loops=1)

  • Recheck Cond: (insid = c.insid)
  • Filter: (((type)::text = 'lst'::text) OR ((type)::text = 'cls'::text))
  • Rows Removed by Filter: 2
  • Heap Blocks: exact=3
13. 0.044 0.044 ↓ 36.0 108 1

Bitmap Index Scan on quotes_insid (cost=0.00..4.30 rows=3 width=0) (actual time=0.044..0.044 rows=108 loops=1)

  • Index Cond: (insid = c.insid)
Planning time : 7.064 ms
Execution time : 16,820.172 ms