explain.depesz.com

PostgreSQL's explain analyze made readable

Result: q2o8

Settings
# exclusive inclusive rows x rows loops node
1. 0.039 2,587.665 ↓ 1.5 3 1

Index Scan Backward using currency_pkey on currency (cost=0.13..281,008.27 rows=2 width=276) (actual time=810.205..2,587.665 rows=3 loops=1)

  • Filter: is_active
  • Rows Removed by Filter: 2
2.          

SubPlan (forIndex Scan Backward)

3. 0.009 0.102 ↑ 1.0 1 3

Limit (cost=8.34..8.34 rows=1 width=43) (actual time=0.034..0.034 rows=1 loops=3)

4. 0.030 0.093 ↑ 3.0 1 3

Sort (cost=8.34..8.34 rows=3 width=43) (actual time=0.031..0.031 rows=1 loops=3)

  • Sort Key: address.id DESC
  • Sort Method: quicksort Memory: 25kB
5. 0.063 0.063 ↑ 1.5 2 3

Index Scan using address_type on address (cost=0.29..8.32 rows=3 width=43) (actual time=0.017..0.021 rows=2 loops=3)

  • Index Cond: (address_type = 'Shield'::e_address_type)
  • Filter: (currency_id = currency.id)
  • Rows Removed by Filter: 7
6. 0.003 0.036 ↑ 1.0 1 3

Limit (cost=4.63..4.64 rows=1 width=43) (actual time=0.012..0.012 rows=1 loops=3)

7. 0.009 0.033 ↑ 1.0 1 3

Sort (cost=4.63..4.64 rows=1 width=43) (actual time=0.011..0.011 rows=1 loops=3)

  • Sort Key: address_1.id DESC
  • Sort Method: quicksort Memory: 25kB
8. 0.024 0.024 ↓ 2.0 2 3

Index Scan using address_type on address address_1 (cost=0.29..4.62 rows=1 width=43) (actual time=0.006..0.008 rows=2 loops=3)

  • Index Cond: (address_type = 'Cover'::e_address_type)
  • Filter: (currency_id = currency.id)
  • Rows Removed by Filter: 8
9. 0.006 2,587.488 ↑ 1.0 1 3

Limit (cost=140,489.55..140,489.55 rows=1 width=36) (actual time=862.495..862.496 rows=1 loops=3)

10. 416.832 2,587.482 ↑ 295,198.0 1 3

Sort (cost=140,489.55..141,227.55 rows=295,198 width=36) (actual time=862.494..862.494 rows=1 loops=3)

  • Sort Key: block.height DESC
  • Sort Method: top-N heapsort Memory: 25kB
11. 2,170.650 2,170.650 ↓ 1.6 464,205 3

Seq Scan on block (cost=0.00..139,013.56 rows=295,198 width=36) (actual time=7.471..723.550 rows=464,205 loops=3)

  • Filter: (is_ingested AND (NOT is_orphaned) AND (currency_id = currency.id))
  • Rows Removed by Filter: 1016080
Planning time : 0.502 ms
Execution time : 2,587.748 ms